From 28abbfa356d65bafde463ec0eae06b046791a178 Mon Sep 17 00:00:00 2001 From: Lukas Metzger Date: Fri, 27 Dec 2019 12:22:26 +0100 Subject: [PATCH] Add version metadata to packaging --- .travis/build-package.sh | 6 +++--- .travis/deploy-release.sh | 2 +- .travis/deploy-snapshot.sh | 2 +- utils/make-package.sh | 7 +++++++ 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.travis/build-package.sh b/.travis/build-package.sh index 102def6..3c41203 100755 --- a/.travis/build-package.sh +++ b/.travis/build-package.sh @@ -3,10 +3,10 @@ if test $TRAVIS_TAG then - utils/make-package.sh pdnsmanager-${TRAVIS_TAG:1} - utils/make-package.sh pdnsmanager-$TRAVIS_COMMIT + utils/make-package.sh pdnsmanager-${TRAVIS_TAG:1} ${TRAVIS_TAG:1} + utils/make-package.sh pdnsmanager-$TRAVIS_COMMIT $TRAVIS_COMMIT else - utils/make-package.sh pdnsmanager-$TRAVIS_COMMIT + utils/make-package.sh pdnsmanager-$TRAVIS_COMMIT $TRAVIS_COMMIT fi exit 0 diff --git a/.travis/deploy-release.sh b/.travis/deploy-release.sh index 01ac9c4..b02e44a 100755 --- a/.travis/deploy-release.sh +++ b/.travis/deploy-release.sh @@ -1,3 +1,3 @@ #!/bin/bash -curl -F "file=@pdnsmanager-${TRAVIS_TAG:1}.tar.gz" -u "travis:$UPLOAD_PASS" 'https://upload.pdnsmanager.org/?action=release' \ No newline at end of file +curl -F "file=@pdnsmanager-${TRAVIS_TAG:1}.tar.gz" -u "travis:$UPLOAD_PASS" "https://upload.pdnsmanager.org/?action=release&version=${TRAVIS_TAG:1}" \ No newline at end of file diff --git a/.travis/deploy-snapshot.sh b/.travis/deploy-snapshot.sh index 157fdfb..b3c39c9 100755 --- a/.travis/deploy-snapshot.sh +++ b/.travis/deploy-snapshot.sh @@ -1,3 +1,3 @@ #!/bin/bash -curl -F "file=@pdnsmanager-$TRAVIS_COMMIT.tar.gz" -u "travis:$UPLOAD_PASS" 'https://upload.pdnsmanager.org/?action=snapshot' \ No newline at end of file +curl -F "file=@pdnsmanager-$TRAVIS_COMMIT.tar.gz" -u "travis:$UPLOAD_PASS" "https://upload.pdnsmanager.org/?action=snapshot&version=$TRAVIS_COMMIT" \ No newline at end of file diff --git a/utils/make-package.sh b/utils/make-package.sh index 5886648..fab99fc 100755 --- a/utils/make-package.sh +++ b/utils/make-package.sh @@ -21,6 +21,13 @@ cd .. cp LICENSE "$1" cp README.md "$1" +# Add version info +cat << EOF > "$1"/version.json +{ + "version": "$2" +} +EOF + # Create archive tar -czf "$1".tar.gz "$1"