Skip to content

Commit

Permalink
[CI] Update build-uaa to handle exit codes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Corneil du Plessis committed Jul 5, 2024
1 parent 3cb392c commit f7013ce
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/build-uaa-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
18 changes: 12 additions & 6 deletions src/docker/uaa/build-uaa
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit f7013ce

Please sign in to comment.