Created
December 9, 2016 09:12
-
-
Save munepom/140a3d6ecfdf614f1ac4b6d2ca2a5740 to your computer and use it in GitHub Desktop.
Jenkins のジョブをコピってくれるくん
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
#!/bin/bash | |
BASE_JOB_NAME=TestJob | |
NEW_JOB_NAME=TestJob | |
BASE_JOB_SERVER=http://base-jenkins.example.com | |
NEW_JOB_SERVER=http://new-jenkins.example.com | |
JENKINS_USER=${USER} | |
JENKINS_API_KEY=$(cat ~/.new_job_server_jenkins_api_key) | |
curl \ | |
-s ${BASE_JOB_SERVER}/job/${BASE_JOB_NAME}/config.xml \ | |
| curl \ | |
--user "${JENKINS_USER}:${JENKINS_API_KEY}" \ | |
-X POST "${NEW_JOB_SERVER}/createItem?name=${NEW_JOB_NAME}" \ | |
--header "Content-Type: application/xml" \ | |
--data-binary @- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment