Skip to content

Commit 29e57b9

Browse files
authored
Merge pull request #1102 from OpenLiberty/staging
Merge staging to prod - Enable spring boot guide to run java21 daily builds (#1101)
2 parents e6d7e36 + 0af69cc commit 29e57b9

9 files changed

+270
-6
lines changed

.github/workflows/daily-build-java21.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ jobs:
3737
- name: Get default repos
3838
if: ${{ github.event_name == 'repository_dispatch' || github.event_name == 'workflow_dispatch' && github.event.inputs.guide == 'all' }}
3939
id: create-list
40-
run: echo "repos=[ 'guide-jpa-intro' ]" >> $GITHUB_OUTPUT
40+
run: echo "::set-output name=repos::$(python3 .github/workflows/get-guides-java21.py)"
4141
- name: Set input repo
4242
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.guide != 'all' }}
4343
id: input-guide
44-
run: echo "repo=[ '${{ github.event.inputs.guide }}' ]" >> $GITHUB_OUTPUT
44+
run: echo "::set-output name=repo::[ '${{ github.event.inputs.guide }}' ]"
4545
build-level:
4646
runs-on: ubuntu-latest
4747
steps:

.github/workflows/docker-daily-test-java17.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- name: Get repos
3838
if: ${{ github.event_name == 'repository_dispatch' || github.event_name == 'workflow_dispatch' && github.event.inputs.guide == 'all' }}
3939
id: create-list
40-
run: echo "repos=[ 'guide-spring-boot', 'guide-liberty-deep-dive' ]" >> $GITHUB_OUTPUT
40+
run: echo "repos=[ 'guide-liberty-deep-dive' ]" >> $GITHUB_OUTPUT
4141
- name: Set repo
4242
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.guide != 'all' }}
4343
id: input-guide
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
name: Test Docker Daily Build - Java 21
2+
3+
on:
4+
repository_dispatch:
5+
types: [ docker-image-test-java21 ]
6+
workflow_dispatch:
7+
inputs:
8+
build:
9+
description: Build level as cl231220231122-1901
10+
required: true
11+
date:
12+
description: Dev date as 2023-11-22_1901
13+
required: true
14+
driver:
15+
description: Driver location as openliberty-all-23.0.0.12-cl231220231122-1901.zip
16+
required: true
17+
guide:
18+
description: Guide to build
19+
default: "all"
20+
required: true
21+
branch:
22+
description: Branch to test
23+
required: false
24+
25+
env:
26+
DOCKER_USERNAME: ${{ secrets.CP_STG_USERNAME }}
27+
DOCKER_PASSWORD: ${{ secrets.CP_STG_PASSWORD }}
28+
CHANGE_MINIKUBE_NONE_USER: true
29+
30+
jobs:
31+
get-repos:
32+
runs-on: ubuntu-latest
33+
outputs:
34+
repos: ${{ steps.create-list.outputs.repos }}${{ steps.input-guide.outputs.repo }}
35+
steps:
36+
- uses: actions/checkout@v2
37+
- name: Get repos
38+
if: ${{ github.event_name == 'repository_dispatch' || github.event_name == 'workflow_dispatch' && github.event.inputs.guide == 'all' }}
39+
id: create-list
40+
run: echo "repos=[ 'guide-spring-boot' ]" >> $GITHUB_OUTPUT
41+
- name: Set repo
42+
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.guide != 'all' }}
43+
id: input-guide
44+
run: echo "::set-output name=repo::[ '${{ github.event.inputs.guide }}' ]"
45+
build-level:
46+
runs-on: ubuntu-latest
47+
steps:
48+
- name: Starting daily build tests for ${{ github.event.client_payload.build-level }}${{ github.event.inputs.build }}
49+
run: |
50+
echo "Inputs: "
51+
echo build: ${{ github.event.inputs.build }}
52+
echo date: ${{ github.event.inputs.date }}
53+
echo driver: ${{ github.event.inputs.driver }}
54+
echo guide: ${{ github.event.inputs.guide }}
55+
echo branch: ${{ github.event.inputs.branch }}
56+
echo "Build level: ${{ github.event.client_payload.build-level }}${{ github.event.inputs.build }}"
57+
test-guide:
58+
needs: [ get-repos ]
59+
runs-on: ubuntu-latest
60+
strategy:
61+
fail-fast: false
62+
max-parallel: 5
63+
matrix:
64+
repos: ${{ fromJson(needs.get-repos.outputs.repos) }}
65+
jdk: [ "21" ]
66+
steps:
67+
- name: Setup JDK ${{ matrix.jdk }}
68+
uses: actions/setup-java@v1
69+
with:
70+
java-version: ${{ matrix.jdk }}
71+
- name: Clone ${{ matrix.repos }}
72+
uses: actions/checkout@v2
73+
with:
74+
repository: OpenLiberty/${{ matrix.repos }}
75+
ref: ${{ github.event.inputs.branch }}
76+
path: ${{ matrix.repos }}
77+
- name: Set permissions
78+
run: chmod +x ${{ matrix.repos }}/scripts/*.sh
79+
- name: Docker login
80+
run: echo $DOCKER_PASSWORD | sudo docker login -u $DOCKER_USERNAME --password-stdin cp.stg.icr.io
81+
- name: Run tests for ${{ matrix.repos }}
82+
working-directory: ${{ matrix.repos }}/finish
83+
env:
84+
DEVDATE: ${{ github.event.client_payload.dev-date }}${{ github.event.inputs.date }}
85+
DRIVER: ${{ github.event.client_payload.driver-location }}${{ github.event.inputs.driver }}
86+
run: sudo -E ../scripts/dockerImageTest.sh -t $DEVDATE -d $DRIVER
87+
- name: Post tests
88+
working-directory: ${{ matrix.repos }}
89+
if: always()
90+
run: |
91+
logsPath=$(sudo find . -name "console.log");
92+
if [ -z "$logsPath" ]
93+
then
94+
logsPath=$(sudo find . -name "messages.log");
95+
if [ ! -z "$logsPath" ]
96+
then
97+
sudo cat $logsPath | grep product
98+
sudo cat $logsPath | grep java.runtime
99+
fi
100+
else sudo cat $logsPath | grep Launching
101+
fi;
102+
sudo docker images
103+
- name: Archive server logs if failed
104+
if: failure()
105+
uses: actions/upload-artifact@v4
106+
with:
107+
name: server-logs
108+
path: ${{ matrix.repos }}/finish/target/liberty/wlp/usr/servers/defaultServer/logs/
109+
slack-alert:
110+
needs: [ test-guide ]
111+
if: failure()
112+
runs-on: ubuntu-latest
113+
env:
114+
BUILDLEVEL: ${{ github.event.client_payload.build-level }}${{ github.event.inputs.build }}
115+
DEVDATE: ${{ github.event.client_payload.dev-date }}${{ github.event.inputs.date }}
116+
DRIVER: ${{ github.event.client_payload.driver-location }}${{ github.event.inputs.driver }}
117+
steps:
118+
- uses: actions/checkout@v2
119+
- name: send-status
120+
run: |
121+
python3 .github/workflows/slack-alert.py ${{ env.BUILDLEVEL }} ${{ env.DRIVER }} ${{ env.DEVDATE }} ${{ needs.test-guide.result }} \
122+
${{ github.repository }} ${{ github.run_id }} ${{ secrets.SLACK_HOOK }}
123+
echo ${{ needs.test-guide.result }}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import json
2+
3+
JSON_PATH = ".github/workflows/guides-java21.json"
4+
5+
if __name__ == "__main__":
6+
print(json.load(open(JSON_PATH)))

.github/workflows/guides-java17.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"guide-jakarta-websocket",
44
"guide-jms-intro",
55
"guide-liberty-deep-dive",
6-
"guide-liberty-deep-dive-gradle",
7-
"guide-spring-boot"
6+
"guide-liberty-deep-dive-gradle"
87
]
98

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[
2+
"guide-jpa-intro",
3+
"guide-spring-boot"
4+
]

.github/workflows/manual-gm-candidate-container-test-java17.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- name: Get repos
3636
if: ${{ github.event_name == 'repository_dispatch' || github.event_name == 'workflow_dispatch' && github.event.inputs.guide == 'all' }}
3737
id: create-list
38-
run: echo "repos=[ 'guide-spring-boot', 'guide-liberty-deep-dive' ]" >> $GITHUB_OUTPUT
38+
run: echo "repos=[ 'guide-liberty-deep-dive' ]" >> $GITHUB_OUTPUT
3939
- name: Set repo
4040
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.guide != 'all' }}
4141
id: input-guide
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
name: Manual GM candidate container test - Java 21
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
build:
7+
description: Build level as cl241020240923-1638
8+
required: true
9+
date:
10+
description: Dev date as 2024-09-23_1638
11+
required: true
12+
ol_version:
13+
description: OL version as 24.0.0.10
14+
required: true
15+
guide:
16+
description: Guide to build
17+
default: "all"
18+
required: true
19+
branch:
20+
description: Branch to test
21+
required: false
22+
23+
env:
24+
DOCKER_USERNAME: ${{ secrets.CP_STG_USERNAME }}
25+
DOCKER_PASSWORD: ${{ secrets.CP_STG_PASSWORD }}
26+
CHANGE_MINIKUBE_NONE_USER: true
27+
28+
jobs:
29+
get-guide-repos:
30+
runs-on: ubuntu-latest
31+
outputs:
32+
repos: ${{ steps.create-list.outputs.repos }}${{ steps.input-guide.outputs.repo }}
33+
steps:
34+
- uses: actions/checkout@v2
35+
- name: Get repos
36+
if: ${{ github.event_name == 'repository_dispatch' || github.event_name == 'workflow_dispatch' && github.event.inputs.guide == 'all' }}
37+
id: create-list
38+
run: echo "repos=[ 'guide-spring-boot' ]" >> $GITHUB_OUTPUT
39+
- name: Set repo
40+
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.guide != 'all' }}
41+
id: input-guide
42+
run: echo "::set-output name=repo::[ '${{ github.event.inputs.guide }}' ]"
43+
build-level:
44+
runs-on: ubuntu-latest
45+
steps:
46+
- name: Starting GM candidate container tests for ${{ github.event.inputs.build }}
47+
run: |
48+
echo "Inputs: "
49+
echo build: ${{ github.event.inputs.build }}
50+
echo date: ${{ github.event.inputs.date }}
51+
echo ol_version: ${{ github.event.inputs.ol_version }}
52+
echo driver: openliberty-all-${{ github.event.inputs.ol_version }}-${{ github.event.inputs.build }}.zip
53+
echo guide: ${{ github.event.inputs.guide }}
54+
echo branch: ${{ github.event.inputs.branch }}
55+
test-guide:
56+
needs: [ get-guide-repos ]
57+
runs-on: ubuntu-latest
58+
strategy:
59+
fail-fast: false
60+
max-parallel: 5
61+
matrix:
62+
repos: ${{ fromJson(needs.get-guide-repos.outputs.repos) }}
63+
jdk: [ "21" ]
64+
steps:
65+
- name: Setup JDK ${{ matrix.jdk }}
66+
uses: actions/setup-java@v1
67+
with:
68+
java-version: ${{ matrix.jdk }}
69+
- name: Clone ${{ matrix.repos }}
70+
uses: actions/checkout@v2
71+
with:
72+
repository: OpenLiberty/${{ matrix.repos }}
73+
ref: ${{ github.event.inputs.branch }}
74+
path: ${{ matrix.repos }}
75+
- name: Set permissions
76+
run: chmod +x ${{ matrix.repos }}/scripts/*.sh
77+
- name: Docker login
78+
run: echo $DOCKER_PASSWORD | sudo docker login -u $DOCKER_USERNAME --password-stdin cp.stg.icr.io
79+
- name: Run tests for ${{ matrix.repos }}
80+
working-directory: ${{ matrix.repos }}/finish
81+
env:
82+
DEVDATE: ${{ github.event.inputs.date }}
83+
DRIVER: openliberty-all-${{ github.event.inputs.ol_version }}-${{ github.event.inputs.build }}.zip
84+
OL_VERSION: ${{ github.event.inputs.ol_version }}
85+
run: sudo -E ../scripts/dockerImageTest.sh -t $DEVDATE -d $DRIVER -v $OL_VERSION
86+
- name: Post tests
87+
working-directory: ${{ matrix.repos }}
88+
if: always()
89+
run: |
90+
mvn -version
91+
sudo chmod -R 777 .
92+
logsPath=$(sudo find . -name "console.log");
93+
if [ -z "$logsPath" ]
94+
then
95+
logsPath=$(sudo find . -name "messages.log");
96+
if [ -z "$logsPath" ]
97+
then sudo docker images
98+
else
99+
sudo cat $logsPath | grep product
100+
sudo cat $logsPath | grep java.runtime
101+
fi
102+
else sudo cat $logsPath | grep Launching
103+
fi
104+
- name: Archive server logs if failed
105+
if: failure()
106+
uses: actions/upload-artifact@v4
107+
with:
108+
name: ${{ matrix.repos }}-logs
109+
path: |
110+
${{ matrix.repos }}/finish/target/liberty/wlp/usr/servers/defaultServer/logs/
111+
${{ matrix.repos }}/finish/**/target/liberty/wlp/usr/servers/defaultServer/logs/
112+
if-no-files-found: ignore
113+
slack-alert:
114+
needs: [test-guide]
115+
if: failure()
116+
runs-on: ubuntu-latest
117+
env:
118+
BUILDLEVEL: ${{ github.event.inputs.build }}
119+
DEVDATE: ${{ github.event.inputs.date }}
120+
DRIVER: openliberty-all-${{ github.event.inputs.ol_version }}-${{ github.event.inputs.build }}.zip
121+
steps:
122+
- uses: actions/checkout@v2
123+
- name: send-status
124+
run: |
125+
python3 .github/workflows/slack-alert.py ${{ env.BUILDLEVEL }} ${{ env.DRIVER }} ${{ env.DEVDATE }} ${{ needs.test-guide.result }} \
126+
${{ github.repository }} ${{ github.run_id }} ${{ secrets.SLACK_HOOK }}
127+
echo ${{ needs.test-guide.result }}

