Skip to content

Instantly share code, notes, and snippets.

@stathy
Created May 11, 2013 16:25
Show Gist options
  • Save stathy/5560474 to your computer and use it in GitHub Desktop.
Save stathy/5560474 to your computer and use it in GitHub Desktop.
Leveraging GCE utils for copying artifacts generated by Jenkins upto Google drive, spinning up instances in parallel.
sha256sum -b ./dbapp.war > ./dbapp.sha256
gsutil cp ./dbapp.war ./dbapp.sha256 gs://stathy/${JOB_NAME}/${BUILD_NUMBER}/
gsutil setacl public-read gs://stathy/${JOB_NAME}/${BUILD_NUMBER}/dbapp.war
gsutil setacl public-read gs://stathy/${JOB_NAME}/${BUILD_NUMBER}/dbapp.sha256
cd ${WORKSPACE}
gcutil addinstance dbapp-db dbapp-app1 dbapp-lb \
--project "opscode.com:stathy" --image "/projects/opscode.com:stathy/images/centos-latest" \
--machine_type "n1-standard-1-d" --zone "us-central1-a" \
--authorized_ssh_keys "${USER}:${HOME}/.ssh/google_compute_engine.pub" \
--metadata "environment:${JOB_NAME}-${BUILD_NUMBER}" --wait_until_running
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment