From 688bc9bb9dfee85e50798fe49920b1b48bbe8b03 Mon Sep 17 00:00:00 2001 From: Chris Bono Date: Wed, 12 Apr 2023 00:02:04 -0500 Subject: [PATCH] [CI] Release workflow (WIP) --- .github/workflows/common.yml | 10 +++++----- check-versions-for-release.sh | 15 ++++++--------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/.github/workflows/common.yml b/.github/workflows/common.yml index 6663ce8d..214f4f78 100644 --- a/.github/workflows/common.yml +++ b/.github/workflows/common.yml @@ -181,7 +181,7 @@ jobs: -Dartifactory.publish.artifacts=false \ -B $VERBOSE echo "::notice ::checking updated versions" - $ROOT_DIR/check-versions-for-release.sh ${{ needs.parameters.outputs.build_version_type }} ${{ (github.debug || inputs.verbose) }} + $ROOT_DIR/check-versions-for-release.sh ${{ needs.parameters.outputs.build_version_type }} popd >/dev/null - name: 'Action: build initial dependencies' shell: bash @@ -303,7 +303,7 @@ jobs: -Dartifactory.publish.artifacts=false \ -B $VERBOSE echo "::notice ::checking updated versions" - $ROOT_DIR/check-versions-for-release.sh ${{ needs.parameters.outputs.build_version_type }} ${{ (github.debug || inputs.verbose) }} + $ROOT_DIR/check-versions-for-release.sh ${{ needs.parameters.outputs.build_version_type }} popd >/dev/null - name: 'Configure: Docker login' uses: docker/login-action@v2 @@ -401,7 +401,7 @@ jobs: -Dartifactory.publish.artifacts=false \ -B $VERBOSE echo "::notice ::checking updated versions" - $ROOT_DIR/check-versions-for-release.sh ${{ needs.parameters.outputs.build_version_type }} ${{ (github.debug || inputs.verbose) }} + $ROOT_DIR/check-versions-for-release.sh ${{ needs.parameters.outputs.build_version_type }} popd >/dev/null - name: 'Configure: Docker login' uses: docker/login-action@v2 @@ -501,7 +501,7 @@ jobs: -Dartifactory.publish.artifacts=false \ -B $VERBOSE echo "::notice ::checking updated versions" - $ROOT_DIR/check-versions-for-release.sh ${{ needs.parameters.outputs.build_version_type }} ${{ (github.debug || inputs.verbose) }} + $ROOT_DIR/check-versions-for-release.sh ${{ needs.parameters.outputs.build_version_type }} popd >/dev/null - name: 'Configure: Docker login' uses: docker/login-action@v2 @@ -595,7 +595,7 @@ jobs: -Dartifactory.publish.artifacts=false \ -B $VERBOSE echo "::notice ::checking updated versions" - $ROOT_DIR/check-versions-for-release.sh ${{ needs.parameters.outputs.build_version_type }} ${{ (github.debug || inputs.verbose) }} + $ROOT_DIR/check-versions-for-release.sh ${{ needs.parameters.outputs.build_version_type }} popd >/dev/null - name: 'Build: stream-applications-release-train' shell: bash diff --git a/check-versions-for-release.sh b/check-versions-for-release.sh index 54e5648a..aabf95c2 100755 --- a/check-versions-for-release.sh +++ b/check-versions-for-release.sh @@ -5,7 +5,6 @@ if [ "$1" == "" ]; then exit 1 fi RELEASE_TYPE="$1" -VERBOSE="$2" set +e @@ -13,20 +12,18 @@ if [ "$RELEASE_TYPE" = "milestone" ]; then echo "Checking versions for $RELEASE_TYPE release" lines=$(find . -type f -name pom.xml | xargs grep SNAPSHOT | grep -v ".contains(" | grep -v regex | wc -l) if [ $lines -ne 0 ]; then - echo "Snapshots version found ($lines). Exiting build" - if [ "$VERBOSE" = "true" ]; then - echo $(find . -type f -name pom.xml | xargs grep SNAPSHOT | grep -v ".contains(" | grep -v regex) - fi + echo "Snapshots version found ($lines):" + echo $(find . -type f -name pom.xml | xargs grep SNAPSHOT | grep -v ".contains(" | grep -v regex) + echo "Exiting release build" exit 1 fi elif [ "$RELEASE_TYPE" = "ga" ]; then echo "Checking versions for $RELEASE_TYPE release" lines=$(find . -type f -name pom.xml | xargs egrep "SNAPSHOT|M[0-9]|RC[0-9]" | grep -v ".contains(" | grep -v regex | wc -l) if [ $lines -ne 0 ]; then - echo "Non release versions found ($lines). Exiting build" - if [ "$VERBOSE" = "true" ]; then - echo $(find . -type f -name pom.xml | xargs egrep "SNAPSHOT|M[0-9]|RC[0-9]" | grep -v ".contains(" | grep -v regex) - fi + echo "Non release versions found ($lines):" + echo $(find . -type f -name pom.xml | xargs egrep "SNAPSHOT|M[0-9]|RC[0-9]" | grep -v ".contains(" | grep -v regex) + echo "Exiting release build" exit 1 fi else