Skip to content

Commit

Permalink
Attempt build with Maven 3.8.8 and war-plugin 3.3.2
Browse files Browse the repository at this point in the history
Signed-off-by: Jade Carino <[email protected]>
  • Loading branch information
jadecarino committed Aug 23, 2024
1 parent fe9263c commit 3438d0f
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 10 deletions.
120 changes: 120 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: Main build

on:
push:
branches: [main]

env:
REGISTRY: ghcr.io
NAMESPACE: galasa-dev

jobs:
build-simplatform:
name: Building Simplatform web application and tests
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'semeru'
cache: maven

- name: Print Githash
run: |
echo $GITHUB_SHA > ./simplatform.githash
- name: Building galasa-simplatform-application using maven
run: |
set -o pipefail
mvn -f galasa-simplatform-application/pom.xml deploy -X \
-Dgalasa.source.repo=https://development.galasa.dev/gh/maven-repo/obr \
-Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \
-Dgalasa.release.repo=file:${{ github.workspace }}/repo \
--batch-mode --errors --fail-at-end \
--settings ${{ github.workspace }}/settings.xml 2>&1 | tee galasa-simplatform-application-build.log
- name: Upload galasa-simplatform-application Maven Build Log
if: failure()
uses: actions/upload-artifact@v4
with:
name: galasa-simplatform-application-build-log
path: galasa-simplatform-application-build.log
retention-days: 7

- name: Building galasa-simbank-tests using maven
run: |
set -o pipefail
mvn -f galasa-simbank-tests/pom.xml deploy -X \
-Dgalasa.source.repo=https://development.galasa.dev/gh/maven-repo/obr \
-Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \
-Dgalasa.release.repo=file:${{ github.workspace }}/repo \
--batch-mode --errors --fail-at-end \
--settings ${{ github.workspace }}/settings.xml 2>&1 | tee galasa-simbank-tests-build.log
- name: Upload galasa-simbank-tests Maven Build Log
if: failure()
uses: actions/upload-artifact@v4
with:
name: galasa-simbank-tests-build-log
path: galasa-simbank-tests-build.log
retention-days: 7

- name: Login to Github Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata for Simplatform maven artefacts image
id: metadata-simplatform
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/simplatform-maven-artefacts

- name: Build Simplatform image for development Maven registry
id: build-simplatform
uses: docker/build-push-action@v5
with:
context: .
file: dockerfiles/dockerfile.simplatform
push: true
tags: ${{ steps.metadata-simplatform.outputs.tags }}
labels: ${{ steps.metadata-simplatform.outputs.labels }}
build-args: |
baseVersion=latest
dockerRepository=ghcr.io
branch=main
- name: Extract metadata for Simplatform jar image
id: metadata-simplatform-jar
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/simplatform-jar

- name: Build simplatform jar image
id: build-simplatform-jar
uses: docker/build-push-action@v5
with:
context: .
file: dockerfiles/dockerfile.simplatform-amd64
push: true
tags: ${{ steps.metadata-simplatform-jar.outputs.tags }}
labels: ${{ steps.metadata-simplatform-jar.outputs.labels }}

- name: Recycle application in ArgoCD
env:
ARGOCD_AUTH_TOKEN: ${{ secrets.ARGOCD_TOKEN }}
run: |
docker run --env ARGOCD_AUTH_TOKEN=${{ env.ARGOCD_AUTH_TOKEN }} --rm -v ${{ github.workspace }}:/var/workspace ghcr.io/galasa-dev/argocdcli:main app actions run gh-simplatform restart --kind Deployment --resource-name simplatform-gh --server argocd.galasa.dev
- name: Wait for app health in ArgoCD
env:
ARGOCD_AUTH_TOKEN: ${{ secrets.ARGOCD_TOKEN }}
run: |
docker run --env ARGOCD_AUTH_TOKEN=${{ env.ARGOCD_AUTH_TOKEN }} --rm -v ${{ github.workspace }}:/var/workspace ghcr.io/galasa-dev/argocdcli:main app wait gh-simplatform --resource apps:Deployment:simplatform-gh --health --server argocd.galasa.dev
17 changes: 7 additions & 10 deletions .github/workflows/pr-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,12 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v4

- name: Set up JDK 17
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'semeru'

- name: Set up Maven 3.9.0
uses: actions/setup-java@v4
with:
distribution: 'maven'
maven-version: '3.9.0'
cache: maven

- name: Print Githash
run: |
Expand All @@ -32,7 +27,8 @@ jobs:
- name: Building galasa-simplatform-application using maven
run: |
set -o pipefail
mvn -f galasa-simplatform-application/pom.xml -X deploy -Dgpg.skip=true \
mvn -f galasa-simplatform-application/pom.xml deploy -X \
-Dgpg.skip=true \
-Dgalasa.source.repo=https://development.galasa.dev/gh/maven-repo/obr \
-Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \
-Dgalasa.release.repo=file:${{ github.workspace }}/repo \
Expand All @@ -50,13 +46,14 @@ jobs:
- name: Building galasa-simbank-tests using maven
run: |
set -o pipefail
mvn -f galasa-simbank-tests/pom.xml -X deploy -Dgpg.skip=true \
mvn -f galasa-simbank-tests/pom.xml deploy -X \
-Dgpg.skip=true \
-Dgalasa.source.repo=https://development.galasa.dev/gh/maven-repo/obr \
-Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \
-Dgalasa.release.repo=file:${{ github.workspace }}/repo \
--batch-mode --errors --fail-at-end \
--settings ${{ github.workspace }}/settings.xml 2>&1 | tee galasa-simbank-tests-build.log
- name: Upload galasa-simbank-tests Maven Build Log
if: failure()
uses: actions/upload-artifact@v4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,12 @@

<build>
<finalName>galasa-simplatform-webapp</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.2</version>
</plugin>
</plugins>
</build>
</project>

0 comments on commit 3438d0f

Please sign in to comment.