The woodpeckerci/plugin-docker-buildx plugin expects build_args as a YAML map (key: value), not a list. This was causing build args to not be passed to the Docker build, resulting in unknown git SHA and build info in the deployed application. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
192 lines
5.9 KiB
YAML
192 lines
5.9 KiB
YAML
when:
|
|
- event: [push, pull_request]
|
|
|
|
steps:
|
|
# ===========================================
|
|
# PR VALIDATION: Parallel type checks (PRs only)
|
|
# ===========================================
|
|
typecheck-backend:
|
|
image: code.cannabrands.app/creationshop/node:20
|
|
commands:
|
|
- cd backend
|
|
- npm ci --prefer-offline
|
|
- npx tsc --noEmit
|
|
depends_on: []
|
|
when:
|
|
event: pull_request
|
|
|
|
typecheck-cannaiq:
|
|
image: code.cannabrands.app/creationshop/node:20
|
|
commands:
|
|
- cd cannaiq
|
|
- npm ci --prefer-offline
|
|
- npx tsc --noEmit
|
|
depends_on: []
|
|
when:
|
|
event: pull_request
|
|
|
|
typecheck-findadispo:
|
|
image: code.cannabrands.app/creationshop/node:20
|
|
commands:
|
|
- cd findadispo/frontend
|
|
- npm ci --prefer-offline
|
|
- npx tsc --noEmit 2>/dev/null || true
|
|
depends_on: []
|
|
when:
|
|
event: pull_request
|
|
|
|
typecheck-findagram:
|
|
image: code.cannabrands.app/creationshop/node:20
|
|
commands:
|
|
- cd findagram/frontend
|
|
- npm ci --prefer-offline
|
|
- npx tsc --noEmit 2>/dev/null || true
|
|
depends_on: []
|
|
when:
|
|
event: pull_request
|
|
|
|
# ===========================================
|
|
# AUTO-MERGE: Merge PR after all checks pass
|
|
# ===========================================
|
|
auto-merge:
|
|
image: alpine:latest
|
|
environment:
|
|
GITEA_TOKEN:
|
|
from_secret: gitea_token
|
|
commands:
|
|
- apk add --no-cache curl
|
|
- |
|
|
echo "Merging PR #${CI_COMMIT_PULL_REQUEST}..."
|
|
curl -s -X POST \
|
|
-H "Authorization: token $GITEA_TOKEN" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{"Do":"merge"}' \
|
|
"https://code.cannabrands.app/api/v1/repos/Creationshop/dispensary-scraper/pulls/${CI_COMMIT_PULL_REQUEST}/merge"
|
|
depends_on:
|
|
- typecheck-backend
|
|
- typecheck-cannaiq
|
|
- typecheck-findadispo
|
|
- typecheck-findagram
|
|
when:
|
|
event: pull_request
|
|
|
|
# ===========================================
|
|
# MASTER DEPLOY: Parallel Docker builds
|
|
# ===========================================
|
|
docker-backend:
|
|
image: woodpeckerci/plugin-docker-buildx
|
|
settings:
|
|
registry: code.cannabrands.app
|
|
repo: code.cannabrands.app/creationshop/dispensary-scraper
|
|
tags:
|
|
- latest
|
|
- ${CI_COMMIT_SHA:0:8}
|
|
dockerfile: backend/Dockerfile
|
|
context: backend
|
|
username:
|
|
from_secret: registry_username
|
|
password:
|
|
from_secret: registry_password
|
|
platforms: linux/amd64
|
|
provenance: false
|
|
build_args:
|
|
APP_BUILD_VERSION: ${CI_COMMIT_SHA:0:8}
|
|
APP_GIT_SHA: ${CI_COMMIT_SHA}
|
|
APP_BUILD_TIME: ${CI_PIPELINE_CREATED}
|
|
CONTAINER_IMAGE_TAG: ${CI_COMMIT_SHA:0:8}
|
|
depends_on: []
|
|
when:
|
|
branch: master
|
|
event: push
|
|
|
|
docker-cannaiq:
|
|
image: woodpeckerci/plugin-docker-buildx
|
|
settings:
|
|
registry: code.cannabrands.app
|
|
repo: code.cannabrands.app/creationshop/cannaiq-frontend
|
|
tags:
|
|
- latest
|
|
- ${CI_COMMIT_SHA:0:8}
|
|
dockerfile: cannaiq/Dockerfile
|
|
context: cannaiq
|
|
username:
|
|
from_secret: registry_username
|
|
password:
|
|
from_secret: registry_password
|
|
platforms: linux/amd64
|
|
provenance: false
|
|
depends_on: []
|
|
when:
|
|
branch: master
|
|
event: push
|
|
|
|
docker-findadispo:
|
|
image: woodpeckerci/plugin-docker-buildx
|
|
settings:
|
|
registry: code.cannabrands.app
|
|
repo: code.cannabrands.app/creationshop/findadispo-frontend
|
|
tags:
|
|
- latest
|
|
- ${CI_COMMIT_SHA:0:8}
|
|
dockerfile: findadispo/frontend/Dockerfile
|
|
context: findadispo/frontend
|
|
username:
|
|
from_secret: registry_username
|
|
password:
|
|
from_secret: registry_password
|
|
platforms: linux/amd64
|
|
provenance: false
|
|
depends_on: []
|
|
when:
|
|
branch: master
|
|
event: push
|
|
|
|
docker-findagram:
|
|
image: woodpeckerci/plugin-docker-buildx
|
|
settings:
|
|
registry: code.cannabrands.app
|
|
repo: code.cannabrands.app/creationshop/findagram-frontend
|
|
tags:
|
|
- latest
|
|
- ${CI_COMMIT_SHA:0:8}
|
|
dockerfile: findagram/frontend/Dockerfile
|
|
context: findagram/frontend
|
|
username:
|
|
from_secret: registry_username
|
|
password:
|
|
from_secret: registry_password
|
|
platforms: linux/amd64
|
|
provenance: false
|
|
depends_on: []
|
|
when:
|
|
branch: master
|
|
event: push
|
|
|
|
# ===========================================
|
|
# STAGE 3: Deploy (after Docker builds)
|
|
# ===========================================
|
|
deploy:
|
|
image: bitnami/kubectl:latest
|
|
environment:
|
|
KUBECONFIG_CONTENT:
|
|
from_secret: kubeconfig_data
|
|
commands:
|
|
- mkdir -p ~/.kube
|
|
- echo "$KUBECONFIG_CONTENT" | tr -d '[:space:]' | base64 -d > ~/.kube/config
|
|
- chmod 600 ~/.kube/config
|
|
- kubectl set image deployment/scraper scraper=code.cannabrands.app/creationshop/dispensary-scraper:${CI_COMMIT_SHA:0:8} -n dispensary-scraper
|
|
- kubectl set image deployment/scraper-worker worker=code.cannabrands.app/creationshop/dispensary-scraper:${CI_COMMIT_SHA:0:8} -n dispensary-scraper
|
|
- kubectl set image deployment/cannaiq-frontend cannaiq-frontend=code.cannabrands.app/creationshop/cannaiq-frontend:${CI_COMMIT_SHA:0:8} -n dispensary-scraper
|
|
- kubectl set image deployment/findadispo-frontend findadispo-frontend=code.cannabrands.app/creationshop/findadispo-frontend:${CI_COMMIT_SHA:0:8} -n dispensary-scraper
|
|
- kubectl set image deployment/findagram-frontend findagram-frontend=code.cannabrands.app/creationshop/findagram-frontend:${CI_COMMIT_SHA:0:8} -n dispensary-scraper
|
|
- kubectl rollout status deployment/scraper -n dispensary-scraper --timeout=300s
|
|
- kubectl rollout status deployment/cannaiq-frontend -n dispensary-scraper --timeout=120s
|
|
depends_on:
|
|
- docker-backend
|
|
- docker-cannaiq
|
|
- docker-findadispo
|
|
- docker-findagram
|
|
when:
|
|
branch: master
|
|
event: push
|