Skip to content

Instantly share code, notes, and snippets.

@vfarcic
Created March 28, 2025 17:41
Show Gist options
  • Save vfarcic/88ba4800e64b587a5ee4af8594197f97 to your computer and use it in GitHub Desktop.
Save vfarcic/88ba4800e64b587a5ee4af8594197f97 to your computer and use it in GitHub Desktop.

Manual (Without GitOps)

go test --tag unit

docker image build --tag ghcr.io/vfarcic/silly-demo:v1.2.3 --push

yq --inplace ".spec.template.spec.containers[0].image = \"ghcr.io/vfarcic/silly-demo:v1.2.3\"" staging/deployment.yaml

kubectl --namespace staging apply --filename dev/deployment.yaml

go test --tag integration

yq --inplace ".spec.template.spec.containers[0].image = \"ghcr.io/vfarcic/silly-demo:v1.2.3\"" prod/deployment.yaml

kubectl --namespace prod apply --filename prod/deployment.yaml

# Do something else

Manual (With GitOps)

go test --tag unit

docker image build --tag ghcr.io/vfarcic/silly-demo:v1.2.3 --push

yq --inplace ".spec.template.spec.containers[0].image = \"ghcr.io/vfarcic/silly-demo:v1.2.3\"" staging/deployment.yaml

# Changed!
git add . && git commit -m "Release 1.2.3" && git push

# Challenge!
# Wait until the changes are synced into the cluster without write (or even read) permissions

go test --tag integration

yq --inplace ".spec.template.spec.containers[0].image = \"ghcr.io/vfarcic/silly-demo:v1.2.3\"" prod/deployment.yaml

# Changed!
git add . && git commit -m "Release 1.2.3" && git push

# Challenge!
# Wait until the changes are synced into the cluster without write (or even read) permissions

# Do something else

With Workflows

Pipeline 1: Triggered by Git events

go test --tag unit

docker image build --tag ghcr.io/vfarcic/silly-demo:v1.2.3 --push

yq --inplace ".spec.template.spec.containers[0].image = \"ghcr.io/vfarcic/silly-demo:v1.2.3\"" staging/deployment.yaml

git add . && git commit -m "Release 1.2.3" && git push

# Do NOT waste resources on waiting. Pipeline run is finished!

Pipeline 2: Triggered when promotion is finished and is successful (how?)

go test --tag integration

yq --inplace ".spec.template.spec.containers[0].image = \"ghcr.io/vfarcic/silly-demo:v1.2.3\"" prod/deployment.yaml

git add . && git commit -m "Release 1.2.3" && git push

# Do NOT waste resources on waiting. Pipeline run is finished!

Pipeline 3: Triggered when promotion is finished and is successful (how?)

# Do something else

With Workflows and ???

Pipeline 1: Triggered by Git events

go test --tag unit

docker image build --tag ghcr.io/vfarcic/silly-demo:v1.2.3 --push

# Changed!
# Execute or trigger promotion

# Do NOT waste resources on waiting. Pipeline run is finished!

Pipeline 2: Triggered when promotion is finished and is successful (how?)

go test --tag integration

# Changed!
# Execute or trigger promotion

# Do NOT waste resources on waiting. Pipeline run is finished!

Pipeline 3: Triggered when promotion is finished and is successful (how?)

# Do something else
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment