# Pipeline CI/CD pour datacat steps: # Build backend build-back: image: gcr.io/kaniko-project/executor:debug commands: - echo '{"auths":{"git.chmod777.dev":{"username":"'"$REGISTRY_USER"'","password":"'"$REGISTRY_PASSWORD"'"}}}' > /kaniko/.docker/config.json - /kaniko/executor --dockerfile=infra/Dockerfile.prod --target=back --context=dir:///woodpecker/src/git.chmod777.dev/z3n/datacat --destination=git.chmod777.dev/z3n/datacat/back:${CI_COMMIT_SHA:0:8} --destination=git.chmod777.dev/z3n/datacat/back:latest --cache=true environment: REGISTRY_USER: from_secret: registry_user REGISTRY_PASSWORD: from_secret: registry_password # Build frontend build-front: image: gcr.io/kaniko-project/executor:debug commands: - echo '{"auths":{"git.chmod777.dev":{"username":"'"$REGISTRY_USER"'","password":"'"$REGISTRY_PASSWORD"'"}}}' > /kaniko/.docker/config.json - /kaniko/executor --dockerfile=infra/Dockerfile.prod --target=front --context=dir:///woodpecker/src/git.chmod777.dev/z3n/datacat --build-arg ANGULAR_API_URL=https://api.datacat.dev.chmod777.dev --destination=git.chmod777.dev/z3n/datacat/front:${CI_COMMIT_SHA:0:8} --destination=git.chmod777.dev/z3n/datacat/front:latest --cache=true environment: REGISTRY_USER: from_secret: registry_user REGISTRY_PASSWORD: from_secret: registry_password # Deploy sur K8s deploy: image: bitnami/kubectl:latest environment: KUBECONFIG: /tmp/kubeconfig.yaml DEPLOY_KUBECONFIG: from_secret: deploy_kubeconfig commands: - echo "$DEPLOY_KUBECONFIG" > /tmp/kubeconfig.yaml - kubectl set image deployment/backend backend=git.chmod777.dev/z3n/datacat/back:${CI_COMMIT_SHA:0:8} -n datacat - kubectl set image deployment/frontend frontend=git.chmod777.dev/z3n/datacat/front:${CI_COMMIT_SHA:0:8} -n datacat - kubectl rollout status deployment/backend -n datacat --timeout=120s - kubectl rollout status deployment/frontend -n datacat --timeout=120s depends_on: - build-back - build-front