Skip to content

Commit

Permalink
[CI] Create workflow for uaa-test container. (#5861)
Browse files Browse the repository at this point in the history
Update build for uaa-test container.
  • Loading branch information
corneil committed Jul 5, 2024
1 parent fc84ab0 commit 261e47b
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 9 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/build-uaa-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: build-uaa-test

on:
workflow_dispatch:

jobs:
# test templating before publishing a package
prepare:
name: Prepare Job
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: cloudfoundry/uaa
ref: '4.32.0'
path: src/docker/uaa/uaa
- uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'liberica'
- name: Login dockerhub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build UAA Test Image
shell: bash
run: ./src/docker/uaa/build-all
- name: Publish Test Image
shell: bash
run: docker push spring-cloud/scdf-uaa-test:4.32
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ protected static class EmptyConfig {
);

public final static List<ClusterContainer> OAUTH_CONTAINERS = Collections.singletonList(
ClusterContainer.from(TagNames.UAA_4_32, "projects.registry.vmware.com/scdf/uaa-test:4.32", TagNames.UAA)
ClusterContainer.from(TagNames.UAA_4_32, "spring-cloud/scdf-uaa-test:4.32", TagNames.UAA)
);

@Autowired
Expand Down
2 changes: 1 addition & 1 deletion src/docker/uaa/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM tomcat:8-jre8-alpine

ENV UAA_CONFIG_PATH $CATALINA_HOME
ENV UAA_CONFIG_PATH=$CATALINA_HOME
ENV CATALINA_OPTS="-Xmx800m"

RUN rm -fr $CATALINA_HOME/webapps/ROOT
Expand Down
7 changes: 6 additions & 1 deletion src/docker/uaa/build-all
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
#!/bin/bash
./build-uaa && ./build-docker
set -euo pipefail
SRCDIR=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")
pushd $SRCDIR
./build-uaa
./build-docker
popd
2 changes: 1 addition & 1 deletion src/docker/uaa/build-docker
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash
docker build -t projects.registry.vmware.com/scdf/uaa-test:4.32 .
docker build -t spring-cloud/scdf-uaa-test:4.32 .
16 changes: 16 additions & 0 deletions src/docker/uaa/build-script.gradle.fragment
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
buildscript {
repositories {
mavenCentral()
jcenter()
maven {
url 'https://repo.spring.io/plugins-release'
credentials {
username = System.getenv('ARTIFACTORY_USERNAME')
password = System.getenv('ARTIFACTORY_PASSWORD')
}
}
}
dependencies {
classpath 'org.springframework.build.gradle:propdeps-plugin:0.0.7'
}
}
15 changes: 10 additions & 5 deletions src/docker/uaa/build-uaa
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#!/bin/bash
rm -fr uaa &&
git clone --branch 4.32.0 https://github.com/cloudfoundry/uaa.git &&
cd uaa &&
./gradlew clean build -x test &&
cd .. &&
if [ ! -d uaa ]; then
git clone --branch 4.32.0 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 build -x test
popd
cp uaa/uaa/build/libs/cloudfoundry-identity-uaa-*.war ./cloudfoundry-identity-uaa.war

0 comments on commit 261e47b

Please sign in to comment.