lburgazzoli closed pull request #72: Add release commands and bump to 0.0.2-SNAPSHOT URL: https://github.com/apache/camel-k/pull/72
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/build/Makefile b/build/Makefile index 335b9c0..57cb693 100644 --- a/build/Makefile +++ b/build/Makefile @@ -1,5 +1,3 @@ -VERSION := $(shell ./build/get_version.sh) - build: build-runtime build-operator build-kamel test build-operator: build-embed-resources @@ -14,14 +12,22 @@ build-embed-resources: build-runtime: mvn clean install -f ./runtime/pom.xml -release: prepare-release build images-build images-push test-integration cross-compile +release: prepare-release build images-build images-push test-integration cross-compile git-tag prepare-release: ./build/prepare_release.sh +new-version: increment-snapshot build images-build images-push + +increment-snapshot: + ./build/next_snapshot.sh + cross-compile: ./build/cross_compile.sh +git-tag: + ./build/git_tag.sh + dep: dep ensure -v @@ -41,10 +47,10 @@ codegen: images: images-build images-build: - ./build/package_maven_artifacts.sh && operator-sdk build docker.io/apache/camel-k:$(VERSION) + ./build/images_build.sh images-push: - docker push docker.io/apache/camel-k:$(VERSION) + ./build/images_push.sh test: check check: @@ -56,4 +62,4 @@ check-integration: -.PHONY: build build-operator build-kamel build-embed-resources build-runtime dep codegen images images-build images-push test check test-integration check-integration clean release prepare-release cross-compile +.PHONY: build build-operator build-kamel build-embed-resources build-runtime dep codegen images images-build images-push test check test-integration check-integration clean release prepare-release cross-compile new-version git-tag increment-snapshot diff --git a/build/git_tag.sh b/build/git_tag.sh new file mode 100755 index 0000000..d1d3adb --- /dev/null +++ b/build/git_tag.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +set -e + +location=$(dirname $0) +version=$($location/get_version.sh) + +git branch -D staging-$version || true +git checkout -b staging-$version +git add * || true +git commit -m "Release $version" +git tag --force $version staging-$version +git push --force upstream $version + +echo "Tag $version pushed upstream" diff --git a/build/images_build.sh b/build/images_build.sh new file mode 100755 index 0000000..7aefdc2 --- /dev/null +++ b/build/images_build.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +location=$(dirname $0) +version=$($location/get_version.sh) + +$location/package_maven_artifacts.sh && operator-sdk build docker.io/apache/camel-k:$version \ No newline at end of file diff --git a/build/images_push.sh b/build/images_push.sh new file mode 100755 index 0000000..2b7eab9 --- /dev/null +++ b/build/images_push.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +location=$(dirname $0) +version=$($location/get_version.sh) + +docker push docker.io/apache/camel-k:$version \ No newline at end of file diff --git a/build/next_snapshot.sh b/build/next_snapshot.sh new file mode 100755 index 0000000..60b79f8 --- /dev/null +++ b/build/next_snapshot.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +set -e + +location=$(dirname $0) +global_version_file=$location/../version/version.go + +version=$($location/get_version.sh) +version_num=$(echo $version | sed -E "s/([0-9.]*)-SNAPSHOT/\1/g") +next_version_num=$(echo $version_num | awk 'BEGIN { FS = "." } ; {print $1"."$2"."++$3}') +next_version="$next_version_num-SNAPSHOT" + +echo "Increasing version to $next_version" + +$location/set_version.sh $next_version diff --git a/build/prepare_release.sh b/build/prepare_release.sh index cd8894c..6357682 100755 --- a/build/prepare_release.sh +++ b/build/prepare_release.sh @@ -3,16 +3,10 @@ set -e location=$(dirname $0) -global_version_file=$location/../version/version.go -# Set the new global version by removing "-SNAPSHOT" -sed -i "s/-SNAPSHOT//g" $global_version_file - -# Get the new version version=$($location/get_version.sh) +version_num=$(echo $version | sed -E "s/([0-9.]*)-SNAPSHOT/\1/g") -# Updating the Java modules -mvn versions:set -DgenerateBackupPoms=false -DnewVersion=$version -f $location/../runtime - -echo "Camel K prepared for releasing version: $version" +$location/set_version.sh $version_num +echo "Camel K prepared for releasing version: $version_num" diff --git a/build/set_version.sh b/build/set_version.sh new file mode 100755 index 0000000..9f0da58 --- /dev/null +++ b/build/set_version.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +set -e + +location=$(dirname $0) +new_version=$1 + +global_version_file=$location/../version/version.go +version=$($location/get_version.sh) + +# Set the new global version +sed -i "s/$version/$new_version/g" $global_version_file +find $location/../deploy -type f -exec sed -i "s/$version/$new_version/g" {} \; + +# Updating the Java modules +mvn versions:set -DgenerateBackupPoms=false -DnewVersion=$new_version -f $location/../runtime + +echo "Camel K version set to: $new_version" + diff --git a/deploy/operator-deployment.yaml b/deploy/operator-deployment.yaml index 265b76d..a53fa27 100644 --- a/deploy/operator-deployment.yaml +++ b/deploy/operator-deployment.yaml @@ -17,7 +17,7 @@ spec: serviceAccountName: camel-k-operator containers: - name: camel-k-operator - image: docker.io/apache/camel-k:0.0.1-SNAPSHOT + image: docker.io/apache/camel-k:0.0.2-SNAPSHOT ports: - containerPort: 60000 name: metrics diff --git a/deploy/resources.go b/deploy/resources.go index c0b8bbf..77a12cd 100644 --- a/deploy/resources.go +++ b/deploy/resources.go @@ -113,7 +113,7 @@ spec: serviceAccountName: camel-k-operator containers: - name: camel-k-operator - image: docker.io/apache/camel-k:0.0.1-SNAPSHOT + image: docker.io/apache/camel-k:0.0.2-SNAPSHOT ports: - containerPort: 60000 name: metrics diff --git a/runtime/jvm/pom.xml b/runtime/jvm/pom.xml index 1aeb457..e19ed68 100644 --- a/runtime/jvm/pom.xml +++ b/runtime/jvm/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.apache.camel.k</groupId> <artifactId>camel-k-runtime-parent</artifactId> - <version>0.0.1-SNAPSHOT</version> + <version>0.0.2-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/runtime/pom.xml b/runtime/pom.xml index fb7cd42..99c337b 100644 --- a/runtime/pom.xml +++ b/runtime/pom.xml @@ -6,7 +6,7 @@ <groupId>org.apache.camel.k</groupId> <artifactId>camel-k-runtime-parent</artifactId> - <version>0.0.1-SNAPSHOT</version> + <version>0.0.2-SNAPSHOT</version> <packaging>pom</packaging> <properties> diff --git a/version/version.go b/version/version.go index f656e8a..78befb0 100644 --- a/version/version.go +++ b/version/version.go @@ -20,5 +20,5 @@ package version var ( // Global Camel K Version - Version = "0.0.1-SNAPSHOT" + Version = "0.0.2-SNAPSHOT" ) ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services