.github/workflows/trigger-docker-daily-test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050
ACCEPT_HEADER: "application/vnd.github.v3+json"
5151
PAYLOAD: '{ "dev-date": "${{ matrix.builds.date }}", "driver-location": "${{ matrix.builds.driver_location }}", "build-level": "${{ matrix.builds.build_level }}", "jdk": "11" }'
5252
PAYLOAD_JAVA17: '{ "dev-date": "${{ matrix.builds.date }}", "driver-location": "${{ matrix.builds.driver_location }}", "build-level": "${{ matrix.builds.build_level }}", "jdk": "17" }'
53+
PAYLOAD_JAVA21: '{ "dev-date": "${{ matrix.builds.date }}", "driver-location": "${{ matrix.builds.driver_location }}", "build-level": "${{ matrix.builds.build_level }}", "jdk": "21" }'
5354
steps:
5455
- name: Trigger Docker image tests
5556
run: |
@@ -67,6 +68,10 @@ jobs:
6768
-H "Authorization: token $GH_TOKEN" \
6869
-d "{ \"event_type\": \"docker-image-test-java17\", \"client_payload\": $PAYLOAD_JAVA17 }" \
6970
-X POST $URI
71+
curl -H "Accept: $ACCEPT_HEADER" \
72+
-H "Authorization: token $GH_TOKEN" \
73+
-d "{ \"event_type\": \"docker-image-test-java21\", \"client_payload\": $PAYLOAD_JAVA21 }" \
74+
-X POST $URI
7075
else
7176
echo Skip test because "$IMAGEBUILDLEVEL" and "${{ matrix.builds.build_level }}" do not match!
7277
fi

0 commit comments

Comments
 (0)