Skip to content

Main build

Main build #83

Workflow file for this run

#
# Copyright contributors to the Galasa project
#
# SPDX-License-Identifier: EPL-2.0
#
name: Main build
on:
workflow_dispatch:
push:
branches: [main]
env:
REGISTRY: ghcr.io
NAMESPACE: galasa-dev
BRANCH: ${{ github.ref_name }}
jobs:
log-github-ref:
name: Log the GitHub ref this workflow is running on (Branch or tag that received dispatch)
runs-on: ubuntu-latest
steps:
- name: Log GitHub ref of workflow
run: |
echo "This workflow is running on GitHub ref ${{ env.BRANCH }}"
build-isolated:
name: Build Isolated
runs-on: ubuntu-latest
steps:
- name: Checkout Galasa
uses: actions/checkout@v4
with:
repository: ${{ env.NAMESPACE }}/galasa
path: galasa
- name: Checkout Isolated
uses: actions/checkout@v4
with:
path: isolated
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'semeru'
- name: Generate Isolated pom.xml
run: |
docker run --rm -v ${{ github.workspace }}:/var/root/ ghcr.io/galasa-dev/galasabld-amd64:main template --releaseMetadata var/root/galasa/modules/framework/release.yaml --releaseMetadata /var/root/galasa/modules/extensions/release.yaml --releaseMetadata /var/root/galasa/modules/managers/release.yaml --releaseMetadata /var/root/galasa/modules/obr/release.yaml --template /var/root/isolated/full/pom.template --output /var/root/isolated/full/pom.xml --isolated
- name: Make directory to place build logs in
working-directory: ./isolated/full
run: |
mkdir isolated-build-logs
- name: Build Isolated pom.xml with maven
working-directory: ./isolated/full
env:
GITHUB_TOKEN_READ_PACKAGES_USERNAME: ${{ secrets.READ_GITHUB_PACKAGES_USERNAME }}
GITHUB_TOKEN_READ_PACKAGES_PASSWORD: ${{ secrets.READ_GITHUB_PACKAGES_TOKEN }}
run: |
set -o pipefail
mvn -f pom.xml process-sources -X \
-Dgalasa.target.repo=file:target/isolated/maven \
-Dgalasa.runtime.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/obr \
-Dgalasa.simplatform.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/simplatform \
-Dgalasa.javadoc.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/javadoc \
-Dgalasa.docs.repo=https://maven.pkg.github.com/galasa-dev/galasa.dev \
-Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \
-Dgithub.token.read.packages.username=${{ env.GITHUB_TOKEN_READ_PACKAGES_USERNAME }} \
-Dgithub.token.read.packages.password=${{ env.GITHUB_TOKEN_READ_PACKAGES_PASSWORD }} \
--batch-mode --errors --fail-at-end \
--settings ${{ github.workspace }}/isolated/settings.xml 2>&1 | tee isolated-build-logs/build-isolated-pom.log
- name: Build Isolated pom2.xml with maven
working-directory: ./isolated/full
run: |
set -o pipefail
mvn -f pom2.xml process-sources -X \
-Dgalasa.target.repo=file:target/isolated/maven \
-Dgalasa.runtime.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/obr \
-Dgalasa.simplatform.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/simplatform \
-Dgalasa.javadoc.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/javadoc \
-Dgalasa.docs.repo=https://maven.pkg.github.com/galasa-dev/galasa.dev \
-Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \
--batch-mode --errors --fail-at-end \
--settings ${{ github.workspace }}/isolated/settings.xml 2>&1 | tee isolated-build-logs/build-isolated-pom2.log
- name: Build Isolated pom3.xml with maven
working-directory: ./isolated/full
run: |
set -o pipefail
mvn -f pom3.xml process-sources -X \
-Dgalasa.target.repo=file:target/isolated/maven \
-Dgalasa.runtime.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/obr \
-Dgalasa.simplatform.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/simplatform \
-Dgalasa.javadoc.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/javadoc \
-Dgalasa.docs.repo=https://maven.pkg.github.com/galasa-dev/galasa.dev \
-Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \
--batch-mode --errors --fail-at-end \
--settings ${{ github.workspace }}/isolated/settings.xml 2>&1 | tee isolated-build-logs/build-isolated-pom3.log
- name: Build Isolated pom4.xml with maven
working-directory: ./isolated/full
run: |
set -o pipefail
mvn -f pom4.xml process-sources -X \
-Dgalasa.target.repo=file:target/isolated/maven \
-Dgalasa.runtime.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/obr \
-Dgalasa.simplatform.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/simplatform \
-Dgalasa.javadoc.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/javadoc \
-Dgalasa.docs.repo=https://maven.pkg.github.com/galasa-dev/galasa.dev \
-Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \
--batch-mode --errors --fail-at-end \
--settings ${{ github.workspace }}/isolated/settings.xml 2>&1 | tee isolated-build-logs/build-isolated-pom4.log
- name: Build Isolated pom5.xml with maven
working-directory: ./isolated/full
run: |
set -o pipefail
mvn -f pom5.xml process-sources -X \
-Dgalasa.target.repo=file:target/isolated/maven \
-Dgalasa.runtime.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/obr \
-Dgalasa.simplatform.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/simplatform \
-Dgalasa.javadoc.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/javadoc \
-Dgalasa.docs.repo=https://maven.pkg.github.com/galasa-dev/galasa.dev \
-Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \
--batch-mode --errors --fail-at-end \
--settings ${{ github.workspace }}/isolated/settings.xml 2>&1 | tee isolated-build-logs/build-isolated-pom5.log
- name: Build Isolated pom6.xml with maven
working-directory: ./isolated/full
run: |
set -o pipefail
mvn -f pom6.xml process-sources -X \
-Dgalasa.target.repo=file:target/isolated/maven \
-Dgalasa.runtime.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/obr \
-Dgalasa.simplatform.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/simplatform \
-Dgalasa.javadoc.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/javadoc \
-Dgalasa.docs.repo=https://maven.pkg.github.com/galasa-dev/galasa.dev \
-Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \
--batch-mode --errors --fail-at-end \
--settings ${{ github.workspace }}/isolated/settings.xml 2>&1 | tee isolated-build-logs/build-isolated-pom6.log
- name: Build Isolated Javadoc with maven
working-directory: ./isolated/full
run: |
set -o pipefail
mvn -f pomJavaDoc.xml process-sources -X \
-Dgalasa.target.repo=file:target/isolated/maven \
-Dgalasa.runtime.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/obr \
-Dgalasa.simplatform.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/simplatform \
-Dgalasa.javadoc.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/javadoc \
-Dgalasa.docs.repo=https://maven.pkg.github.com/galasa-dev/galasa.dev \
-Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \
--batch-mode --errors --fail-at-end \
--settings ${{ github.workspace }}/isolated/settings.xml 2>&1 | tee isolated-build-logs/build-isolated-javadoc.log
- name: Build Isolated Docs with maven
working-directory: ./isolated/full
env:
GITHUB_TOKEN_READ_PACKAGES_USERNAME: ${{ secrets.READ_GITHUB_PACKAGES_USERNAME }}
GITHUB_TOKEN_READ_PACKAGES_PASSWORD: ${{ secrets.READ_GITHUB_PACKAGES_TOKEN }}
run: |
set -o pipefail
mvn -f pomDocs.xml process-sources -X \
-Dgalasa.target.repo=file:target/isolated/maven \
-Dgalasa.runtime.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/obr \
-Dgalasa.simplatform.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/simplatform \
-Dgalasa.javadoc.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/javadoc \
-Dgalasa.docs.repo=https://maven.pkg.github.com/galasa-dev/galasa.dev \
-Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \
-Dgithub.token.read.packages.username=${{ env.GITHUB_TOKEN_READ_PACKAGES_USERNAME }} \
-Dgithub.token.read.packages.password=${{ env.GITHUB_TOKEN_READ_PACKAGES_PASSWORD }} \
--batch-mode --errors --fail-at-end \
--settings ${{ github.workspace }}/isolated/settings.xml 2>&1 | tee isolated-build-logs/build-isolated-docs.log
- name: Download galasactl binaries
working-directory: ./isolated/full
run: |
mkdir bin &&
cd bin &&
wget https://development.galasa.dev/${{ env.BRANCH }}/binary/cli/galasactl-darwin-x86_64 &&
wget https://development.galasa.dev/${{ env.BRANCH }}/binary/cli/galasactl-darwin-arm64 &&
wget https://development.galasa.dev/${{ env.BRANCH }}/binary/cli/galasactl-linux-arm64 &&
wget https://development.galasa.dev/${{ env.BRANCH }}/binary/cli/galasactl-linux-x86_64 &&
wget https://development.galasa.dev/${{ env.BRANCH }}/binary/cli/galasactl-linux-s390x &&
wget https://development.galasa.dev/${{ env.BRANCH }}/binary/cli/galasactl-windows-x86_64.exe &&
cd ..
- name: Build galasactl directory with maven
working-directory: ./isolated/full
run: |
set -o pipefail
mvn -f pomGalasactl.xml validate -X \
-Dgalasa.target.repo=file:target/isolated/maven \
-Dgalasa.runtime.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/obr \
-Dgalasa.simplatform.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/simplatform \
-Dgalasa.javadoc.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/javadoc \
-Dgalasa.docs.repo=https://maven.pkg.github.com/galasa-dev/galasa.dev \
-Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \
--batch-mode --errors --fail-at-end \
--settings ${{ github.workspace }}/isolated/settings.xml 2>&1 | tee isolated-build-logs/build-isolated-galasactl.log
- name: Copy text files into Isolated
working-directory: ./isolated/full
run : |
cp -vr resources/* target/isolated/
- name: Login to Github Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: galasa-team
password: ${{ secrets.GALASA_TEAM_WRITE_PACKAGES_TOKEN }}
- name: Extract metadata for galasa-isolated image
id: metadata-galasa-isolated
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/galasa-isolated
- name: Build Docker image for Isolated development maven registry
id: build-galasa-isolated
uses: docker/build-push-action@v5
with:
context: .
file: ${{ github.workspace }}/isolated/dockerfiles/dockerfile.isolated
push: true
tags: ${{ steps.metadata-galasa-isolated.outputs.tags }}
labels: ${{ steps.metadata-galasa-isolated.outputs.labels }}
build-args: |
directory=isolated/full
- name: Extract metadata for galasa-isolated-tar image
id: metadata-galasa-isolated-tar
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/galasa-isolated-tar
- name: Build Docker image for Isolated tar file
id: build-galasa-isolated-tar
uses: docker/build-push-action@v5
with:
context: .
file: ${{ github.workspace }}/isolated/dockerfiles/dockerfile.isolated
push: true
tags: ${{ steps.metadata-galasa-isolated-tar.outputs.tags }}
labels: ${{ steps.metadata-galasa-isolated-tar.outputs.labels }}
build-args: |
directory=isolated/full
outputs: type=tar,dest=isolated/full/target/isolated/isolated.tar
- name: Build Isolated zip with maven
working-directory: ./isolated/full
run: |
set -o pipefail
mvn -f pomZip.xml deploy -X \
-Dgalasa.target.repo=file:target/isolated/maven \
-Dgalasa.release.repo=file:${{ github.workspace }}/isolated/full/repo \
-Dgalasa.runtime.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/obr \
-Dgalasa.simplatform.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/simplatform \
-Dgalasa.javadoc.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/javadoc \
-Dgalasa.docs.repo=https://maven.pkg.github.com/galasa-dev/galasa.dev \
-Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \
--batch-mode --errors --fail-at-end \
--settings ${{ github.workspace }}/isolated/settings.xml 2>&1 | tee isolated-build-logs/build-isolated-zip.log
- name: Upload Isolated Maven build logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: isolated-maven-build-logs
path: isolated-build-logs
retention-days: 7
- name: Extract metadata for galasa-isolated-zip image
id: metadata-galasa-isolated-zip
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/galasa-isolated-zip
- name: Build Docker image for Isolated zip
id: build-galasa-isolated-zip
uses: docker/build-push-action@v5
with:
context: ./isolated/full
file: ${{ github.workspace }}/isolated/dockerfiles/dockerfile.isolatedzip
push: true
tags: ${{ steps.metadata-galasa-isolated-zip.outputs.tags }}
labels: ${{ steps.metadata-galasa-isolated-zip.outputs.labels }}
build-args: |
baseVersion=latest
dockerRepository=ghcr.io
- 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 ${{ env.BRANCH }}-maven-repos restart --kind Deployment --resource-name isolated-${{ env.BRANCH }} --server argocd.galasa.dev
- name: Wait for application 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 ${{ env.BRANCH }}-maven-repos --resource apps:Deployment:isolated-${{ env.BRANCH }} --health --server argocd.galasa.dev
build-mvp:
name: Build MVP
runs-on: ubuntu-latest
steps:
- name: Checkout Galasa
uses: actions/checkout@v4
with:
repository: ${{ env.NAMESPACE }}/galasa
path: galasa
- name: Checkout Isolated
uses: actions/checkout@v4
with:
path: isolated
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'semeru'
- name: Generate MVP pom.xml
run: |
docker run --rm -v ${{ github.workspace }}:/var/root/ ghcr.io/galasa-dev/galasabld-amd64:main template --releaseMetadata var/root/galasa/modules/framework/release.yaml --releaseMetadata /var/root/galasa/modules/extensions/release.yaml --releaseMetadata /var/root/galasa/modules/managers/release.yaml --releaseMetadata /var/root/galasa/modules/obr/release.yaml --template /var/root/isolated/mvp/pom.template --output /var/root/isolated/mvp/pom.xml --mvp
- name: Make directory to place build logs in
working-directory: ./isolated/mvp
run: |
mkdir mvp-build-logs
- name: Build MVP pom.xml with maven
working-directory: ./isolated/mvp
env:
GITHUB_TOKEN_READ_PACKAGES_USERNAME: ${{ secrets.READ_GITHUB_PACKAGES_USERNAME }}
GITHUB_TOKEN_READ_PACKAGES_PASSWORD: ${{ secrets.READ_GITHUB_PACKAGES_TOKEN }}
run: |
set -o pipefail
mvn -f pom.xml process-sources -X \
-Dgalasa.target.repo=file:target/isolated/maven \
-Dgalasa.runtime.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/obr \
-Dgalasa.simplatform.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/simplatform \
-Dgalasa.javadoc.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/javadoc \
-Dgalasa.docs.repo=https://maven.pkg.github.com/galasa-dev/galasa.dev \
-Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \
-Dgithub.token.read.packages.username=${{ env.GITHUB_TOKEN_READ_PACKAGES_USERNAME }} \
-Dgithub.token.read.packages.password=${{ env.GITHUB_TOKEN_READ_PACKAGES_PASSWORD }} \
--batch-mode --errors --fail-at-end \
--settings ${{ github.workspace }}/isolated/settings.xml 2>&1 | tee mvp-build-logs/build-mvp-pom.log
- name: Build MVP pom2.xml with maven
working-directory: ./isolated/mvp
run: |
set -o pipefail
mvn -f pom2.xml process-sources -X \
-Dgalasa.target.repo=file:target/isolated/maven \
-Dgalasa.runtime.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/obr \
-Dgalasa.simplatform.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/simplatform \
-Dgalasa.javadoc.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/javadoc \
-Dgalasa.docs.repo=https://maven.pkg.github.com/galasa-dev/galasa.dev \
-Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \
--batch-mode --errors --fail-at-end \
--settings ${{ github.workspace }}/isolated/settings.xml 2>&1 | tee mvp-build-logs/build-mvp-pom2.log
- name: Build MVP pom3.xml with maven
working-directory: ./isolated/mvp
run: |
set -o pipefail
mvn -f pom3.xml process-sources -X \
-Dgalasa.target.repo=file:target/isolated/maven \
-Dgalasa.runtime.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/obr \
-Dgalasa.simplatform.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/simplatform \
-Dgalasa.javadoc.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/javadoc \
-Dgalasa.docs.repo=https://maven.pkg.github.com/galasa-dev/galasa.dev \
-Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \
--batch-mode --errors --fail-at-end \
--settings ${{ github.workspace }}/isolated/settings.xml 2>&1 | tee mvp-build-logs/build-mvp-pom3.log
- name: Build MVP pom4.xml with maven
working-directory: ./isolated/mvp
run: |
set -o pipefail
mvn -f pom4.xml process-sources -X \
-Dgalasa.target.repo=file:target/isolated/maven \
-Dgalasa.runtime.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/obr \
-Dgalasa.simplatform.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/simplatform \
-Dgalasa.javadoc.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/javadoc \
-Dgalasa.docs.repo=https://maven.pkg.github.com/galasa-dev/galasa.dev \
-Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \
--batch-mode --errors --fail-at-end \
--settings ${{ github.workspace }}/isolated/settings.xml 2>&1 | tee mvp-build-logs/build-mvp-pom4.log
- name: Build MVP pom5.xml with maven
working-directory: ./isolated/mvp
run: |
set -o pipefail
mvn -f pom5.xml process-sources -X \
-Dgalasa.target.repo=file:target/isolated/maven \
-Dgalasa.runtime.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/obr \
-Dgalasa.simplatform.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/simplatform \
-Dgalasa.javadoc.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/javadoc \
-Dgalasa.docs.repo=https://maven.pkg.github.com/galasa-dev/galasa.dev \
-Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \
--batch-mode --errors --fail-at-end \
--settings ${{ github.workspace }}/isolated/settings.xml 2>&1 | tee mvp-build-logs/build-mvp-pom5.log
- name: Build MVP pom6.xml with maven
working-directory: ./isolated/mvp
run: |
set -o pipefail
mvn -f pom6.xml process-sources -X \
-Dgalasa.target.repo=file:target/isolated/maven \
-Dgalasa.runtime.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/obr \
-Dgalasa.simplatform.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/simplatform \
-Dgalasa.javadoc.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/javadoc \
-Dgalasa.docs.repo=https://maven.pkg.github.com/galasa-dev/galasa.dev \
-Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \
--batch-mode --errors --fail-at-end \
--settings ${{ github.workspace }}/isolated/settings.xml 2>&1 | tee mvp-build-logs/build-mvp-pom6.log
- name: Build MVP Javadoc with maven
working-directory: ./isolated/mvp
run: |
set -o pipefail
mvn -f pomJavaDoc.xml process-sources -X \
-Dgalasa.target.repo=file:target/isolated/maven \
-Dgalasa.runtime.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/obr \
-Dgalasa.simplatform.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/simplatform \
-Dgalasa.javadoc.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/javadoc \
-Dgalasa.docs.repo=https://maven.pkg.github.com/galasa-dev/galasa.dev \
-Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \
--batch-mode --errors --fail-at-end \
--settings ${{ github.workspace }}/isolated/settings.xml 2>&1 | tee mvp-build-logs/build-mvp-javadoc.log
- name: Build MVP Docs with maven
working-directory: ./isolated/mvp
env:
GITHUB_TOKEN_READ_PACKAGES_USERNAME: ${{ secrets.READ_GITHUB_PACKAGES_USERNAME }}
GITHUB_TOKEN_READ_PACKAGES_PASSWORD: ${{ secrets.READ_GITHUB_PACKAGES_TOKEN }}
run: |
set -o pipefail
mvn -f pomDocs.xml process-sources -X \
-Dgalasa.target.repo=file:target/isolated/maven \
-Dgalasa.runtime.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/obr \
-Dgalasa.simplatform.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/simplatform \
-Dgalasa.javadoc.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/javadoc \
-Dgalasa.docs.repo=https://maven.pkg.github.com/galasa-dev/galasa.dev \
-Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \
-Dgithub.token.read.packages.username=${{ env.GITHUB_TOKEN_READ_PACKAGES_USERNAME }} \
-Dgithub.token.read.packages.password=${{ env.GITHUB_TOKEN_READ_PACKAGES_PASSWORD }} \
--batch-mode --errors --fail-at-end \
--settings ${{ github.workspace }}/isolated/settings.xml 2>&1 | tee mvp-build-logs/build-mvp-docs.log
- name: Download galasactl binaries
working-directory: ./isolated/mvp
run: |
mkdir bin &&
cd bin &&
wget https://development.galasa.dev/${{ env.BRANCH }}/binary/cli/galasactl-darwin-x86_64 &&
wget https://development.galasa.dev/${{ env.BRANCH }}/binary/cli/galasactl-darwin-arm64 &&
wget https://development.galasa.dev/${{ env.BRANCH }}/binary/cli/galasactl-linux-arm64 &&
wget https://development.galasa.dev/${{ env.BRANCH }}/binary/cli/galasactl-linux-x86_64 &&
wget https://development.galasa.dev/${{ env.BRANCH }}/binary/cli/galasactl-linux-s390x &&
wget https://development.galasa.dev/${{ env.BRANCH }}/binary/cli/galasactl-windows-x86_64.exe &&
cd ..
- name: Build galasactl directory with maven
working-directory: ./isolated/mvp
run: |
set -o pipefail
mvn -f pomGalasactl.xml validate -X \
-Dgalasa.target.repo=file:target/isolated/maven \
-Dgalasa.runtime.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/obr \
-Dgalasa.simplatform.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/simplatform \
-Dgalasa.javadoc.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/javadoc \
-Dgalasa.docs.repo=https://maven.pkg.github.com/galasa-dev/galasa.dev \
-Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \
--batch-mode --errors --fail-at-end \
--settings ${{ github.workspace }}/isolated/settings.xml 2>&1 | tee mvp-build-logs/build-mvp-galasactl.log
- name: Copy text files into MVP
working-directory: ./isolated/mvp
run : |
cp -vr resources/* target/isolated/
- name: Login to Github Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: galasa-team
password: ${{ secrets.GALASA_TEAM_WRITE_PACKAGES_TOKEN }}
- name: Extract metadata for galasa-mvp image
id: metadata-galasa-mvp
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/galasa-mvp
- name: Build Docker image for MVP development maven registry
id: build-galasa-mvp
uses: docker/build-push-action@v5
with:
context: .
file: ${{ github.workspace }}/isolated/dockerfiles/dockerfile.isolated
push: true
tags: ${{ steps.metadata-galasa-mvp.outputs.tags }}
labels: ${{ steps.metadata-galasa-mvp.outputs.labels }}
build-args: |
directory=isolated/mvp
- name: Extract metadata for galasa-mvp-tar image
id: metadata-galasa-mvp-tar
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/galasa-mvp-tar
- name: Build Docker image for MVP tar file
id: build-galasa-mvp-tar
uses: docker/build-push-action@v5
with:
context: .
file: ${{ github.workspace }}/isolated/dockerfiles/dockerfile.isolated
push: true
tags: ${{ steps.metadata-galasa-mvp-tar.outputs.tags }}
labels: ${{ steps.metadata-galasa-mvp-tar.outputs.labels }}
build-args: |
directory=isolated/mvp
outputs: type=tar,dest=isolated/mvp/target/isolated/isolated.tar
- name: Build MVP zip with maven
working-directory: ./isolated/mvp
run: |
set -o pipefail
mvn -f pomZip.xml deploy -X \
-Dgalasa.target.repo=file:target/isolated/maven \
-Dgalasa.release.repo=file:${{ github.workspace }}/isolated/mvp/repo \
-Dgalasa.runtime.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/obr \
-Dgalasa.simplatform.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/simplatform \
-Dgalasa.javadoc.repo=https://development.galasa.dev/${{ env.BRANCH }}/maven-repo/javadoc \
-Dgalasa.docs.repo=https://maven.pkg.github.com/galasa-dev/galasa.dev \
-Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \
--batch-mode --errors --fail-at-end \
--settings ${{ github.workspace }}/isolated/settings.xml 2>&1 | tee mvp-build-logs/build-mvp-zip.log
- name: Upload MVP Maven build logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: mvp-maven-build-logs
path: mvp-build-logs
retention-days: 7
- name: Extract metadata for galasa-mvp-zip image
id: metadata-galasa-mvp-zip
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/galasa-mvp-zip
- name: Build Docker image for MVP zip
id: build-galasa-mvp-zip
uses: docker/build-push-action@v5
with:
context: ./isolated/mvp
file: ${{ github.workspace }}/isolated/dockerfiles/dockerfile.isolatedzip
push: true
tags: ${{ steps.metadata-galasa-mvp-zip.outputs.tags }}
labels: ${{ steps.metadata-galasa-mvp-zip.outputs.labels }}
build-args: |
baseVersion=latest
dockerRepository=ghcr.io
- 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 ${{ env.BRANCH }}-maven-repos restart --kind Deployment --resource-name mvp-${{ env.BRANCH }} --server argocd.galasa.dev
- name: Wait for application 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 ${{ env.BRANCH }}-maven-repos --resource apps:Deployment:mvp-${{ env.BRANCH }} --health --server argocd.galasa.dev
report-failure:
name: Report failure in workflow
runs-on: ubuntu-latest
needs: [log-github-ref, build-isolated, build-mvp]
if: failure()
steps:
- name: Report failure in workflow to Slack
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
run : |
docker run --rm -v ${{ github.workspace }}:/var/workspace ghcr.io/galasa-dev/galasabld-ibm:main slackpost workflows --repo "isolated" --workflowName "${{ github.workflow }}" --workflowRunNum "${{ github.run_id }}" --ref "${{ env.BRANCH }}" --hook "${{ env.SLACK_WEBHOOK }}"