From aa6d3709775c3f1070d0a603ddc7a30205fde3b4 Mon Sep 17 00:00:00 2001 From: Corneil du Plessis Date: Tue, 18 Oct 2022 12:58:39 +0200 Subject: [PATCH] Require .settings.xml for deploy credentials. --- .github/workflows/common.yml | 11 ++++++----- .settings.xml | 10 ++++++++++ build-app.sh | 8 ++++---- 3 files changed, 20 insertions(+), 9 deletions(-) create mode 100644 .settings.xml diff --git a/.github/workflows/common.yml b/.github/workflows/common.yml index ef470384..ff12afdf 100644 --- a/.github/workflows/common.yml +++ b/.github/workflows/common.yml @@ -40,7 +40,7 @@ jobs: - name: 'Configure: create streams applications matrix' shell: bash run: | - ROOT_DIR=$PWD + ROOT_DIR=$(realpath $PWD) pushd stream-applications > /dev/null $ROOT_DIR/create-matrixes.sh COUNT=$(jq '.count' matrix.json) @@ -178,14 +178,15 @@ jobs: CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }} CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }} run: | + ROOT_DIR=$(realpath $PWD) echo "::notice ::building - stream-applications-build" - ./mvnw deploy -f stream-applications-build -U + $ROOT_DIR/mvnw -s $ROOT_DIR/.settings.xml deploy -f stream-applications-build -U echo "::notice ::building - functions" - ./mvnw deploy -f functions -N -U + $ROOT_DIR/mvnw -s $ROOT_DIR/.settings.xml deploy -f functions -N -U echo "::notice ::building - function-dependencies" - ./mvnw deploy -f functions/function-dependencies -N -U + $ROOT_DIR/mvnw -s $ROOT_DIR/.settings.xml deploy -f functions/function-dependencies -N -U echo "::notice ::building - stream-applications-core" - ./mvnw deploy -f applications/stream-applications-core -N -U + $ROOT_DIR/mvnw -s $ROOT_DIR/.settings.xml deploy -f applications/stream-applications-core -N -U echo "::notice ::core build completed" processors: needs: diff --git a/.settings.xml b/.settings.xml new file mode 100644 index 00000000..863c7fc0 --- /dev/null +++ b/.settings.xml @@ -0,0 +1,10 @@ + + + + + repo.spring.io + ${env.CI_DEPLOY_USERNAME} + ${env.CI_DEPLOY_PASSWORD} + + + \ No newline at end of file diff --git a/build-app.sh b/build-app.sh index 2d3f941a..f9c75a55 100644 --- a/build-app.sh +++ b/build-app.sh @@ -28,15 +28,15 @@ check_env VERSION ROOT_DIR=$PWD pushd $APP_FOLDER > /dev/null - $ROOT_DIR/mvnw clean install + $ROOT_DIR/mvnw -s $ROOT_DIR/.settings.xml clean install rm -rf apps if [ -d "src/main/java" ]; then - $ROOT_DIR/mvnw deploy -U -Pintegration + $ROOT_DIR/mvnw -s $ROOT_DIR/.settings.xml deploy -U -Pintegration else - $ROOT_DIR/mvnw package -U -Pintegration + $ROOT_DIR/mvnw -s $ROOT_DIR/.settings.xml package -U -Pintegration fi pushd apps - $ROOT_DIR/mvnw package jib:build -DskipTests \ + $ROOT_DIR/mvnw -s $ROOT_DIR/.settings.xml package jib:build -DskipTests \ -Djib.to.tags="$VERSION" \ -Djib.httpTimeout=1800000 \ -Djib.to.auth.username="$DOCKER_HUB_USERNAME" \