Merge lp:~daniel-thewatkins/vmbuilder/jenkins_kvm-vagrantcloud into lp:~ubuntu-on-ec2/vmbuilder/jenkins_kvm

Proposed by Dan Watkins on 2017-06-28
Status: Merged
Merged at revision: 787
Proposed branch: lp:~daniel-thewatkins/vmbuilder/jenkins_kvm-vagrantcloud
Merge into: lp:~ubuntu-on-ec2/vmbuilder/jenkins_kvm
Diff against target: 43 lines (+5/-5)
1 file modified
register-vagrant-version.sh (+5/-5)
To merge this branch: bzr merge lp:~daniel-thewatkins/vmbuilder/jenkins_kvm-vagrantcloud
Reviewer Review Type Date Requested Status
Francis Ginther 2017-06-28 Approve on 2017-06-29
Robert C Jennings 2017-06-28 Approve on 2017-06-28
Review via email: mp+326462@code.launchpad.net
To post a comment you must log in.
Robert C Jennings (rcj) wrote :

+1

review: Approve
Francis Ginther (fginther) wrote :

Approve

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'register-vagrant-version.sh'
--- register-vagrant-version.sh 2016-03-23 09:14:35 +0000
+++ register-vagrant-version.sh 2017-06-28 19:27:56 +0000
@@ -2,7 +2,7 @@
22
3set -eu3set -eu
44
5API_ROOT="https://atlas.hashicorp.com/api/v1"5API_ROOT="https://vagrantcloud.com/api/v1"
6BOX_OWNER=${BOX_OWNER:-"ubuntu"}6BOX_OWNER=${BOX_OWNER:-"ubuntu"}
77
8SUITE="$1"8SUITE="$1"
@@ -14,7 +14,7 @@
14# Always point to the current image, so we don't run in to a problem with14# Always point to the current image, so we don't run in to a problem with
15# versions being removed in the future15# versions being removed in the future
16case $SUITE in16case $SUITE in
17 precise|trusty|wily)17 trusty)
18 BOX_URL_PREFIX="http://cloud-images.ubuntu.com/vagrant/${SUITE}/current/${SUITE}-server-cloudimg-${ARCH}"18 BOX_URL_PREFIX="http://cloud-images.ubuntu.com/vagrant/${SUITE}/current/${SUITE}-server-cloudimg-${ARCH}"
19 BOX_URL_POSTFIX="-vagrant-disk1.box"19 BOX_URL_POSTFIX="-vagrant-disk1.box"
20 ;;20 ;;
@@ -56,10 +56,10 @@
5656
57make_api_call () {57make_api_call () {
58 echo "Making API call:" $@58 echo "Making API call:" $@
59 curl -f $@ -d "access_token=${ACCESS_TOKEN}" | python -m json.tool59 curl -L -f $@ -d "access_token=${ACCESS_TOKEN}" | python -m json.tool
60}60}
6161
62if curl -f "${API_ROOT}/box/${BOX_OWNER}/${BOX_NAME}"; then62if curl -L -f "${API_ROOT}/box/${BOX_OWNER}/${BOX_NAME}"; then
63 echo "Box ${BOX_NAME} already registered..."63 echo "Box ${BOX_NAME} already registered..."
64else64else
65 echo "Registering ${BOX_NAME}..."65 echo "Registering ${BOX_NAME}..."
@@ -76,7 +76,7 @@
7676
77echo "Check if the version already registered..."77echo "Check if the version already registered..."
78while true; do78while true; do
79 if curl -f "${API_ROOT}/box/${BOX_OWNER}/${BOX_NAME}/version/${VERSION}"; then79 if curl -L -f "${API_ROOT}/box/${BOX_OWNER}/${BOX_NAME}/version/${VERSION}"; then
80 echo "Version ${VERSION} already registered; trying a higher revision."80 echo "Version ${VERSION} already registered; trying a higher revision."
81 VERSION="$(echo "$VERSION" | awk -F. -v OFS=. '{printf("%s.%s.%s\n", $1, $2, ++$3)}')"81 VERSION="$(echo "$VERSION" | awk -F. -v OFS=. '{printf("%s.%s.%s\n", $1, $2, ++$3)}')"
82 else82 else

Subscribers

People subscribed via source and target branches