fix: quote all commands in woodpecker yaml

Properly quote commands containing special YAML characters

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Erdenebat Tsenddorj
2026-01-21 21:20:05 +08:00
parent 4f2168e089
commit bf9624c99a

View File

@@ -11,27 +11,27 @@ steps:
image: docker:24-dind image: docker:24-dind
privileged: true privileged: true
commands: commands:
- docker build -t hell-world-backend:${CI_COMMIT_SHA:0:8} ./backend - 'docker build -t hell-world-backend:${CI_COMMIT_SHA:0:8} ./backend'
- docker tag hell-world-backend:${CI_COMMIT_SHA:0:8} registry.gecore.mn/library/hell-world-backend:${CI_COMMIT_SHA:0:8} - 'docker tag hell-world-backend:${CI_COMMIT_SHA:0:8} registry.gecore.mn/library/hell-world-backend:${CI_COMMIT_SHA:0:8}'
- docker tag hell-world-backend:${CI_COMMIT_SHA:0:8} registry.gecore.mn/library/hell-world-backend:latest - 'docker tag hell-world-backend:${CI_COMMIT_SHA:0:8} registry.gecore.mn/library/hell-world-backend:latest'
# 2. Frontend Docker image build # 2. Frontend Docker image build
build-frontend: build-frontend:
image: docker:24-dind image: docker:24-dind
privileged: true privileged: true
commands: commands:
- docker build -t hell-world-frontend:${CI_COMMIT_SHA:0:8} ./frontend - 'docker build -t hell-world-frontend:${CI_COMMIT_SHA:0:8} ./frontend'
- docker tag hell-world-frontend:${CI_COMMIT_SHA:0:8} registry.gecore.mn/library/hell-world-frontend:${CI_COMMIT_SHA:0:8} - 'docker tag hell-world-frontend:${CI_COMMIT_SHA:0:8} registry.gecore.mn/library/hell-world-frontend:${CI_COMMIT_SHA:0:8}'
- docker tag hell-world-frontend:${CI_COMMIT_SHA:0:8} registry.gecore.mn/library/hell-world-frontend:latest - 'docker tag hell-world-frontend:${CI_COMMIT_SHA:0:8} registry.gecore.mn/library/hell-world-frontend:latest'
# 3. Push backend to Harbor registry # 3. Push backend to Harbor registry
push-backend: push-backend:
image: docker:24-dind image: docker:24-dind
privileged: true privileged: true
commands: commands:
- echo "$HARBOR_PASSWORD" | docker login registry.gecore.mn -u "$HARBOR_USER" --password-stdin - 'echo "$HARBOR_PASSWORD" | docker login registry.gecore.mn -u "$HARBOR_USER" --password-stdin'
- docker push registry.gecore.mn/library/hell-world-backend:${CI_COMMIT_SHA:0:8} - 'docker push registry.gecore.mn/library/hell-world-backend:${CI_COMMIT_SHA:0:8}'
- docker push registry.gecore.mn/library/hell-world-backend:latest - 'docker push registry.gecore.mn/library/hell-world-backend:latest'
secrets: [harbor_user, harbor_password] secrets: [harbor_user, harbor_password]
when: when:
event: push event: push
@@ -42,9 +42,9 @@ steps:
image: docker:24-dind image: docker:24-dind
privileged: true privileged: true
commands: commands:
- echo "$HARBOR_PASSWORD" | docker login registry.gecore.mn -u "$HARBOR_USER" --password-stdin - 'echo "$HARBOR_PASSWORD" | docker login registry.gecore.mn -u "$HARBOR_USER" --password-stdin'
- docker push registry.gecore.mn/library/hell-world-frontend:${CI_COMMIT_SHA:0:8} - 'docker push registry.gecore.mn/library/hell-world-frontend:${CI_COMMIT_SHA:0:8}'
- docker push registry.gecore.mn/library/hell-world-frontend:latest - 'docker push registry.gecore.mn/library/hell-world-frontend:latest'
secrets: [harbor_user, harbor_password] secrets: [harbor_user, harbor_password]
when: when:
event: push event: push
@@ -70,9 +70,9 @@ steps:
notify: notify:
image: alpine:latest image: alpine:latest
commands: commands:
- echo "Build completed for commit ${CI_COMMIT_SHA:0:8}" - 'echo "Build completed for commit ${CI_COMMIT_SHA:0:8}"'
- echo "📦 Backend: registry.gecore.mn/library/hell-world-backend:${CI_COMMIT_SHA:0:8}" - 'echo "Backend - registry.gecore.mn/library/hell-world-backend:${CI_COMMIT_SHA:0:8}"'
- echo "📦 Frontend: registry.gecore.mn/library/hell-world-frontend:${CI_COMMIT_SHA:0:8}" - 'echo "Frontend - registry.gecore.mn/library/hell-world-frontend:${CI_COMMIT_SHA:0:8}"'
- echo "🔗 ArgoCD will sync automatically" - 'echo "ArgoCD will sync automatically"'
when: when:
status: [success, failure] status: [success, failure]