From 070a91419daf7e41a05c0ea950536ee4de86e9c8 Mon Sep 17 00:00:00 2001 From: marcel-gepardec Date: Thu, 8 Aug 2024 18:31:01 +0200 Subject: [PATCH] updated Dockerfile and cd.yml --- .github/workflows/cd.yml | 24 +++++++++++++++--------- Dockerfile | 10 ++++++++-- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 02b2430..85ebc7d 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -42,15 +42,21 @@ jobs: - name: Build & push docker image uses: docker/build-push-action@v4 with: - context: . - push: true - platforms: linux/amd64,linux/arm64 # Specify the platforms you need - tags: ghcr.io/${{ steps.lower-repo.outputs.repository }}:latest - file: Dockerfile # Adjust if your Dockerfile is not in the root directory - build-args: | - DB_USER_NAME=${{ env.DB_USER_NAME }} - DB_USER_PASSWORD=${{ env.DB_USER_PASSWORD }} - #Add here your environment Variables which you implemented above + context: . + push: true + platforms: linux/amd64,linux/arm64 # Specify the platforms you need + tags: ghcr.io/${{ steps.lower-repo.outputs.repository }}:latest + build-args: | + DB_USER_NAME=${{ env.DB_USER_NAME }} + DB_USER_PASSWORD=${{ env.DB_USER_PASSWORD }} + #Add here your environment Variables which you implemented above + file: Dockerfile # Adjust if your Dockerfile is not in the root directory + outputs: digest + + - name: Capture WildFly Logs + run: | + docker logs | tee wildfly.log + cat wildfly.log - name: Image digest run: echo ${{ steps.build-and-push.outputs.digest }} diff --git a/Dockerfile b/Dockerfile index 4bf7f2e..eda11d5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -38,7 +38,10 @@ RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ fi; \ done && \ if ! curl http://localhost:9990; then \ - echo "WildFly did not start in time!" && exit 1; \ + echo "WildFly did not start in time!" && \ + echo "WildFly logs:" && \ + cat $JBOSS_HOME/standalone/log/server.log && \ + exit 1; \ fi && \ cd /tmp && \ $JBOSS_HOME/bin/jboss-cli.sh --connect --command="/subsystem=datasources/jdbc-driver=oracle:add(driver-name=oracle,driver-module-name=com.oracle,driver-xa-datasource-class-name=oracle.jdbc.xa.client.OracleXADataSource)" && \ @@ -60,7 +63,10 @@ RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ fi; \ done && \ if ! curl http://localhost:9990; then \ - echo "WildFly did not start in time!" && exit 1; \ + echo "WildFly did not start in time!" && \ + echo "WildFly logs:" && \ + cat $JBOSS_HOME/standalone/log/server.log && \ + exit 1; \ fi && \ cd /tmp && \ $JBOSS_HOME/bin/jboss-cli.sh --connect --command="/subsystem=datasources/jdbc-driver=oracle:add(driver-name=oracle,driver-module-name=com.oracle,driver-xa-datasource-class-name=oracle.jdbc.xa.client.OracleXADataSource)" && \