summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2018-05-05 20:29:33 +0200
committerDaniil Baturin <daniil@baturin.org>2018-05-05 20:29:33 +0200
commitdea202e366346dae6b39190c49b6076e3e2859c6 (patch)
tree54f689711a1fc2707df8f9146d205d6715863c8c
parentfb1dc1fa29e7a0b028584ba02dbfaf7555ee40d9 (diff)
parentbc454be832aef40c58180b2175e2cd573a98daf1 (diff)
downloadvyos-build-dea202e366346dae6b39190c49b6076e3e2859c6.tar.gz
vyos-build-dea202e366346dae6b39190c49b6076e3e2859c6.zip
Merge branch 'current' of github.com:vyos/vyos-build into current
-rwxr-xr-xscripts/build-vagrant-libvirt-box11
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/build-vagrant-libvirt-box b/scripts/build-vagrant-libvirt-box
index 7aff4eda..070b3ef7 100755
--- a/scripts/build-vagrant-libvirt-box
+++ b/scripts/build-vagrant-libvirt-box
@@ -54,16 +54,19 @@ fi
PROVIDER=libvirt
# Create version
-curl -XPOST -d "version[version]=${VERSION}" \
+date=$(date -u +%Y%m%d)
+version=$(echo "$date.0.0")
+curl -XPOST -d "version[version]=${version}" \
https://app.vagrantup.com/api/v1/box/${VAGRANT_BOX_NAME}/versions?access_token=${VAGRANT_CLOUD_ACCESS_TOKEN}
echo
# Create provider
-curl -XPOST -d "provider[name]=${PROVIDER}" -d "provider[url]=${VAGRANT_BOX_BASE_URL}/vyos-${VERSION}-vagrant-${PROVIDER}.box" \
- https://app.vagrantup.com/api/v1/box/${VAGRANT_BOX_NAME}/version/${VERSION}/providers?access_token=${VAGRANT_CLOUD_ACCESS_TOKEN}
+urlencoded_version=$(cat build/version | sed 's/+/%2B/')
+curl -XPOST -d "provider[name]=${PROVIDER}" -d "provider[url]=${VAGRANT_BOX_BASE_URL}/vyos-${urlencoded_version}-vagrant-${PROVIDER}.box" \
+ https://app.vagrantup.com/api/v1/box/${VAGRANT_BOX_NAME}/version/${version}/providers?access_token=${VAGRANT_CLOUD_ACCESS_TOKEN}
echo
# Release version
curl -XPUT \
- https://app.vagrantup.com/api/v1/box/${VAGRANT_BOX_NAME}/version/${VERSION}/release?access_token=${VAGRANT_CLOUD_ACCESS_TOKEN}
+ https://app.vagrantup.com/api/v1/box/${VAGRANT_BOX_NAME}/version/${version}/release?access_token=${VAGRANT_CLOUD_ACCESS_TOKEN}
echo