docker on detached mode #804
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
name: Java CI | |
on: | |
push: | |
jobs: | |
doa: | |
name: DOA test with ${{ matrix.storagetype }} and outbox | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
storagetype: [s3, posix] | |
java-version: [21] | |
env: | |
SSL_ENABLED: false | |
BROKER_HOST: localhost | |
BROKER_VALIDATE: false | |
DB_INSTANCE: localhost | |
ROOT_CERT_PATH: ./test/client_certs/ca.crt | |
CERT_PATH: ./test/client_certs/client.crt | |
CERT_KEY: ./test/client_certs/client.der | |
POSTGRES_PASSWORD: rootpasswd | |
OPENID_CONFIGURATION_URL: http://localhost:8000/openid-configuration | |
USERINFO_ENDPOINT_URL: http://localhost:8000/userinfo | |
CRYPT4GH_PRIVATE_KEY_PATH: test/crypt4gh/crypt4gh.sec.pem | |
CRYPT4GH_PRIVATE_KEY_PASSWORD_PATH: test/crypt4gh/crypt4gh.pass | |
BROKER_USERNAME: admin | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set S3 env variables | |
if: matrix.storagetype == 's3' | |
run: | | |
echo "OUTBOX_TYPE=S3" >> $GITHUB_ENV | |
echo "S3_OUT_ENDPOINT=localhost" >> $GITHUB_ENV | |
echo "S3_OUT_PORT=9000" >> $GITHUB_ENV | |
echo "S3_OUT_SECURE=false" >> $GITHUB_ENV | |
- name: Set posix env variables | |
if: matrix.storagetype == 'posix' | |
run: | | |
echo "OUTBOX_TYPE=POSIX" >> $GITHUB_ENV | |
echo "OUTBOX_LOCATION=$PWD/%s/files/" >> $GITHUB_ENV | |
- name: Docker Stack Deploy for ${{ matrix.storagetype }} storage | |
run: | | |
docker compose -f docker-compose-${{ matrix.storagetype }}-outbox.yml up -d | |
- name: Sleep and Status check | |
run: | | |
sleep 30 | |
docker ps | |
- name: Make encryption files | |
run: | | |
/bin/sh ./test/make_crypt4gh_files.sh | |
- name: Docker logs | |
run: | | |
docker ps | |
docker ps -a | |
docker logs certfixer | |
- name: List files in the directory | |
run: ls -R ./test/ | |
- name: Transform Client Private Key to DER | |
run: | | |
openssl pkcs8 -topk8 -inform PEM -outform DER -in ./test/client_certs/client.key -out ./test/client_certs/client.der -nocrypt | |
- name: Set up JDK | |
uses: actions/[email protected] | |
with: | |
distribution: zulu | |
java-version: ${{ matrix.java-version }} | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: create maven settings.xml | |
uses: s4u/[email protected] | |
with: | |
servers: | | |
[{ | |
"id":"github-fega-norway", | |
"username": "${{github.actor}}", | |
"password": "${{ secrets.GITHUB_TOKEN }}" | |
}] | |
- name: Spring Boot Run | |
run: nohup mvn -gs ~/.m2/settings.xml spring-boot:run --no-transfer-progress > nohup.out & | |
- name: Wait for app to start | |
run: | | |
RETRY_TIMES=0 | |
until lsof -i -P -n | grep ":8080"; | |
do | |
RETRY_TIMES=$((RETRY_TIMES+1)); | |
if [ $RETRY_TIMES -eq 30 ]; then exit 1; fi | |
sleep 10; | |
done | |
- name: Test | |
run: mvn -gs ~/.m2/settings.xml test --no-transfer-progress | |
- name: Spring Boot Run Logs | |
if: failure() | |
run: cat nohup.out | |
- name: Docker Service Logs | |
if: failure() | |
run: | | |
docker ps |