Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into obr-script-changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom-Slattery authored Sep 16, 2024
2 parents 4d6d7e7 + 8d6ddab commit bdaa58b
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 23 deletions.
73 changes: 54 additions & 19 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ jobs:
with:
java-version: '17'
distribution: 'semeru'
cache: maven

- name: Print githash
working-directory: obr
Expand Down Expand Up @@ -164,20 +163,20 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

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

- name: Build and push OBR image
id: build
id: build-obr
uses: docker/build-push-action@v5
with:
context: obr
file: obr/dockerfiles/dockerfile.obr
push: true
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
tags: ${{ steps.metadata-obr.outputs.tags }}
labels: ${{ steps.metadata-obr.outputs.labels }}
build-args: |
dockerRepository=${{ env.REGISTRY }}
tag=${{ env.BRANCH }}
Expand All @@ -190,6 +189,45 @@ jobs:
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:obr-${{ env.BRANCH }} --health --server argocd.galasa.dev
# To build an image with the Uber OBR and galasabld executable inside.
# This is needed during releases.
- name: Checkout buildutils
uses: actions/checkout@v4
with:
repository: ${{ env.NAMESPACE }}/buildutils
path: buildutils
ref: ${{ env.BRANCH }}

- name: Setup up Go
uses: actions/setup-go@v5
with:
go-version: 1.22

- name: Build galasabld using the Makefile
working-directory: buildutils
run: |
make all
- name: Extract metadata for OBR and galasabld image
id: metadata-obr-galasabld
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/obr-and-galasabld-executable

- name: Build and push OBR and galasabld image
id: build-obr-galasabld
uses: docker/build-push-action@v5
with:
context: buildutils
file: obr/dockerfiles/dockerfile.obrgalasabld
push: true
tags: ${{ steps.metadata-obr-galasabld.outputs.tags }}
labels: ${{ steps.metadata-obr-galasabld.outputs.labels }}
build-args: |
dockerRepository=${{ env.REGISTRY }}
tag=${{ env.BRANCH }}
platform=linux-amd64
build-obr-javadocs:
name: Build OBR javadocs using galasabld image and maven
runs-on: ubuntu-latest
Expand Down Expand Up @@ -227,7 +265,6 @@ jobs:
with:
java-version: '17'
distribution: 'semeru'
cache: maven

- name: Make secrets directory
run : |
Expand Down Expand Up @@ -299,20 +336,20 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata for Javadoc site image
id: metadata-javadocsite
id: metadata-javadoc-site
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/javadocsite
images: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/javadoc-site

- name: Build and push Javadoc site image
id: build-javadocsite
id: build-javadoc-site
uses: docker/build-push-action@v5
with:
context: obr
file: obr/dockerfiles/dockerfile.javadocsite
push: true
tags: ${{ steps.metadata-javadocsite.outputs.tags }}
labels: ${{ steps.metadata-javadocsite.outputs.labels }}
tags: ${{ steps.metadata-javadoc-site.outputs.tags }}
labels: ${{ steps.metadata-javado-csite.outputs.labels }}

- name: Recycle javadocsite application in ArgoCD
run: |
Expand Down Expand Up @@ -387,7 +424,6 @@ jobs:
with:
java-version: '17'
distribution: 'semeru'
cache: maven

- name: Make secrets directory
run : |
Expand Down Expand Up @@ -527,13 +563,12 @@ jobs:
runs-on: ubuntu-latest

steps:
# Todo: Uncomment to finish issue 1963.
# - name: Triggering helm build (github.ref is main)
# if: ${{ env.BRANCH == 'main' }}
# env:
# GH_TOKEN: ${{ secrets.GALASA_TEAM_GITHUB_TOKEN }}
# run: |
# gh workflow run build-helm.yaml --repo https://github.com/galasa-dev/automation --ref ${{ env.BRANCH }}
- name: Triggering helm build (github.ref is main)
if: ${{ env.BRANCH == 'main' }}
env:
GH_TOKEN: ${{ secrets.GALASA_TEAM_GITHUB_TOKEN }}
run: |
gh workflow run build-helm.yaml --repo https://github.com/galasa-dev/automation --ref ${{ env.BRANCH }}
- name: Triggering cli build (github.ref is not main)
if: ${{ env.BRANCH != 'main' }}
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/pr-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ jobs:
with:
java-version: '17'
distribution: 'semeru'
cache: maven

- name: Print githash
working-directory: obr
Expand Down Expand Up @@ -188,7 +187,6 @@ jobs:
with:
java-version: '17'
distribution: 'semeru'
cache: maven

- name: Make secrets directory
run : |
Expand Down Expand Up @@ -259,7 +257,7 @@ jobs:
context: obr
file: obr/dockerfiles/dockerfile.javadocsite
load: true
tags: javadocsite:test
tags: javadoc-site:test

- name: Build Javadoc Maven repo image for testing
uses: docker/build-push-action@v5
Expand Down Expand Up @@ -314,7 +312,6 @@ jobs:
with:
java-version: '17'
distribution: 'semeru'
cache: maven

- name: Build Galasa OBR generic pom.xml with maven
working-directory: ${{ github.workspace }}/obr/obr-generic
Expand Down
10 changes: 10 additions & 0 deletions dockerfiles/dockerfile.obrgalasabld
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
ARG dockerRepository
ARG tag

# During a release, we need to be able to execute galasabld commands from inside the OBR image
FROM ${dockerRepository}/galasa-dev/obr-maven-artefacts:${tag}

ARG platform
COPY bin/galasabld-${platform} /bin/galasabld

ENTRYPOINT ["/bin/galasabld"]

0 comments on commit bdaa58b

Please sign in to comment.