diff --git a/.github/workflows/build-uaa-test.yml b/.github/workflows/build-uaa-test.yml index c6da49fba8..f85742a6eb 100644 --- a/.github/workflows/build-uaa-test.yml +++ b/.github/workflows/build-uaa-test.yml @@ -24,10 +24,8 @@ jobs: env: ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} - run: | - pushd ./src/docker/uaa - ./build-uaa - popd + working-directory: ./src/docker/uaa + run: ./build-uaa - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Login dockerhub @@ -38,6 +36,6 @@ jobs: - name: Publish Test Image uses: docker/build-push-action@v6 with: - context: src/docker/uaa + context: ./src/docker/uaa push: true tags: spring-cloud/scdf-uaa-test:4.32 diff --git a/src/docker/uaa/build-uaa b/src/docker/uaa/build-uaa index e08eb87aae..2b14960ae7 100755 --- a/src/docker/uaa/build-uaa +++ b/src/docker/uaa/build-uaa @@ -1,13 +1,19 @@ #!/bin/bash -set -e -if [ ! -d uaa ]; then - git clone --branch 4.32.0 https://github.com/cloudfoundry/uaa.git +VERSION=4.32.0 +set +e +if [ ! -d ./uaa ]; then + git clone --branch $VERSION --depth 1 -q https://github.com/cloudfoundry/uaa.git fi HAS_CRED=$(grep -c -F "credentials" uaa/settings.gradle) if ((HAS_CRED == 0)); then cat ./build-script.gradle.fragment >> uaa/settings.gradle fi -pushd uaa - ./gradlew clean :cloudfoundry-identity-uaa:assemble +if [ ! -d ./uaa ]; then + echo "Expected folder ./uaa in $(pwd)" + exit 2 +fi +set -e +pushd ./uaa + ./gradlew --console plain clean :cloudfoundry-identity-uaa:assemble popd -cp uaa/uaa/build/libs/cloudfoundry-identity-uaa-*.war ./cloudfoundry-identity-uaa.war +cp ./uaa/uaa/build/libs/cloudfoundry-identity-uaa-${VERSION}.war ./cloudfoundry-identity-uaa.war