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

Commit

Permalink
Tidy up now it works
Browse files Browse the repository at this point in the history
Signed-off-by: Jade Carino <[email protected]>
  • Loading branch information
jadecarino committed Jul 23, 2024
1 parent fde6cf7 commit 60fa8b1
Showing 1 changed file with 58 additions and 76 deletions.
134 changes: 58 additions & 76 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,86 +19,68 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v4

- 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 main-maven-repos restart --kind Deployment --resource-name gradle-main --server argocd.galasa.dev

# login argocd.galasa.dev --auth-token ${{ env.ARGOCD_TOKEN }} --grpc-web
# && app actions run main-maven-repos restart --kind Deployment --resource-name gradle-main --server argocd.galasa.dev"


# - name: Setup JDK
# uses: actions/setup-java@v4
# with:
# java-version: '11'
# distribution: 'semeru'
- name: Setup JDK
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'semeru'

# # The githash is added to the development Maven registry to show what commit level it contains
# - name: Print githash
# run: |
# echo $GITHUB_SHA > ./gradle.githash
# The githash is added to the development Maven registry to show what commit level it contains
- name: Print githash
run: |
echo $GITHUB_SHA > ./gradle.githash
# - name: Setup Gradle
# uses: gradle/actions/setup-gradle@v3
# with:
# gradle-version: 6.9.2
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: 6.9.2

# - name: Build Gradle source code
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.GPG_KEYID }}
# ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_KEY }}
# ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSPHRASE }}
# run: |
# gradle check publish \
# -PsourceMaven=https://repo.maven.apache.org/maven2/ \
# -PcentralMaven=https://repo.maven.apache.org/maven2/ \
# -PtargetMaven=${{ github.workspace }}/repo \
# -PjacocoEnabled=true \
# -PisMainOrRelease=true
- name: Build Gradle source code
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.GPG_KEYID }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSPHRASE }}
run: |
gradle check publish \
-PsourceMaven=https://repo.maven.apache.org/maven2/ \
-PcentralMaven=https://repo.maven.apache.org/maven2/ \
-PtargetMaven=${{ github.workspace }}/repo \
-PjacocoEnabled=true \
-PisMainOrRelease=true
# - name: Login to Github Container Registry
# uses: docker/login-action@v3
# with:
# registry: ${{ env.REGISTRY }}
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
- 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 Gradle image
# id: metadata
# uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
# with:
# images: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/gradle-maven-artefacts
- name: Extract metadata for Gradle image
id: metadata
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/gradle-maven-artefacts

# - name: Build Gradle image for development Maven registry
# id: build
# uses: docker/build-push-action@v5
# with:
# context: .
# file: dockerfiles/dockerfile.gradle
# push: true
# tags: ${{ steps.metadata.outputs.tags }}
# labels: ${{ steps.metadata.outputs.labels }}
# # dockerRepository will change to ghcr.io once the Wrapping image is available there
# build-args: |
# dockerRepository=harbor.galasa.dev
# tag=${{ env.BRANCH }}
- name: Build Gradle image for development Maven registry
id: build
uses: docker/build-push-action@v5
with:
context: .
file: dockerfiles/dockerfile.gradle
push: true
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
# dockerRepository will change to ghcr.io once the Wrapping image is available there
build-args: |
dockerRepository=harbor.galasa.dev
tag=${{ env.BRANCH }}
# Login to ArgoCD
# Recycle the application managed by ArgoCD which deploys the development Maven registry
# This will supply it with the latest artefacts
# - name: Login to ArgoCD and recycle application
# env:
# ARGOCD_TOKEN: ${{ secrets.ARGOCD_TOKEN }}
# run: |
# docker run --rm -v ${{ github.workspace }}:/var/workspace ghcr.io/galasa-dev/argocdcli:main -c "argocd login argocd.galasa.dev --auth-token ${{ env.ARGOCD_TOKEN }} --grpc-web && argocd app actions run main-maven-repos restart --kind Deployment --resource-name gradle-main --server argocd.galasa.dev"

# Recycle the application managed by ArgoCD which deploys the development Maven registry
# This will supply it with the latest artefacts
# - name: Recycle ArgoCD application
# run: |
# argocd app actions run main-maven-repos restart --kind Deployment --resource-name gradle-main --server argocd.galasa.dev
# Recycle the development Maven registry app in ArgoCD
# Authenticate using a token passed in as an environment variable
- 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 main-maven-repos restart --kind Deployment --resource-name gradle-main --server argocd.galasa.dev

0 comments on commit 60fa8b1

Please sign in to comment.