Skip to content

Commit

Permalink
Build fleet-gitjob image from AKS and GKE workflows
Browse files Browse the repository at this point in the history
This commit ensures that the new `fleet-gitjob` Docker image is built
and pushed from GKE and AKS workflows, which need it to deploy Fleet.
  • Loading branch information
weyfonk committed Feb 5, 2024
1 parent 9b185c1 commit 3827137
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 4 deletions.
10 changes: 8 additions & 2 deletions .github/scripts/deploy-fleet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,20 @@ function eventually {
}

# usage: ./deploy-fleet.sh ghcr.io/rancher/fleet:sha-49f6f81 ghcr.io/rancher/fleet-agent:1h
if [ $# -ge 2 ] && [ -n "$1" ] && [ -n "$2" ]; then
if [ $# -ge 3 ] && [ -n "$1" ] && [ -n "$2" ] && [ -n "$3" ]; then
fleetRepo="${1%:*}"
fleetTag="${1#*:}"
agentRepo="${2%:*}"
agentTag="${2#*:}"
gitjobRepo="${3%:*}"
gitjobTag="${3#*:}"
else
fleetRepo="rancher/fleet"
fleetTag="dev"
agentRepo="rancher/fleet-agent"
agentTag="dev"
gitjobRepo="rancher/fleet-gitjob"
gitjobTag="dev"
fi

eventually helm upgrade --install fleet-crd charts/fleet-crd \
Expand All @@ -34,7 +38,9 @@ eventually helm upgrade --install fleet charts/fleet \
--set image.tag="$fleetTag" \
--set agentImage.repository="$agentRepo" \
--set agentImage.tag="$agentTag" \
--set agentImage.imagePullPolicy=IfNotPresent
--set agentImage.imagePullPolicy=IfNotPresent \
--set gitjob.repository="$gitjobRepo" \
--set gitjob.tag="$gitjobTag"

# wait for controller and agent rollout
kubectl -n cattle-fleet-system rollout status deploy/fleet-controller
Expand Down
19 changes: 18 additions & 1 deletion .github/workflows/aks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,29 @@ jobs:
push: true
tags: ${{ steps.meta-fleet-agent.outputs.tags }}
labels: ${{ steps.meta-fleet-agent.outputs.labels }}
-
id: meta-fleet-gitjob
uses: docker/metadata-action@v5
with:
images: |
ttl.sh/rancher/fleet-gitjob-${{ steps.uuid.outputs.uuid }}
tags: type=raw,value=1h
-
uses: docker/build-push-action@v5
with:
context: .
file: package/Dockerfile.gitjob
build-args: |
ARCH=${{ env.GOARCH }}
push: true
tags: ${{ steps.meta-fleet-gitjob.outputs.tags }}
labels: ${{ steps.meta-fleet-gitjob.outputs.labels }}
-
name: Deploy Fleet
run: |
export KUBECONFIG="$GITHUB_WORKSPACE/kubeconfig-fleet-ci"
echo "${{ steps.meta-fleet.outputs.tags }} ${{ steps.meta-fleet-agent.outputs.tags }}"
./.github/scripts/deploy-fleet.sh ${{ steps.meta-fleet.outputs.tags }} ${{ steps.meta-fleet-agent.outputs.tags }}
./.github/scripts/deploy-fleet.sh ${{ steps.meta-fleet.outputs.tags }} ${{ steps.meta-fleet-agent.outputs.tags }} ${{ steps.meta-fleet-gitjob.outputs.tags }}
-
name: Fleet E2E Tests
env:
Expand Down
19 changes: 18 additions & 1 deletion .github/workflows/gke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,28 @@ jobs:
push: true
tags: ${{ steps.meta-fleet-agent.outputs.tags }}
labels: ${{ steps.meta-fleet-agent.outputs.labels }}
-
id: meta-fleet-gitjob
uses: docker/metadata-action@v5
with:
images: |
ttl.sh/rancher/fleet-gitjob-${{ steps.uuid.outputs.uuid }}
tags: type=raw,value=1h
-
uses: docker/build-push-action@v5
with:
context: .
file: package/Dockerfile.gitjob
build-args: |
ARCH=${{ env.GOARCH }}
push: true
tags: ${{ steps.meta-fleet-gitjob.outputs.tags }}
labels: ${{ steps.meta-fleet-gitjob.outputs.labels }}
-
name: Deploy Fleet
run: |
echo "${{ steps.meta-fleet.outputs.tags }} ${{ steps.meta-fleet-agent.outputs.tags }}"
./.github/scripts/deploy-fleet.sh ${{ steps.meta-fleet.outputs.tags }} ${{ steps.meta-fleet-agent.outputs.tags }}
./.github/scripts/deploy-fleet.sh ${{ steps.meta-fleet.outputs.tags }} ${{ steps.meta-fleet-agent.outputs.tags }} ${{ steps.meta-fleet-gitjob.outputs.tags }}
-
name: Fleet E2E Tests
env:
Expand Down

0 comments on commit 3827137

Please sign in to comment.