Created
September 20, 2016 15:41
-
-
Save rafaelanastacioalves/41103babe4bba55285188575cc1a5a93 to your computer and use it in GitHub Desktop.
for importing jobs for CI (Jenkins)
This file contains 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
#!/bin/bash | |
# Created by Rafael Alves | |
#Hardcoded for localhost jenkins... | |
# Variables: | |
# $2 - Name of the created job after import. Uses the same name of the file to be imported if null | |
# $1 - Path to the job file to be imported | |
if [ -z $2 ] | |
then | |
file_name=$(basename $1) | |
name_created_job=$file_name | |
else | |
name_created_job=$2 | |
fi | |
java -jar jenkins-cli.jar -s http://localhost:8080 create-job $name_created_job < $1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment