feat(url-shortener): deploy staging and prod branches automatically
This commit is contained in:
1 parent
3ec9732190
commit
a02e372e85
5 files changed
+110
-110
No files matched your search
@@ -3,7 +3,7 @@ kind: Pipeline
|
||||
metadata:
|
||||
name: url-shortener-staging
|
||||
spec:
|
||||
description: Validate an exact main revision, publish a multiarch Rust API image, deploy the staging Redirect Worker and static admin Pages, then update staging GitOps with matching D1 identifiers.
|
||||
description: Validate an exact staging branch revision, publish a multiarch Rust API image, deploy staging Cloudflare resources, then update staging GitOps.
|
||||
params:
|
||||
- name: git-revision
|
||||
type: string
|
||||
@@ -23,6 +23,8 @@ spec:
|
||||
params:
|
||||
- name: revision
|
||||
value: $(params.git-revision)
|
||||
- name: environment
|
||||
value: staging
|
||||
workspaces:
|
||||
- name: source
|
||||
workspace: source
|
||||
@@ -98,6 +100,8 @@ spec:
|
||||
params:
|
||||
- name: revision
|
||||
value: $(params.git-revision)
|
||||
- name: environment
|
||||
value: staging
|
||||
workspaces:
|
||||
- name: source
|
||||
workspace: source
|
||||
@@ -111,6 +115,8 @@ spec:
|
||||
params:
|
||||
- name: revision
|
||||
value: $(params.git-revision)
|
||||
- name: environment
|
||||
value: staging
|
||||
- name: image-digest
|
||||
value: $(tasks.create-image-index.results.image-digest)
|
||||
workspaces:
|
||||
@@ -124,20 +130,19 @@ kind: Pipeline
|
||||
metadata:
|
||||
name: url-shortener-prod
|
||||
spec:
|
||||
description: Manually promote a matching source revision and immutable image digest from a successful staging run, deploying production Cloudflare resources and updating production GitOps.
|
||||
description: Validate an exact prod branch revision, publish a multiarch Rust API image, deploy production Cloudflare resources, then update production GitOps.
|
||||
params:
|
||||
- name: git-revision
|
||||
type: string
|
||||
description: Full source commit SHA from the successful staging run.
|
||||
- name: image-digest
|
||||
type: string
|
||||
description: Matching image-digest result from the same successful staging run.
|
||||
results:
|
||||
- name: image-digest
|
||||
value: $(tasks.create-image-index.results.image-digest)
|
||||
- name: gitops-commit
|
||||
value: $(tasks.update-gitops.results.gitops-commit)
|
||||
workspaces:
|
||||
- name: source
|
||||
- name: gitea-credentials
|
||||
- name: harbor-dockerconfig
|
||||
tasks:
|
||||
- name: clone
|
||||
taskRef:
|
||||
@@ -145,14 +150,78 @@ spec:
|
||||
params:
|
||||
- name: revision
|
||||
value: $(params.git-revision)
|
||||
- name: environment
|
||||
value: prod
|
||||
workspaces:
|
||||
- name: source
|
||||
workspace: source
|
||||
- name: credentials
|
||||
workspace: gitea-credentials
|
||||
- name: deploy-cloudflare
|
||||
- name: quality
|
||||
runAfter:
|
||||
- clone
|
||||
taskRef:
|
||||
name: url-shortener-quality
|
||||
workspaces:
|
||||
- name: source
|
||||
workspace: source
|
||||
- name: build-amd64
|
||||
runAfter:
|
||||
- quality
|
||||
taskRef:
|
||||
name: url-shortener-build-platform
|
||||
params:
|
||||
- name: revision
|
||||
value: $(params.git-revision)
|
||||
- name: platform
|
||||
value: linux/amd64
|
||||
- name: image
|
||||
value: registry.dahyeon.us/dahyeon/url-shortener:sha-$(params.git-revision)-$(context.pipelineRun.uid)-amd64
|
||||
workspaces:
|
||||
- name: credentials
|
||||
workspace: gitea-credentials
|
||||
- name: dockerconfig
|
||||
workspace: harbor-dockerconfig
|
||||
- name: build-arm64
|
||||
runAfter:
|
||||
- quality
|
||||
taskRef:
|
||||
name: url-shortener-build-platform
|
||||
params:
|
||||
- name: revision
|
||||
value: $(params.git-revision)
|
||||
- name: platform
|
||||
value: linux/arm64
|
||||
- name: image
|
||||
value: registry.dahyeon.us/dahyeon/url-shortener:sha-$(params.git-revision)-$(context.pipelineRun.uid)-arm64
|
||||
workspaces:
|
||||
- name: credentials
|
||||
workspace: gitea-credentials
|
||||
- name: dockerconfig
|
||||
workspace: harbor-dockerconfig
|
||||
- name: create-image-index
|
||||
runAfter:
|
||||
- build-amd64
|
||||
- build-arm64
|
||||
taskRef:
|
||||
name: url-shortener-create-image-index
|
||||
params:
|
||||
- name: image
|
||||
value: registry.dahyeon.us/dahyeon/url-shortener:sha-$(params.git-revision)-$(context.pipelineRun.uid)
|
||||
- name: amd64-image
|
||||
value: $(tasks.build-amd64.results.image-url)
|
||||
- name: amd64-digest
|
||||
value: $(tasks.build-amd64.results.image-digest)
|
||||
- name: arm64-image
|
||||
value: $(tasks.build-arm64.results.image-url)
|
||||
- name: arm64-digest
|
||||
value: $(tasks.build-arm64.results.image-digest)
|
||||
workspaces:
|
||||
- name: dockerconfig
|
||||
workspace: harbor-dockerconfig
|
||||
- name: deploy-cloudflare
|
||||
runAfter:
|
||||
- create-image-index
|
||||
taskRef:
|
||||
name: url-shortener-deploy-cloudflare
|
||||
params:
|
||||
@@ -176,7 +245,7 @@ spec:
|
||||
- name: environment
|
||||
value: prod
|
||||
- name: image-digest
|
||||
value: $(params.image-digest)
|
||||
value: $(tasks.create-image-index.results.image-digest)
|
||||
workspaces:
|
||||
- name: source
|
||||
workspace: source
|
||||
|
||||
Reference in new issue
Block a user