fix(woodpecker): fix secrets syntax - use environment with from_secret
- Replace deprecated secrets with environment + from_secret - Fix when conditions structure - Ensure proper schema validation
This commit is contained in:
parent
e39ed36fcc
commit
14d820cf57
1 changed files with 7 additions and 13 deletions
|
|
@ -24,7 +24,6 @@ matrix:
|
||||||
- cron
|
- cron
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# Step 1: Detect if this service needs building
|
|
||||||
- name: detect-changes
|
- name: detect-changes
|
||||||
image: alpine/git
|
image: alpine/git
|
||||||
commands:
|
commands:
|
||||||
|
|
@ -65,7 +64,6 @@ steps:
|
||||||
# Export for other steps
|
# Export for other steps
|
||||||
cat .build-${SERVICE} >> ${CI_ENV}
|
cat .build-${SERVICE} >> ${CI_ENV}
|
||||||
|
|
||||||
# Step 2: Build optimized Docker image (only if changed)
|
|
||||||
- name: build
|
- name: build
|
||||||
image: woodpeckerci/plugin-docker-buildx:5.0.0
|
image: woodpeckerci/plugin-docker-buildx:5.0.0
|
||||||
settings:
|
settings:
|
||||||
|
|
@ -79,20 +77,19 @@ steps:
|
||||||
- ${CI_COMMIT_SHA}
|
- ${CI_COMMIT_SHA}
|
||||||
- latest
|
- latest
|
||||||
- high-performance-latest
|
- high-performance-latest
|
||||||
logins:
|
username:
|
||||||
- registry: https://ghcr.io
|
from_secret: GHCR_USERNAME
|
||||||
username:
|
password:
|
||||||
from_secret: GHCR_USERNAME
|
from_secret: GHCR_TOKEN
|
||||||
password:
|
|
||||||
from_secret: GHCR_TOKEN
|
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
when:
|
when:
|
||||||
- evaluate: 'env.SHOULD_BUILD == "true"'
|
- evaluate: 'env.SHOULD_BUILD == "true"'
|
||||||
|
|
||||||
# Step 3: Deploy to Kubernetes (only if changed and on main/high-performance)
|
|
||||||
- name: deploy
|
- name: deploy
|
||||||
image: bitnami/kubectl:latest
|
image: bitnami/kubectl:latest
|
||||||
secrets: [kube_config]
|
environment:
|
||||||
|
KUBE_CONFIG:
|
||||||
|
from_secret: kube_config
|
||||||
commands:
|
commands:
|
||||||
- |
|
- |
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
@ -128,9 +125,7 @@ steps:
|
||||||
kubectl get deployment/nxtgauge-rust-${DEPLOYMENT_NAME} -n ${NAMESPACE}
|
kubectl get deployment/nxtgauge-rust-${DEPLOYMENT_NAME} -n ${NAMESPACE}
|
||||||
when:
|
when:
|
||||||
- evaluate: 'env.SHOULD_BUILD == "true"'
|
- evaluate: 'env.SHOULD_BUILD == "true"'
|
||||||
- branch: [main, high-performance]
|
|
||||||
|
|
||||||
# Step 4: Notify on success
|
|
||||||
- name: notify-success
|
- name: notify-success
|
||||||
image: alpine:latest
|
image: alpine:latest
|
||||||
commands:
|
commands:
|
||||||
|
|
@ -139,7 +134,6 @@ steps:
|
||||||
- evaluate: 'env.SHOULD_BUILD == "true"'
|
- evaluate: 'env.SHOULD_BUILD == "true"'
|
||||||
- status: success
|
- status: success
|
||||||
|
|
||||||
# Step 5: Notify on failure
|
|
||||||
- name: notify-failure
|
- name: notify-failure
|
||||||
image: alpine:latest
|
image: alpine:latest
|
||||||
commands:
|
commands:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue