Last active
August 18, 2016 05:13
-
-
Save viglesiasce/ca07a1001bc5ca84957541fd80095d64 to your computer and use it in GitHub Desktop.
Jenkins job definition for running a script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version='1.0' encoding='UTF-8'?> | |
| <project> | |
| <actions/> | |
| <description></description> | |
| <keepDependencies>false</keepDependencies> | |
| <properties> | |
| <jenkins.model.BuildDiscarderProperty> | |
| <strategy class="hudson.tasks.LogRotator"> | |
| <daysToKeep>10</daysToKeep> | |
| <numToKeep>500</numToKeep> | |
| <artifactDaysToKeep>-1</artifactDaysToKeep> | |
| <artifactNumToKeep>-1</artifactNumToKeep> | |
| </strategy> | |
| </jenkins.model.BuildDiscarderProperty> | |
| <hudson.model.ParametersDefinitionProperty> | |
| <parameterDefinitions> | |
| <hudson.model.StringParameterDefinition> | |
| <name>TASK_ID</name> | |
| <description>Unique Task Id generated by Spinnaker</description> | |
| <defaultValue>0</defaultValue> | |
| </hudson.model.StringParameterDefinition> | |
| <hudson.model.StringParameterDefinition> | |
| <name>SCRIPT_PATH</name> | |
| <description>Path to the folder hosting the scripts</description> | |
| <defaultValue>.</defaultValue> | |
| </hudson.model.StringParameterDefinition> | |
| <hudson.model.StringParameterDefinition> | |
| <name>COMMAND</name> | |
| <description>Executable script and parameters</description> | |
| <defaultValue></defaultValue> | |
| </hudson.model.StringParameterDefinition> | |
| <hudson.model.StringParameterDefinition> | |
| <name>IMAGE_ID</name> | |
| <description>The image ID for this region based on the AMI Spinnaker is deploying</description> | |
| <defaultValue></defaultValue> | |
| </hudson.model.StringParameterDefinition> | |
| <hudson.model.StringParameterDefinition> | |
| <name>REGION_PARAM</name> | |
| <description>The region the Spinnaker deployment is running against</description> | |
| <defaultValue></defaultValue> | |
| </hudson.model.StringParameterDefinition> | |
| <hudson.model.StringParameterDefinition> | |
| <name>ENV_PARAM</name> | |
| <description>Environment Spinnaker is running against</description> | |
| <defaultValue></defaultValue> | |
| </hudson.model.StringParameterDefinition> | |
| <hudson.model.StringParameterDefinition> | |
| <name>CLUSTER_PARAM</name> | |
| <description>The cluster Spinnaker is deploying to</description> | |
| <defaultValue></defaultValue> | |
| </hudson.model.StringParameterDefinition> | |
| <hudson.model.StringParameterDefinition> | |
| <name>CMC</name> | |
| <description>The CMC this deployment is associated with</description> | |
| <defaultValue></defaultValue> | |
| </hudson.model.StringParameterDefinition> | |
| <hudson.model.StringParameterDefinition> | |
| <name>CONTEXT</name> | |
| <description>The parameters available to this task</description> | |
| <defaultValue></defaultValue> | |
| </hudson.model.StringParameterDefinition> | |
| <hudson.model.StringParameterDefinition> | |
| <name>REPO_URL</name> | |
| <description>git repository url.</description> | |
| <defaultValue></defaultValue> | |
| </hudson.model.StringParameterDefinition> | |
| </parameterDefinitions> | |
| </hudson.model.ParametersDefinitionProperty> | |
| </properties> | |
| <scm class="hudson.plugins.git.GitSCM" plugin="[email protected]"> | |
| <configVersion>2</configVersion> | |
| <userRemoteConfigs> | |
| <hudson.plugins.git.UserRemoteConfig> | |
| <name>apidaemon</name> | |
| <url>$REPO_URL</url> | |
| </hudson.plugins.git.UserRemoteConfig> | |
| </userRemoteConfigs> | |
| <branches> | |
| <hudson.plugins.git.BranchSpec> | |
| <name>master</name> | |
| </hudson.plugins.git.BranchSpec> | |
| </branches> | |
| <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations> | |
| <browser class="hudson.plugins.git.browser.Stash"> | |
| <url></url> | |
| </browser> | |
| <submoduleCfg class="list"/> | |
| </scm> | |
| <canRoam>true</canRoam> | |
| <disabled>false</disabled> | |
| <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding> | |
| <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding> | |
| <triggers/> | |
| <concurrentBuild>true</concurrentBuild> | |
| <builders> | |
| <hudson.tasks.Shell> | |
| <command># To run groovy scripts in this stage, you need to add groovy to your path: | |
| # export PATH=$PATH:/PATH/TO/GROOVY/bin | |
| # To add support for grapes, you need to install the package and add this flag, | |
| # pointing to the correct grape root directory. | |
| # export JAVA_OPTS='-Dgrape.root=${WORKSPACE}/.groovy/grape' | |
| echo ${TASK_ID} | |
| ${SCRIPT_PATH}/${COMMAND}</command> | |
| </hudson.tasks.Shell> | |
| </builders> | |
| <publishers> | |
| <hudson.tasks.ArtifactArchiver> | |
| <artifacts>*.properties, *.json, *.yml</artifacts> | |
| <allowEmptyArchive>true</allowEmptyArchive> | |
| <onlyIfSuccessful>false</onlyIfSuccessful> | |
| <fingerprint>false</fingerprint> | |
| <defaultExcludes>true</defaultExcludes> | |
| <caseSensitive>true</caseSensitive> | |
| </hudson.tasks.ArtifactArchiver> | |
| </publishers> | |
| <buildWrappers/> | |
| </project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment