From 3679a9b501fffd1e17e052a4236030f33cee8ab8 Mon Sep 17 00:00:00 2001 From: Armin Friedl Date: Sun, 12 Jul 2020 01:31:25 +0200 Subject: [PATCH] Use valid semver and version update script --- .drone.yml | 9 ++++++--- VERSION | 1 + scripts/release.sh | 20 +++++++++++++++++++ service/fling/pom.xml | 2 +- .../src/main/resources/application-local.yml | 2 +- service/settings.xml | 9 --------- 6 files changed, 29 insertions(+), 14 deletions(-) create mode 100644 VERSION create mode 100755 scripts/release.sh diff --git a/.drone.yml b/.drone.yml index 4be0d9c..d980a7d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -29,12 +29,15 @@ steps: from_secret: nexus_user NEXUS_PASSWORD: from_secret: nexus_password + VERSION: 0.1.0-snapshot commands: - ls -al - cd web/fling - npm install && npm run build - - tar czf fling-web-latest.tar.gz build/ - - curl --user "$NEXUS_USER:$NEXUS_PASSWORD" --upload-file ./fling-web-latest.tar.gz https://nexus.friedl.net/repository/build-artifacts/fling-web-latest.tar.gz + - tar czf fling-web-$VERSION.tar.gz build/ + - curl --user "$NEXUS_USER:$NEXUS_PASSWORD" + --upload-file ./fling-web-$VERSION.tar.gz + https://nexus.friedl.net/repository/build-artifacts/fling-web-$VERSION.tar.gz - name: publish image: plugins/docker @@ -46,7 +49,7 @@ steps: dockerfile: container/Dockerfile context: ./container repo: arminfriedl/fling - tags: dev + tags: 0.1.0-snapshot - name: runservice image: arminfriedl/fling:dev diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..7a29b0d --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.1.0-snapshot diff --git a/scripts/release.sh b/scripts/release.sh new file mode 100755 index 0000000..913f133 --- /dev/null +++ b/scripts/release.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +SCRIPT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/$(basename "${BASH_SOURCE[0]}")" +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +# Go to project root +cd ${SCRIPT_DIR} +cd .. +echo "Working directory: $(pwd)" + +# Determine versions +CUR_VERSION=$(cat VERSION) +NEW_VERSION=${1} +echo "Replacing ${CUR_VERSION} with ${NEW_VERSION}" + +# Replace all versions +sed -i "s/${CUR_VERSION^^}/${NEW_VERSION^^}/g" service/fling/pom.xml +sed -i "s/${CUR_VERSION,,}/${NEW_VERSION,,}/g" service/fling/src/main/resources/*.yml +sed -i "s/${CUR_VERSION,,}/${NEW_VERSION,,}/g" .drone.yml +sed -i "s/${CUR_VERSION,,}/${NEW_VERSION,,}/g" VERSION diff --git a/service/fling/pom.xml b/service/fling/pom.xml index de6f6e8..52a63d1 100644 --- a/service/fling/pom.xml +++ b/service/fling/pom.xml @@ -11,7 +11,7 @@ net.friedl fling - 0.1-SNAPSHOT + 0.1.0-SNAPSHOT fling Simple artifact sharing diff --git a/service/fling/src/main/resources/application-local.yml b/service/fling/src/main/resources/application-local.yml index 84c1385..218b85c 100644 --- a/service/fling/src/main/resources/application-local.yml +++ b/service/fling/src/main/resources/application-local.yml @@ -33,6 +33,6 @@ fling: signing-key: "changeitchangeitchangeitchangeit" jwt-expiration: "180000" api: - version: "0" + version: "0.1.0-snapshot" server-url: "http://localhost:8080" server-description: "API server for dev" diff --git a/service/settings.xml b/service/settings.xml index 3fef3a2..ccdb209 100644 --- a/service/settings.xml +++ b/service/settings.xml @@ -10,13 +10,4 @@ ${env.NEXUS_PASSWORD} - - - - - nexus - central - https://nexus.friedl.net/repository/maven-central/ - -