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
@@ -5,5 +5,5 @@
|
|||||||
- Harbor pull Secret: `harbor-registry`
|
- Harbor pull Secret: `harbor-registry`
|
||||||
- 앱 Secret: `url-shortener-secrets` (Infisical)
|
- 앱 Secret: `url-shortener-secrets` (Infisical)
|
||||||
|
|
||||||
운영 승격: `./ci/url-shortener/start-prod.ps1 -StagingRun <성공한 staging PipelineRun>` (저장소 루트에서 실행).
|
앱 저장소의 `staging`/`prod` 브랜치 push → 해당 Tekton Pipeline → 환경별 GitOps 갱신 → Argo CD 자동 Sync.
|
||||||
`url-shortener-prod` 완료 후 Argo CD의 `url-shortener-prod`를 수동 Sync합니다.
|
이 저장소는 `main`의 환경별 overlay를 유지하며, 앱의 `main` push는 배포하지 않습니다.
|
||||||
@@ -3,7 +3,7 @@ kind: Pipeline
|
|||||||
metadata:
|
metadata:
|
||||||
name: url-shortener-staging
|
name: url-shortener-staging
|
||||||
spec:
|
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:
|
params:
|
||||||
- name: git-revision
|
- name: git-revision
|
||||||
type: string
|
type: string
|
||||||
@@ -23,6 +23,8 @@ spec:
|
|||||||
params:
|
params:
|
||||||
- name: revision
|
- name: revision
|
||||||
value: $(params.git-revision)
|
value: $(params.git-revision)
|
||||||
|
- name: environment
|
||||||
|
value: staging
|
||||||
workspaces:
|
workspaces:
|
||||||
- name: source
|
- name: source
|
||||||
workspace: source
|
workspace: source
|
||||||
@@ -98,6 +100,8 @@ spec:
|
|||||||
params:
|
params:
|
||||||
- name: revision
|
- name: revision
|
||||||
value: $(params.git-revision)
|
value: $(params.git-revision)
|
||||||
|
- name: environment
|
||||||
|
value: staging
|
||||||
workspaces:
|
workspaces:
|
||||||
- name: source
|
- name: source
|
||||||
workspace: source
|
workspace: source
|
||||||
@@ -111,6 +115,8 @@ spec:
|
|||||||
params:
|
params:
|
||||||
- name: revision
|
- name: revision
|
||||||
value: $(params.git-revision)
|
value: $(params.git-revision)
|
||||||
|
- name: environment
|
||||||
|
value: staging
|
||||||
- name: image-digest
|
- name: image-digest
|
||||||
value: $(tasks.create-image-index.results.image-digest)
|
value: $(tasks.create-image-index.results.image-digest)
|
||||||
workspaces:
|
workspaces:
|
||||||
@@ -124,20 +130,19 @@ kind: Pipeline
|
|||||||
metadata:
|
metadata:
|
||||||
name: url-shortener-prod
|
name: url-shortener-prod
|
||||||
spec:
|
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:
|
params:
|
||||||
- name: git-revision
|
- name: git-revision
|
||||||
type: string
|
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:
|
results:
|
||||||
|
- name: image-digest
|
||||||
|
value: $(tasks.create-image-index.results.image-digest)
|
||||||
- name: gitops-commit
|
- name: gitops-commit
|
||||||
value: $(tasks.update-gitops.results.gitops-commit)
|
value: $(tasks.update-gitops.results.gitops-commit)
|
||||||
workspaces:
|
workspaces:
|
||||||
- name: source
|
- name: source
|
||||||
- name: gitea-credentials
|
- name: gitea-credentials
|
||||||
|
- name: harbor-dockerconfig
|
||||||
tasks:
|
tasks:
|
||||||
- name: clone
|
- name: clone
|
||||||
taskRef:
|
taskRef:
|
||||||
@@ -145,14 +150,78 @@ spec:
|
|||||||
params:
|
params:
|
||||||
- name: revision
|
- name: revision
|
||||||
value: $(params.git-revision)
|
value: $(params.git-revision)
|
||||||
|
- name: environment
|
||||||
|
value: prod
|
||||||
workspaces:
|
workspaces:
|
||||||
- name: source
|
- name: source
|
||||||
workspace: source
|
workspace: source
|
||||||
- name: credentials
|
- name: credentials
|
||||||
workspace: gitea-credentials
|
workspace: gitea-credentials
|
||||||
- name: deploy-cloudflare
|
- name: quality
|
||||||
runAfter:
|
runAfter:
|
||||||
- clone
|
- 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:
|
taskRef:
|
||||||
name: url-shortener-deploy-cloudflare
|
name: url-shortener-deploy-cloudflare
|
||||||
params:
|
params:
|
||||||
@@ -176,7 +245,7 @@ spec:
|
|||||||
- name: environment
|
- name: environment
|
||||||
value: prod
|
value: prod
|
||||||
- name: image-digest
|
- name: image-digest
|
||||||
value: $(params.image-digest)
|
value: $(tasks.create-image-index.results.image-digest)
|
||||||
workspaces:
|
workspaces:
|
||||||
- name: source
|
- name: source
|
||||||
workspace: source
|
workspace: source
|
||||||
|
|||||||
@@ -1,57 +0,0 @@
|
|||||||
param(
|
|
||||||
[Parameter(Mandatory = $true)]
|
|
||||||
[string]$StagingRun
|
|
||||||
)
|
|
||||||
|
|
||||||
$ErrorActionPreference = 'Stop'
|
|
||||||
$runJson = kubectl -n tekton-ci get pipelinerun $StagingRun -o json
|
|
||||||
if ($LASTEXITCODE -ne 0) { throw 'Could not read the staging PipelineRun.' }
|
|
||||||
$run = $runJson | ConvertFrom-Json
|
|
||||||
if ($run.spec.pipelineRef.name -ne 'url-shortener-staging' -or
|
|
||||||
-not ($run.status.conditions | Where-Object { $_.type -eq 'Succeeded' -and $_.status -eq 'True' })) {
|
|
||||||
throw 'Select a successful url-shortener-staging PipelineRun.'
|
|
||||||
}
|
|
||||||
$revision = ($run.spec.params | Where-Object name -eq 'git-revision').value
|
|
||||||
$digest = ($run.status.results | Where-Object name -eq 'image-digest').value
|
|
||||||
if ($revision -notmatch '^[0-9a-f]{40}$' -or $digest -notmatch '^sha256:[0-9a-f]{64}$') {
|
|
||||||
throw 'The staging run has no valid source revision or image digest.'
|
|
||||||
}
|
|
||||||
|
|
||||||
$pipelineRun = @{
|
|
||||||
apiVersion = 'tekton.dev/v1'
|
|
||||||
kind = 'PipelineRun'
|
|
||||||
metadata = @{
|
|
||||||
generateName = 'url-shortener-prod-'
|
|
||||||
namespace = 'tekton-ci'
|
|
||||||
labels = @{ 'app.kubernetes.io/name' = 'url-shortener'; 'app.kubernetes.io/part-of' = 'url-shortener-ci' }
|
|
||||||
annotations = @{ 'url-shortener.dahyeon.us/staging-run' = $StagingRun }
|
|
||||||
}
|
|
||||||
spec = @{
|
|
||||||
pipelineRef = @{ name = 'url-shortener-prod' }
|
|
||||||
params = @(
|
|
||||||
@{ name = 'git-revision'; value = $revision }
|
|
||||||
@{ name = 'image-digest'; value = $digest }
|
|
||||||
)
|
|
||||||
taskRunTemplate = @{
|
|
||||||
serviceAccountName = 'url-shortener-pipeline'
|
|
||||||
podTemplate = @{
|
|
||||||
nodeSelector = @{ 'kubernetes.io/arch' = 'amd64' }
|
|
||||||
securityContext = @{ fsGroup = 1000; fsGroupChangePolicy = 'OnRootMismatch' }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
workspaces = @(
|
|
||||||
@{
|
|
||||||
name = 'source'
|
|
||||||
volumeClaimTemplate = @{ spec = @{
|
|
||||||
accessModes = @('ReadWriteOnce')
|
|
||||||
storageClassName = 'local-path'
|
|
||||||
resources = @{ requests = @{ storage = '5Gi' } }
|
|
||||||
} }
|
|
||||||
}
|
|
||||||
@{ name = 'gitea-credentials'; secret = @{ secretName = 'url-shortener-gitea' } }
|
|
||||||
)
|
|
||||||
timeouts = @{ pipeline = '30m'; tasks = '25m' }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$pipelineRun | ConvertTo-Json -Depth 12 | kubectl create -f -
|
|
||||||
if ($LASTEXITCODE -ne 0) { throw 'Could not create the production PipelineRun.' }
|
|
||||||
+20
-39
@@ -3,10 +3,13 @@ kind: Task
|
|||||||
metadata:
|
metadata:
|
||||||
name: url-shortener-clone
|
name: url-shortener-clone
|
||||||
spec:
|
spec:
|
||||||
description: Clone and verify an exact non-deletion source revision from Gitea.
|
description: Clone the pushed source revision and verify the selected deployment branch.
|
||||||
params:
|
params:
|
||||||
- name: revision
|
- name: revision
|
||||||
type: string
|
type: string
|
||||||
|
- name: environment
|
||||||
|
type: string
|
||||||
|
default: staging
|
||||||
workspaces:
|
workspaces:
|
||||||
- name: source
|
- name: source
|
||||||
- name: credentials
|
- name: credentials
|
||||||
@@ -26,6 +29,8 @@ spec:
|
|||||||
value: https://git.dahyeon.us/dahyeon/url-shortener.git
|
value: https://git.dahyeon.us/dahyeon/url-shortener.git
|
||||||
- name: REVISION
|
- name: REVISION
|
||||||
value: $(params.revision)
|
value: $(params.revision)
|
||||||
|
- name: DEPLOY_ENV
|
||||||
|
value: $(params.environment)
|
||||||
- name: SOURCE_DIR
|
- name: SOURCE_DIR
|
||||||
value: $(workspaces.source.path)
|
value: $(workspaces.source.path)
|
||||||
- name: GITEA_CREDENTIALS_DIR
|
- name: GITEA_CREDENTIALS_DIR
|
||||||
@@ -34,6 +39,7 @@ spec:
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -eu
|
set -eu
|
||||||
umask 0002
|
umask 0002
|
||||||
|
case "$DEPLOY_ENV" in staging|prod) ;; *) echo 'Invalid deployment environment' >&2; exit 1;; esac
|
||||||
printf '%s\n' "$REVISION" | grep -Eq '^[0-9a-f]{40}$'
|
printf '%s\n' "$REVISION" | grep -Eq '^[0-9a-f]{40}$'
|
||||||
test "$REVISION" != '0000000000000000000000000000000000000000'
|
test "$REVISION" != '0000000000000000000000000000000000000000'
|
||||||
case "$SOURCE_DIR" in /workspace/*) ;; *) echo 'Unexpected workspace path' >&2; exit 1;; esac
|
case "$SOURCE_DIR" in /workspace/*) ;; *) echo 'Unexpected workspace path' >&2; exit 1;; esac
|
||||||
@@ -49,6 +55,11 @@ spec:
|
|||||||
EOF
|
EOF
|
||||||
chmod 0700 "$AUTH_DIR/askpass"
|
chmod 0700 "$AUTH_DIR/askpass"
|
||||||
export GIT_ASKPASS="$AUTH_DIR/askpass" GIT_TERMINAL_PROMPT=0
|
export GIT_ASKPASS="$AUTH_DIR/askpass" GIT_TERMINAL_PROMPT=0
|
||||||
|
REMOTE_REVISION="$(git ls-remote "$REPO_URL" "refs/heads/$DEPLOY_ENV" | awk 'NR == 1 {print $1}')"
|
||||||
|
if [ "$REMOTE_REVISION" != "$REVISION" ]; then
|
||||||
|
echo 'Source revision was superseded before checkout.' >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
find "$SOURCE_DIR" -mindepth 1 -maxdepth 1 -exec rm -rf {} +
|
find "$SOURCE_DIR" -mindepth 1 -maxdepth 1 -exec rm -rf {} +
|
||||||
git clone --quiet --no-tags "$REPO_URL" "$SOURCE_DIR"
|
git clone --quiet --no-tags "$REPO_URL" "$SOURCE_DIR"
|
||||||
git -C "$SOURCE_DIR" checkout --quiet --detach "$REVISION"
|
git -C "$SOURCE_DIR" checkout --quiet --detach "$REVISION"
|
||||||
@@ -408,32 +419,6 @@ spec:
|
|||||||
- name: credentials
|
- name: credentials
|
||||||
readOnly: true
|
readOnly: true
|
||||||
steps:
|
steps:
|
||||||
- name: prepare-dependencies
|
|
||||||
image: docker.io/library/node:26.13.0-bookworm@sha256:fa52d1669505e29b58c042875b1d65c229e0787a3610fd52869b22b68e480853
|
|
||||||
workingDir: $(workspaces.source.path)
|
|
||||||
computeResources:
|
|
||||||
requests:
|
|
||||||
cpu: 200m
|
|
||||||
memory: 512Mi
|
|
||||||
limits:
|
|
||||||
cpu: "2"
|
|
||||||
memory: 4Gi
|
|
||||||
env:
|
|
||||||
- name: CI
|
|
||||||
value: "true"
|
|
||||||
- name: NPM_CONFIG_CACHE
|
|
||||||
value: $(workspaces.source.path)/.cache/ci/npm
|
|
||||||
script: |
|
|
||||||
#!/bin/sh
|
|
||||||
set -eu
|
|
||||||
# Staging's quality task already installed these dependencies.
|
|
||||||
if [ -x .cache/ci/pnpm/bin/pnpm ] && [ -d node_modules ]; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
umask 0002
|
|
||||||
mkdir -p .cache/ci/pnpm .cache/ci/npm
|
|
||||||
npm install --global --prefix "$PWD/.cache/ci/pnpm" pnpm@12.16.1
|
|
||||||
.cache/ci/pnpm/bin/pnpm install --frozen-lockfile
|
|
||||||
- name: deploy
|
- name: deploy
|
||||||
image: docker.io/library/node:26.13.0-bookworm@sha256:fa52d1669505e29b58c042875b1d65c229e0787a3610fd52869b22b68e480853
|
image: docker.io/library/node:26.13.0-bookworm@sha256:fa52d1669505e29b58c042875b1d65c229e0787a3610fd52869b22b68e480853
|
||||||
workingDir: $(workspaces.source.path)
|
workingDir: $(workspaces.source.path)
|
||||||
@@ -486,12 +471,10 @@ spec:
|
|||||||
chmod 0700 "$AUTH_DIR/askpass"
|
chmod 0700 "$AUTH_DIR/askpass"
|
||||||
export GIT_ASKPASS="$AUTH_DIR/askpass" GIT_TERMINAL_PROMPT=0
|
export GIT_ASKPASS="$AUTH_DIR/askpass" GIT_TERMINAL_PROMPT=0
|
||||||
test "$(git rev-parse HEAD)" = "$REVISION"
|
test "$(git rev-parse HEAD)" = "$REVISION"
|
||||||
if [ "$DEPLOY_ENV" = staging ]; then
|
REMOTE_REVISION="$(git ls-remote "$REPO_URL" "refs/heads/$DEPLOY_ENV" | awk 'NR == 1 {print $1}')"
|
||||||
REMOTE_REVISION="$(git ls-remote "$REPO_URL" refs/heads/main | awk 'NR == 1 {print $1}')"
|
if [ "$REMOTE_REVISION" != "$REVISION" ]; then
|
||||||
if [ "$REMOTE_REVISION" != "$REVISION" ]; then
|
echo 'Source revision was superseded before Cloudflare deployment.' >&2
|
||||||
echo 'Source revision was superseded before Cloudflare deployment.' >&2
|
exit 1
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
command -v pnpm >/dev/null
|
command -v pnpm >/dev/null
|
||||||
pnpm deploy:cloudflare -- "$DEPLOY_ENV"
|
pnpm deploy:cloudflare -- "$DEPLOY_ENV"
|
||||||
@@ -656,12 +639,10 @@ spec:
|
|||||||
fi
|
fi
|
||||||
git -C "$STATE_DIR" add "apps/url-shortener/overlays/$DEPLOY_ENV/kustomization.yaml" "apps/url-shortener/overlays/$DEPLOY_ENV/configmap.yaml"
|
git -C "$STATE_DIR" add "apps/url-shortener/overlays/$DEPLOY_ENV/kustomization.yaml" "apps/url-shortener/overlays/$DEPLOY_ENV/configmap.yaml"
|
||||||
git -C "$STATE_DIR" commit -m "chore(url-shortener): deploy $DEPLOY_ENV $REVISION"
|
git -C "$STATE_DIR" commit -m "chore(url-shortener): deploy $DEPLOY_ENV $REVISION"
|
||||||
if [ "$DEPLOY_ENV" = staging ]; then
|
REMOTE_REVISION="$(git ls-remote "$SOURCE_REPO_URL" "refs/heads/$DEPLOY_ENV" | awk 'NR == 1 {print $1}')"
|
||||||
REMOTE_REVISION="$(git ls-remote "$SOURCE_REPO_URL" refs/heads/main | awk 'NR == 1 {print $1}')"
|
if [ "$REMOTE_REVISION" != "$REVISION" ]; then
|
||||||
if [ "$REMOTE_REVISION" != "$REVISION" ]; then
|
echo 'Source revision was superseded before GitOps push.' >&2
|
||||||
echo 'Source revision was superseded before GitOps push.' >&2
|
exit 1
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
# A concurrent state update causes a non-fast-forward failure, never an overwrite.
|
# A concurrent state update causes a non-fast-forward failure, never an overwrite.
|
||||||
git -C "$STATE_DIR" push origin HEAD:main
|
git -C "$STATE_DIR" push origin HEAD:main
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ spec:
|
|||||||
params:
|
params:
|
||||||
- name: git-revision
|
- name: git-revision
|
||||||
value: $(body.after)
|
value: $(body.after)
|
||||||
|
- name: environment
|
||||||
|
value: $(extensions.environment)
|
||||||
---
|
---
|
||||||
apiVersion: triggers.tekton.dev/v1beta1
|
apiVersion: triggers.tekton.dev/v1beta1
|
||||||
kind: TriggerTemplate
|
kind: TriggerTemplate
|
||||||
@@ -14,17 +16,18 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
params:
|
params:
|
||||||
- name: git-revision
|
- name: git-revision
|
||||||
|
- name: environment
|
||||||
resourcetemplates:
|
resourcetemplates:
|
||||||
- apiVersion: tekton.dev/v1
|
- apiVersion: tekton.dev/v1
|
||||||
kind: PipelineRun
|
kind: PipelineRun
|
||||||
metadata:
|
metadata:
|
||||||
generateName: url-shortener-staging-
|
generateName: url-shortener-$(tt.params.environment)-
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/name: url-shortener
|
app.kubernetes.io/name: url-shortener
|
||||||
app.kubernetes.io/part-of: url-shortener-ci
|
app.kubernetes.io/part-of: url-shortener-ci
|
||||||
spec:
|
spec:
|
||||||
pipelineRef:
|
pipelineRef:
|
||||||
name: url-shortener-staging
|
name: url-shortener-$(tt.params.environment)
|
||||||
params:
|
params:
|
||||||
- name: git-revision
|
- name: git-revision
|
||||||
value: $(tt.params.git-revision)
|
value: $(tt.params.git-revision)
|
||||||
@@ -79,7 +82,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
serviceAccountName: url-shortener-event-listener
|
serviceAccountName: url-shortener-event-listener
|
||||||
triggers:
|
triggers:
|
||||||
- name: main-push
|
- name: branch-push
|
||||||
interceptors:
|
interceptors:
|
||||||
- ref:
|
- ref:
|
||||||
name: github
|
name: github
|
||||||
@@ -95,7 +98,11 @@ spec:
|
|||||||
name: cel
|
name: cel
|
||||||
params:
|
params:
|
||||||
- name: filter
|
- name: filter
|
||||||
value: body.repository.full_name == 'dahyeon/url-shortener' && body.ref == 'refs/heads/main' && body.after.matches('^[0-9a-f]{40}$') && body.after != '0000000000000000000000000000000000000000'
|
value: body.repository.full_name == 'dahyeon/url-shortener' && body.ref in ['refs/heads/staging', 'refs/heads/prod'] && body.after.matches('^[0-9a-f]{40}$') && body.after != '0000000000000000000000000000000000000000'
|
||||||
|
- name: overlays
|
||||||
|
value:
|
||||||
|
- key: environment
|
||||||
|
expression: "body.ref.split('/')[2]"
|
||||||
bindings:
|
bindings:
|
||||||
- ref: url-shortener-main
|
- ref: url-shortener-main
|
||||||
template:
|
template:
|
||||||
|
|||||||
Reference in new issue
Block a user