-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #79 from OpenLiberty/staging
Create staging to prod - enable daily build test (#78)
- Loading branch information
Showing
4 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Rebuild cloud-hosted guide | ||
|
||
# Controls when the action will run. Triggers the workflow on push | ||
# events but only for the master branch | ||
on: | ||
push: | ||
branches: | ||
- 'prod' | ||
- 'staging' | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
# This workflow contains a single job called "post" | ||
post: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
# Uses the secrets from the organisation for credentials | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Invoke workflow in another repo with inputs | ||
uses: benc-uk/workflow-dispatch@v1 | ||
with: | ||
workflow: GuideConverterV3 | ||
repo: OpenLiberty/cloud-hosted-guides | ||
token: ${{ secrets.GUIDECONVERSIONTOOL_PASSWORD }} | ||
inputs: '{ "branch": "${{ github.ref }}", "guide_name": "${{ github.event.repository.name }}" }' | ||
ref: "refs/heads/prod" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
while getopts t:d:b:u: flag; | ||
do | ||
case "${flag}" in | ||
t) DATE="${OPTARG}";; | ||
d) DRIVER="${OPTARG}";; | ||
b) BUILD="${OPTARG}";; | ||
u) DOCKER_USERNAME="${OPTARG}";; | ||
*) echo "Invalid option";; | ||
esac | ||
done | ||
|
||
echo "Testing daily build image" | ||
|
||
sed -i "\#<artifactId>liberty-maven-plugin</artifactId>#a<configuration><install><runtimeUrl>https://public.dhe.ibm.com/ibmdl/export/pub/software/openliberty/runtime/nightly/$DATE/$DRIVER</runtimeUrl></install></configuration>" system/pom.xml query/pom.xml | ||
cat system/pom.xml query/pom.xml | ||
|
||
if [[ "$DOCKER_USERNAME" != "" ]]; then | ||
sed -i "s;FROM icr.io/appcafe/open-liberty:kernel-slim-java11-openj9-ubi;FROM $DOCKER_USERNAME/olguides:$BUILD;g" system/Dockerfile query/Dockerfile | ||
sed -i "s;RUN features.sh;#RUN features.sh;g" system/Dockerfile query/Dockerfile | ||
cat system/Dockerfile query/Dockerfile | ||
fi | ||
|
||
../scripts/testApp.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
while getopts t:d:b:u: flag; | ||
do | ||
case "${flag}" in | ||
t) DATE="${OPTARG}";; | ||
d) DRIVER="${OPTARG}";; | ||
*) echo "Invalid option";; | ||
esac | ||
done | ||
|
||
echo "Testing daily Docker image" | ||
|
||
sed -i "\#<artifactId>liberty-maven-plugin</artifactId>#a<configuration><install><runtimeUrl>https://public.dhe.ibm.com/ibmdl/export/pub/software/openliberty/runtime/nightly/$DATE/$DRIVER</runtimeUrl></install></configuration>" system/pom.xml query/pom.xml | ||
cat system/pom.xml query/pom.xml | ||
|
||
sed -i "s;FROM icr.io/appcafe/open-liberty:kernel-slim-java11-openj9-ubi;FROM cp.stg.icr.io/cp/olc/open-liberty-daily:full-java11-openj9-ubi;g" system/Dockerfile query/Dockerfile | ||
sed -i "s;RUN features.sh;#RUN features.sh;g" system/Dockerfile query/Dockerfile | ||
cat system/Dockerfile query/Dockerfile | ||
|
||
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin cp.stg.icr.io | ||
docker pull "cp.stg.icr.io/cp/olc/open-liberty-daily:full-java11-openj9-ubi" | ||
echo "build level:" | ||
docker inspect --format "{{ index .Config.Labels \"org.opencontainers.image.revision\"}}" cp.stg.icr.io/cp/olc/open-liberty-daily:full-java11-openj9-ubi | ||
|
||
../scripts/testApp.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters