diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 0000000..0e12312 --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,17 @@ +name: Java CI + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Build with Gradle + run: ./gradlew build diff --git a/src/main/java/com/bioraft/rundeck/filelookup/FileLookupUtils.java b/src/main/java/com/bioraft/rundeck/filelookup/FileLookupUtils.java new file mode 100644 index 0000000..ec785ec --- /dev/null +++ b/src/main/java/com/bioraft/rundeck/filelookup/FileLookupUtils.java @@ -0,0 +1,33 @@ +/* + * Copyright 2019 BioRAFT, Inc. (http://bioraft.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.bioraft.rundeck.filelookup; + +import com.dtolabs.rundeck.core.Constants; +import com.dtolabs.rundeck.core.dispatcher.ContextView; +import com.dtolabs.rundeck.plugins.step.PluginStepContext; + +public class FileLookupUtils { + + public static void addOutput(PluginStepContext context, String group, String name, String value, boolean elevate) { + context.getOutputContext().addOutput(group, name, value); + if (elevate) { + String groupName = group + "." + name; + context.getOutputContext().addOutput(ContextView.global(), "export", groupName, value); + context.getLogger().log(Constants.DEBUG_LEVEL, "Elevating to globsal ${export." + groupName + "}."); + } + } + +} \ No newline at end of file