Skip to content

Instantly share code, notes, and snippets.

@rafaelanastacioalves
Created September 20, 2016 15:41
Show Gist options
  • Save rafaelanastacioalves/41103babe4bba55285188575cc1a5a93 to your computer and use it in GitHub Desktop.
Save rafaelanastacioalves/41103babe4bba55285188575cc1a5a93 to your computer and use it in GitHub Desktop.
for importing jobs for CI (Jenkins)
#!/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