From aad7b6f31c7bf78c958ff27c6fd60afc6cb02d7a Mon Sep 17 00:00:00 2001 From: Corneil du Plessis Date: Wed, 27 Nov 2024 12:13:44 +0200 Subject: [PATCH] Fix update-project-version.sh Fixes update-project-version.sh to change order of property updates. Ensure all scripts used are from 2022.0.x --- .github/workflows/common.yml | 293 ++++++++---------- applications/stream-applications-core/pom.xml | 4 +- mvn-get-version.sh | 4 +- update-project-version.sh | 44 ++- 4 files changed, 152 insertions(+), 193 deletions(-) diff --git a/.github/workflows/common.yml b/.github/workflows/common.yml index 9b1e4e42e..75a31c2df 100644 --- a/.github/workflows/common.yml +++ b/.github/workflows/common.yml @@ -70,14 +70,10 @@ jobs: runs-on: ubuntu-latest steps: - name: 'Configure: checkout' - uses: actions/checkout@v3 - with: - ref: 'main' - name: 'Configure: checkout stream-applications@${{ inputs.branch }}' uses: actions/checkout@v3 with: ref: ${{ inputs.branch }} - path: 'stream-applications' - name: 'Configure: Ensure scripts are executable' shell: bash run: find . -type f -name "*.sh" -exec chmod a+x '{}' \; @@ -85,40 +81,38 @@ jobs: shell: bash run: | ROOT_DIR=$(realpath $PWD) - pushd stream-applications > /dev/null - echo "::info ::getting build version params" - source $ROOT_DIR/get-build-version-params.sh - echo "BUILD_VERSION=$BUILD_VERSION" >> $GITHUB_ENV - echo "BUILD_VERSION_TYPE=$BUILD_VERSION_TYPE" >> $GITHUB_ENV - echo "CUR_VERSION=$CUR_VERSION" >> $GITHUB_ENV - echo "IS_VERSION_CHANGE=$IS_VERSION_CHANGE" >> $GITHUB_ENV - echo "NEXT_DEV_VERSION=$NEXT_DEV_VERSION" >> $GITHUB_ENV - echo "RELEASE_TRAIN_VERSION=$RELEASE_TRAIN_VERSION" >> $GITHUB_ENV - echo "RELEASE_TRAIN_NEXT_DEV_VERSION=$RELEASE_TRAIN_NEXT_DEV_VERSION" >> $GITHUB_ENV - echo "BUILD_NAME=cloud-stream-applications-$BRANCH" >> $GITHUB_ENV - echo "BUILD_NUMBER=$GITHUB_RUN_NUMBER" >> $GITHUB_ENV - echo "::info ::creating streams applications matrix" - $ROOT_DIR/create-matrices.sh - if [ ! -f matrix.json ]; then - echo "Expected to find matrix.json in:" - ls -al - exit 2 - fi - COUNT=$(jq '.count' matrix.json) - MAX_PARALLEL=$((5 * COUNT / 4)) - if ((MAX_PARALLEL == COUNT)); then - MAX_PARALLEL=$((COUNT + 1)) - fi - MATRIX=$(jq -c . matrix.json) - PROCESSORS=$(jq -c '.processors' matrix.json) - SINKS=$(jq -c '.sinks' matrix.json) - SOURCES=$(jq -c '.sources' matrix.json) - echo "MAX_PARALLEL=$MAX_PARALLEL" >> $GITHUB_ENV - echo "MATRIX=$MATRIX" >> $GITHUB_ENV - echo "PROCESSORS=$PROCESSORS" >> $GITHUB_ENV - echo "SINKS=$SINKS" >> $GITHUB_ENV - echo "SOURCES=$SOURCES" >> $GITHUB_ENV - popd + echo "::info ::getting build version params" + source $ROOT_DIR/get-build-version-params.sh + echo "BUILD_VERSION=$BUILD_VERSION" >> $GITHUB_ENV + echo "BUILD_VERSION_TYPE=$BUILD_VERSION_TYPE" >> $GITHUB_ENV + echo "CUR_VERSION=$CUR_VERSION" >> $GITHUB_ENV + echo "IS_VERSION_CHANGE=$IS_VERSION_CHANGE" >> $GITHUB_ENV + echo "NEXT_DEV_VERSION=$NEXT_DEV_VERSION" >> $GITHUB_ENV + echo "RELEASE_TRAIN_VERSION=$RELEASE_TRAIN_VERSION" >> $GITHUB_ENV + echo "RELEASE_TRAIN_NEXT_DEV_VERSION=$RELEASE_TRAIN_NEXT_DEV_VERSION" >> $GITHUB_ENV + echo "BUILD_NAME=cloud-stream-applications-$BRANCH" >> $GITHUB_ENV + echo "BUILD_NUMBER=$GITHUB_RUN_NUMBER" >> $GITHUB_ENV + echo "::info ::creating streams applications matrix" + $ROOT_DIR/create-matrices.sh + if [ ! -f matrix.json ]; then + echo "Expected to find matrix.json in:" + ls -al + exit 2 + fi + COUNT=$(jq '.count' matrix.json) + MAX_PARALLEL=$((5 * COUNT / 4)) + if ((MAX_PARALLEL == COUNT)); then + MAX_PARALLEL=$((COUNT + 1)) + fi + MATRIX=$(jq -c . matrix.json) + PROCESSORS=$(jq -c '.processors' matrix.json) + SINKS=$(jq -c '.sinks' matrix.json) + SOURCES=$(jq -c '.sources' matrix.json) + echo "MAX_PARALLEL=$MAX_PARALLEL" >> $GITHUB_ENV + echo "MATRIX=$MATRIX" >> $GITHUB_ENV + echo "PROCESSORS=$PROCESSORS" >> $GITHUB_ENV + echo "SINKS=$SINKS" >> $GITHUB_ENV + echo "SOURCES=$SOURCES" >> $GITHUB_ENV if [[ "${{ inputs.branch }}" == *"2021"* ]]; then echo "JDK_BUILD=8" >> $GITHUB_ENV @@ -171,14 +165,9 @@ jobs: - parameters steps: - name: 'Configure: checkout stream-applications@main' - uses: actions/checkout@v3 - with: - ref: 'main' - - name: 'Configure: checkout stream-applications@${{ inputs.branch }}' uses: actions/checkout@v3 with: ref: ${{ inputs.branch }} - path: 'stream-applications' - name: 'Configure: Ensure scripts are executable' shell: bash run: find . -type f -name "*.sh" -exec chmod a+x '{}' \; @@ -217,20 +206,18 @@ jobs: VERBOSE: ${{ (github.debug || inputs.verbose) && '-X' || '' }} run: | ROOT_DIR=$(realpath $PWD) - pushd stream-applications >/dev/null - echo "::notice ::updating versions to ${{ needs.parameters.outputs.build_version }} / ${{ needs.parameters.outputs.release_train_version }}" - $ROOT_DIR/update-project-version.sh "${{ needs.parameters.outputs.build_version }}" "${{ needs.parameters.outputs.release_train_version }}" - echo "::notice ::checking updated versions" - set +e - MESSAGE=$($ROOT_DIR/check-versions-for-release.sh ${{ needs.parameters.outputs.build_version_type }}) - RC=$? - if ((RC!=0)); then - echo "::error ::$MESSAGE" - exit $RC - else - echo "::info ::$MESSAGE" - fi - popd > /dev/null + echo "::notice ::updating versions to ${{ needs.parameters.outputs.build_version }} / ${{ needs.parameters.outputs.release_train_version }}" + $ROOT_DIR/update-project-version.sh "${{ needs.parameters.outputs.build_version }}" "${{ needs.parameters.outputs.release_train_version }}" + echo "::notice ::checking updated versions" + set +e + MESSAGE=$($ROOT_DIR/check-versions-for-release.sh ${{ needs.parameters.outputs.build_version_type }}) + RC=$? + if ((RC!=0)); then + echo "::error ::$MESSAGE" + exit $RC + else + echo "::info ::$MESSAGE" + fi - name: 'Action: build initial dependencies' shell: bash timeout-minutes: 60 @@ -244,7 +231,6 @@ jobs: BUILD_VERSION_TYPE: ${{ needs.parameters.outputs.build_version_type }} run: | ROOT_DIR=$(realpath $PWD) - pushd stream-applications > /dev/null echo "::notice ::building - stream-applications-build,functions,applications/stream-applications-core" set -e $ROOT_DIR/build-core.sh "install -DskipTests" @@ -252,7 +238,6 @@ jobs: $ROOT_DIR/build-core.sh "verify deploy" set +e echo "::notice ::core build completed" - popd > /dev/null - name: Unit Test Report uses: dorny/test-reporter@v1 if: ${{ success() || failure() }} @@ -289,14 +274,9 @@ jobs: runs-on: ubuntu-latest steps: - name: 'Configure: checkout stream-applications' - uses: actions/checkout@v3 - with: - ref: 'main' - - name: 'Configure: checkout stream-applications@${{ inputs.branch }}' uses: actions/checkout@v3 with: ref: ${{ inputs.branch }} - path: 'stream-applications' - name: Ensure scripts are executable shell: bash run: find . -type f -name "*.sh" -exec chmod a+x '{}' \; @@ -336,20 +316,18 @@ jobs: VERBOSE: ${{ (github.debug || inputs.verbose) && '-X' || '' }} run: | ROOT_DIR=$(realpath $PWD) - pushd stream-applications >/dev/null - echo "::notice ::updating versions to ${{ needs.parameters.outputs.build_version }} / ${{ needs.parameters.outputs.release_train_version }}" - $ROOT_DIR/update-project-version.sh "${{ needs.parameters.outputs.build_version }}" "${{ needs.parameters.outputs.release_train_version }}" - echo "::notice ::checking updated versions" - set +e - MESSAGE=$($ROOT_DIR/check-versions-for-release.sh ${{ needs.parameters.outputs.build_version_type }}) - RC=$? - if ((RC!=0)); then - echo "::error ::$MESSAGE" - exit $RC - else - echo "::info ::$MESSAGE" - fi - popd > /dev/null + echo "::notice ::updating versions to ${{ needs.parameters.outputs.build_version }} / ${{ needs.parameters.outputs.release_train_version }}" + $ROOT_DIR/update-project-version.sh "${{ needs.parameters.outputs.build_version }}" "${{ needs.parameters.outputs.release_train_version }}" + echo "::notice ::checking updated versions" + set +e + MESSAGE=$($ROOT_DIR/check-versions-for-release.sh ${{ needs.parameters.outputs.build_version_type }}) + RC=$? + if ((RC!=0)); then + echo "::error ::$MESSAGE" + exit $RC + else + echo "::info ::$MESSAGE" + fi - name: 'Configure: Docker login' uses: docker/login-action@v2 with: @@ -421,14 +399,9 @@ jobs: runs-on: ubuntu-latest steps: - name: 'Configure: checkout stream-applications' - uses: actions/checkout@v3 - with: - ref: 'main' - - name: 'Configure: checkout stream-applications@${{ inputs.branch }}' uses: actions/checkout@v3 with: ref: ${{ inputs.branch }} - path: 'stream-applications' - name: Ensure scripts are executable shell: bash run: find . -type f -name "*.sh" -exec chmod a+x '{}' \; @@ -457,20 +430,18 @@ jobs: VERBOSE: ${{ (github.debug || inputs.verbose) && '-X' || '' }} run: | ROOT_DIR=$(realpath $PWD) - pushd stream-applications >/dev/null - echo "::notice ::updating versions to ${{ needs.parameters.outputs.build_version }} / ${{ needs.parameters.outputs.release_train_version }}" - $ROOT_DIR/update-project-version.sh "${{ needs.parameters.outputs.build_version }}" "${{ needs.parameters.outputs.release_train_version }}" - echo "::notice ::checking updated versions" - set +e - MESSAGE=$($ROOT_DIR/check-versions-for-release.sh ${{ needs.parameters.outputs.build_version_type }}) - RC=$? - if ((RC!=0)); then - echo "::error ::$MESSAGE" - exit $RC - else - echo "::info ::$MESSAGE" - fi - popd > /dev/null + echo "::notice ::updating versions to ${{ needs.parameters.outputs.build_version }} / ${{ needs.parameters.outputs.release_train_version }}" + $ROOT_DIR/update-project-version.sh "${{ needs.parameters.outputs.build_version }}" "${{ needs.parameters.outputs.release_train_version }}" + echo "::notice ::checking updated versions" + set +e + MESSAGE=$($ROOT_DIR/check-versions-for-release.sh ${{ needs.parameters.outputs.build_version_type }}) + RC=$? + if ((RC!=0)); then + echo "::error ::$MESSAGE" + exit $RC + else + echo "::info ::$MESSAGE" + fi - name: 'Configure: Docker login' uses: docker/login-action@v2 with: @@ -543,14 +514,9 @@ jobs: app: ${{ fromJson(needs.parameters.outputs.sources) }} steps: - name: 'Configure: checkout stream-applications' - uses: actions/checkout@v3 - with: - ref: 'main' - - name: 'Configure: checkout stream-applications@${{ inputs.branch }}' uses: actions/checkout@v3 with: ref: ${{ inputs.branch }} - path: 'stream-applications' - name: Ensure scripts are executable shell: bash run: find . -type f -name "*.sh" -exec chmod a+x '{}' \; @@ -587,20 +553,18 @@ jobs: VERBOSE: ${{ (github.debug || inputs.verbose) && '-X' || '' }} run: | ROOT_DIR=$(realpath $PWD) - pushd stream-applications >/dev/null - echo "::notice ::updating versions to ${{ needs.parameters.outputs.build_version }} / ${{ needs.parameters.outputs.release_train_version }}" - $ROOT_DIR/update-project-version.sh "${{ needs.parameters.outputs.build_version }}" "${{ needs.parameters.outputs.release_train_version }}" - echo "::notice ::checking updated versions" - set +e - MESSAGE=$($ROOT_DIR/check-versions-for-release.sh ${{ needs.parameters.outputs.build_version_type }}) - RC=$? - if ((RC!=0)); then - echo "::error ::$MESSAGE" - exit $RC - else - echo "::info ::$MESSAGE" - fi - popd > /dev/null + echo "::notice ::updating versions to ${{ needs.parameters.outputs.build_version }} / ${{ needs.parameters.outputs.release_train_version }}" + $ROOT_DIR/update-project-version.sh "${{ needs.parameters.outputs.build_version }}" "${{ needs.parameters.outputs.release_train_version }}" + echo "::notice ::checking updated versions" + set +e + MESSAGE=$($ROOT_DIR/check-versions-for-release.sh ${{ needs.parameters.outputs.build_version_type }}) + RC=$? + if ((RC!=0)); then + echo "::error ::$MESSAGE" + exit $RC + else + echo "::info ::$MESSAGE" + fi - name: 'Configure: Docker login' uses: docker/login-action@v2 with: @@ -671,14 +635,9 @@ jobs: runs-on: ubuntu-latest steps: - name: 'Configure: checkout stream-applications' - uses: actions/checkout@v3 - with: - ref: 'main' - - name: 'Configure: checkout stream-applications@${{ inputs.branch }}' uses: actions/checkout@v3 with: ref: ${{ inputs.branch }} - path: 'stream-applications' - name: Ensure scripts are executable shell: bash run: find . -type f -name "*.sh" -exec chmod a+x '{}' \; @@ -713,20 +672,18 @@ jobs: VERBOSE: ${{ (github.debug || inputs.verbose) && '-X' || '' }} run: | ROOT_DIR=$(realpath $PWD) - pushd stream-applications >/dev/null - echo "::notice ::updating versions to ${{ needs.parameters.outputs.build_version }} / ${{ needs.parameters.outputs.release_train_version }}" - $ROOT_DIR/update-project-version.sh "${{ needs.parameters.outputs.build_version }}" "${{ needs.parameters.outputs.release_train_version }}" - echo "::notice ::checking updated versions" - set +e - MESSAGE=$($ROOT_DIR/check-versions-for-release.sh ${{ needs.parameters.outputs.build_version_type }}) - RC=$? - if ((RC!=0)); then - echo "::error ::$MESSAGE" - exit $RC - else - echo "::info ::$MESSAGE" - fi - popd > /dev/null + echo "::notice ::updating versions to ${{ needs.parameters.outputs.build_version }} / ${{ needs.parameters.outputs.release_train_version }}" + $ROOT_DIR/update-project-version.sh "${{ needs.parameters.outputs.build_version }}" "${{ needs.parameters.outputs.release_train_version }}" + echo "::notice ::checking updated versions" + set +e + MESSAGE=$($ROOT_DIR/check-versions-for-release.sh ${{ needs.parameters.outputs.build_version_type }}) + RC=$? + if ((RC!=0)); then + echo "::error ::$MESSAGE" + exit $RC + else + echo "::info ::$MESSAGE" + fi - uses: jfrog/setup-jfrog-cli@v3 env: JF_URL: 'https://repo.spring.io' @@ -755,11 +712,9 @@ jobs: BUILD_VERSION_TYPE: ${{ needs.parameters.outputs.build_version_type }} run: | ROOT_DIR=$(realpath $PWD) - pushd stream-applications > /dev/null - echo "::notice ::building - stream-applications-release-train" - set -e - VERSION=${{ needs.parameters.outputs.build_version }} $ROOT_DIR/build-folder.sh stream-applications-release-train "install deploy" - popd > /dev/null + echo "::notice ::building - stream-applications-release-train" + set -e + VERSION=${{ needs.parameters.outputs.build_version }} $ROOT_DIR/build-folder.sh stream-applications-release-train "install deploy" - name: 'Configure: Install libxml2-utils' uses: ./.github/actions/install-libxml2-utils - name: Upload descriptors @@ -769,20 +724,18 @@ jobs: RELEASE_TRAIN_VERSION: ${{ needs.parameters.outputs.release_train_version }} run: | ROOT_DIR=$(realpath $PWD) - pushd stream-applications > /dev/null - echo "::notice ::uploading unique version snapshot descriptors:$RELEASE_TRAIN_VERSION" - set -e - SRC_ROOT=$ROOT_DIR/stream-applications/stream-applications-release-train/stream-applications-descriptor/target/classes/META-INF - TARGET_REPO=libs-snapshot-local/org/springframework/cloud/stream/app/stream-applications-descriptor/${RELEASE_TRAIN_VERSION} - jfrog rt upload "$SRC_ROOT/kafka-apps-maven.properties" "${TARGET_REPO}/stream-applications-descriptor-${RELEASE_TRAIN_VERSION}.stream-apps-kafka-maven" - jfrog rt upload "$SRC_ROOT/kafka-apps-docker.properties" "${TARGET_REPO}/stream-applications-descriptor-${RELEASE_TRAIN_VERSION}.stream-apps-kafka-docker" - jfrog rt upload "$SRC_ROOT/kafka-apps-harbor.properties" "${TARGET_REPO}/stream-applications-descriptor-${RELEASE_TRAIN_VERSION}.stream-apps-kafka-harbor" - jfrog rt upload "$SRC_ROOT/rabbit-apps-maven.properties" "${TARGET_REPO}/stream-applications-descriptor-${RELEASE_TRAIN_VERSION}.stream-apps-rabbit-maven" - jfrog rt upload "$SRC_ROOT/rabbit-apps-docker.properties" "${TARGET_REPO}/stream-applications-descriptor-${RELEASE_TRAIN_VERSION}.stream-apps-rabbit-docker" - jfrog rt upload "$SRC_ROOT/rabbit-apps-harbor.properties" "${TARGET_REPO}/stream-applications-descriptor-${RELEASE_TRAIN_VERSION}.stream-apps-rabbit-harbor" - jfrog rt upload "$SRC_ROOT/kafka-apps-maven-repo-url.properties" "${TARGET_REPO}/stream-applications-descriptor-${RELEASE_TRAIN_VERSION}.kafka-apps-maven-repo-url.properties" - jfrog rt upload "$SRC_ROOT/rabbit-apps-maven-repo-url.properties" "${TARGET_REPO}/stream-applications-descriptor-${RELEASE_TRAIN_VERSION}.rabbit-apps-maven-repo-url.properties" - popd > /dev/null + echo "::notice ::uploading unique version snapshot descriptors:$RELEASE_TRAIN_VERSION" + set -e + SRC_ROOT=$ROOT_DIR/stream-applications/stream-applications-release-train/stream-applications-descriptor/target/classes/META-INF + TARGET_REPO=libs-snapshot-local/org/springframework/cloud/stream/app/stream-applications-descriptor/${RELEASE_TRAIN_VERSION} + jfrog rt upload "$SRC_ROOT/kafka-apps-maven.properties" "${TARGET_REPO}/stream-applications-descriptor-${RELEASE_TRAIN_VERSION}.stream-apps-kafka-maven" + jfrog rt upload "$SRC_ROOT/kafka-apps-docker.properties" "${TARGET_REPO}/stream-applications-descriptor-${RELEASE_TRAIN_VERSION}.stream-apps-kafka-docker" + jfrog rt upload "$SRC_ROOT/kafka-apps-harbor.properties" "${TARGET_REPO}/stream-applications-descriptor-${RELEASE_TRAIN_VERSION}.stream-apps-kafka-harbor" + jfrog rt upload "$SRC_ROOT/rabbit-apps-maven.properties" "${TARGET_REPO}/stream-applications-descriptor-${RELEASE_TRAIN_VERSION}.stream-apps-rabbit-maven" + jfrog rt upload "$SRC_ROOT/rabbit-apps-docker.properties" "${TARGET_REPO}/stream-applications-descriptor-${RELEASE_TRAIN_VERSION}.stream-apps-rabbit-docker" + jfrog rt upload "$SRC_ROOT/rabbit-apps-harbor.properties" "${TARGET_REPO}/stream-applications-descriptor-${RELEASE_TRAIN_VERSION}.stream-apps-rabbit-harbor" + jfrog rt upload "$SRC_ROOT/kafka-apps-maven-repo-url.properties" "${TARGET_REPO}/stream-applications-descriptor-${RELEASE_TRAIN_VERSION}.kafka-apps-maven-repo-url.properties" + jfrog rt upload "$SRC_ROOT/rabbit-apps-maven-repo-url.properties" "${TARGET_REPO}/stream-applications-descriptor-${RELEASE_TRAIN_VERSION}.rabbit-apps-maven-repo-url.properties" - name: Set Stream Applications Docs Properties for ${{ needs.parameters.outputs.release_train_version }} run: | @@ -816,14 +769,12 @@ jobs: if: ${{ needs.parameters.outputs.is_version_change == 'true' }} shell: bash run: | - pushd stream-applications > /dev/null - git config user.name "GitHub Actions Bot" - git config user.email "<>" - git commit -a -m "Release ${{ needs.parameters.outputs.build_version }} / ${{ needs.parameters.outputs.release_train_version }}" - git tag "v${{ needs.parameters.outputs.build_version }}" - git tag "v${{ needs.parameters.outputs.release_train_version }}" - git push --tags -v origin - popd > /dev/null + git config user.name "GitHub Actions Bot" + git config user.email "<>" + git commit -a -m "Release ${{ needs.parameters.outputs.build_version }} / ${{ needs.parameters.outputs.release_train_version }}" + git tag "v${{ needs.parameters.outputs.build_version }}" + git tag "v${{ needs.parameters.outputs.release_train_version }}" + git push --tags -v origin - name: Install tooling for Github release if: ${{ needs.parameters.outputs.is_version_change == 'true' }} @@ -857,16 +808,14 @@ jobs: VERBOSE: ${{ (github.debug || inputs.verbose) && '-X' || '' }} run: | ROOT_DIR=$(realpath $PWD) - pushd stream-applications >/dev/null - git config user.name "GitHub Actions Bot" - git config user.email "<>" - echo "::notice ::updating next dev versions to ${{ needs.parameters.outputs.next_dev_version }} / ${{ needs.parameters.outputs.release_train_next_dev_version }}" - $ROOT_DIR/update-project-version.sh "${{ needs.parameters.outputs.next_dev_version }}" "${{ needs.parameters.outputs.release_train_next_dev_version }}" - echo "::notice ::setting released version to next dev version ${{ needs.parameters.outputs.next_dev_version }} / ${{ needs.parameters.outputs.release_train_next_dev_version }}" - ./next-dev-version.sh - git commit -a -m "Next development version ${{ needs.parameters.outputs.next_dev_version }} / ${{ needs.parameters.outputs.release_train_next_dev_version }}" - git push -v origin - popd > /dev/null + git config user.name "GitHub Actions Bot" + git config user.email "<>" + echo "::notice ::updating next dev versions to ${{ needs.parameters.outputs.next_dev_version }} / ${{ needs.parameters.outputs.release_train_next_dev_version }}" + $ROOT_DIR/update-project-version.sh "${{ needs.parameters.outputs.next_dev_version }}" "${{ needs.parameters.outputs.release_train_next_dev_version }}" + echo "::notice ::setting released version to next dev version ${{ needs.parameters.outputs.next_dev_version }} / ${{ needs.parameters.outputs.release_train_next_dev_version }}" + ./next-dev-version.sh + git commit -a -m "Next development version ${{ needs.parameters.outputs.next_dev_version }} / ${{ needs.parameters.outputs.release_train_next_dev_version }}" + git push -v origin - name: 'Start Integration Tests for ${{ needs.parameters.outputs.build_version }}' if: ${{ success() }} shell: bash diff --git a/applications/stream-applications-core/pom.xml b/applications/stream-applications-core/pom.xml index 77f786a22..ecd0a9120 100644 --- a/applications/stream-applications-core/pom.xml +++ b/applications/stream-applications-core/pom.xml @@ -16,8 +16,8 @@ pom - 4.0.1 - 4.0.1 + 4.0.1-SNAPSHOT + 4.0.1-SNAPSHOT springcloud/baseimage:1.0.4 1.5.2 1.0.14 diff --git a/mvn-get-version.sh b/mvn-get-version.sh index fa367ef40..fcd4ea0ab 100755 --- a/mvn-get-version.sh +++ b/mvn-get-version.sh @@ -3,6 +3,6 @@ SCDIR=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") SCDIR=$(realpath $SCDIR) VERSIONS=$($SCDIR/mvnw exec:exec -Dexec.executable='echo' -Dexec.args='${project.version}' --non-recursive -q | sed 's/\"//g' | sed 's/version=//g') for v in $VERSIONS; do - VERSION=$v + MVN_VERSION=$v done -echo "$VERSION" +echo "$MVN_VERSION" diff --git a/update-project-version.sh b/update-project-version.sh index f3ee1064a..1876b8231 100755 --- a/update-project-version.sh +++ b/update-project-version.sh @@ -11,7 +11,8 @@ function find_version() { done echo $VER } -VERSION=$1 +./mvnw clean install -DskipTests -T 1C +NEW_VERSION=$1 RELEASE_TRAIN_VERSION=$2 OLD_VERSION=$($SCDIR/mvnw help:evaluate -Dexpression=project.version -q -DforceStdout 2> /dev/null) OLD_VERSION=$(find_version "$OLD_VERSION") @@ -20,45 +21,54 @@ OLD_RT_VERSION=$(find_version "$OLD_RT_VERSION") if [ "$VERBOSE" = "" ]; then VERBOSE=-q fi -echo "Version:[$OLD_VERSION] -> [$VERSION]" +echo "Version:[$OLD_VERSION] -> [$NEW_VERSION]" echo "Release Train Version: [$OLD_RT_VERSION] -> [$RELEASE_TRAIN_VERSION]" +set -e + +$SCDIR/mvnw versions:set -f stream-applications-build \ + -o -s .settings.xml -DgenerateBackupPoms=false -Dartifactory.publish.artifacts=false -B $VERBOSE \ + -DoldVersion="$OLD_VERSION" -DnewVersion="$NEW_VERSION" -DprocessAllModules=false +$SCDIR/mvnw install -DskipResolution=true -pl :stream-applications-build -DskipTests -T 1C + +$SCDIR/mvnw versions:set -f functions/function-dependencies \ + -o -s .settings.xml -DgenerateBackupPoms=false -Dartifactory.publish.artifacts=false -B $VERBOSE \ + -DoldVersion="$OLD_VERSION" -DnewVersion="$NEW_VERSION" -DprocessAllModules=false +$SCDIR/mvnw install -DskipResolution=true -pl :function-dependencies -DskipTests -T 1C $SCDIR/mvnw versions:set \ - -DskipResolution=true -s .settings.xml -DgenerateBackupPoms=false -Dartifactory.publish.artifacts=false -B $VERBOSE \ - -DoldVersion="$OLD_VERSION" -DnewVersion="$VERSION" -DprocessAllModules=true + -s .settings.xml -DgenerateBackupPoms=false -Dartifactory.publish.artifacts=false -B $VERBOSE \ + -DoldVersion="$OLD_VERSION" -DnewVersion="$NEW_VERSION" -DprocessAllModules=true $SCDIR/mvnw versions:set-property -f applications/stream-applications-core \ -DskipResolution=true -s .settings.xml -DgenerateBackupPoms=false -B $VERBOSE \ - -Dproperty=stream-apps-core.version -DnewVersion="$VERSION" + -Dproperty=stream-apps-core.version -DnewVersion="$NEW_VERSION" $SCDIR/mvnw versions:set-property -f applications/stream-applications-core \ -DskipResolution=true -s .settings.xml -DgenerateBackupPoms=false -B $VERBOSE \ - -Dproperty=java-functions.version -DnewVersion="$VERSION" + -Dproperty=java-functions.version -DnewVersion="$NEW_VERSION" $SCDIR/mvnw versions:set-property -pl :stream-applications-release-train \ -DskipResolution=true -s .settings.xml -DgenerateBackupPoms=false -B $VERBOSE \ - -Dproperty=apps.version -DnewVersion="$VERSION" - -$SCDIR/mvnw install -pl :function-dependencies -am -DskipTests -T 1C + -Dproperty=apps.version -DnewVersion="$NEW_VERSION" -OLD_RT_VERSION=$($SCDIR/mvnw help:evaluate -Dexpression=project.version -q -DforceStdout -f ./stream-applications-release-train 2> /dev/null) +OLD_RT_VERSION=$($SCDIR/mvnw help:evaluate -DskipResolution=true -Dexpression=project.version -q -DforceStdout -f ./stream-applications-release-train 2> /dev/null) OLD_RT_VERSION=$(find_version "$OLD_RT_VERSION") echo "Release Train Version: [$OLD_RT_VERSION] -> [$RELEASE_TRAIN_VERSION]" echo "Update versions for stream-applications-release-train -> $RELEASE_TRAIN_VERSION" $SCDIR/mvnw versions:set -f ./stream-applications-release-train \ - -DskipResolution=true -s .settings.xml -DgenerateBackupPoms=false -Dartifactory.publish.artifacts=false -B $VERBOSE \ + -DskipResolution=true -s .settings.xml -DgenerateBackupPoms=false -Dartifactory.publish.artifacts=false -B $VERBOSE \ -DoldVersion="$OLD_RT_VERSION" -DnewVersion="$RELEASE_TRAIN_VERSION" -NEW_VERSION=$($SCDIR/mvnw help:evaluate -DskipResolution=true -Dexpression=project.version -q -DforceStdout 2> /dev/null) -NEW_VERSION=$(find_version "$NEW_VERSION") -if [ "$NEW_VERSION" != "$VERSION" ]; then - echo "Expected stream-applications version to be $VERSION not $NEW_VERSION" +FOUND_VERSION=$($SCDIR/mvnw help:evaluate -Dexpression=project.version -q -DforceStdout 2> /dev/null) +FOUND_VERSION=$(find_version "$FOUND_VERSION") +if [ "$NEW_VERSION" != "$FOUND_VERSION" ]; then + echo "Expected stream-applications version to be $NEW_VERSION not $FOUND_VERSION" exit 1 fi -echo "Version updated: stream-applications: $NEW_VERSION" +echo "Version updated: stream-applications: $FOUND_VERSION" PROJECTS="stream-applications-release-train stream-applications-descriptor stream-applications-docs" for proj in $PROJECTS; do - NEW_RT_VERSION=$($SCDIR/mvnw help:evaluate -DskipResolution=true -Dexpression=project.version -q -DforceStdout -pl :$proj 2> /dev/null) + NEW_RT_VERSION=$($SCDIR/mvnw help:evaluate -Dexpression=project.version -q -DforceStdout -pl :$proj 2> /dev/null) NEW_RT_VERSION=$(find_version "$NEW_RT_VERSION") if [ "$NEW_RT_VERSION" != "$RELEASE_TRAIN_VERSION" ]; then echo "Expected $proj version to be $RELEASE_TRAIN_VERSION not $NEW_RT_VERSION"