2022-11-29 05:37:37 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: kubernetes
|
|
|
|
name: default
|
|
|
|
|
2022-11-29 06:17:50 +00:00
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
pod-security.kubernetes.io/audit: privileged
|
|
|
|
|
2022-11-29 06:45:40 +00:00
|
|
|
services:
|
2022-11-29 07:07:03 +00:00
|
|
|
- name: docker daemon
|
2022-11-29 06:45:40 +00:00
|
|
|
image: docker:dind
|
2022-11-29 06:50:43 +00:00
|
|
|
privileged: true
|
2022-11-29 07:01:27 +00:00
|
|
|
environment:
|
|
|
|
DOCKER_TLS_CERTDIR: ""
|
2022-12-09 10:43:49 +00:00
|
|
|
when:
|
|
|
|
event:
|
|
|
|
- tag
|
|
|
|
- promote
|
2022-11-29 06:45:40 +00:00
|
|
|
|
2022-11-29 05:37:37 +00:00
|
|
|
steps:
|
2022-11-29 05:53:38 +00:00
|
|
|
- name: node.js build
|
2022-11-29 05:37:37 +00:00
|
|
|
image: node:18
|
|
|
|
commands:
|
2022-11-29 05:48:00 +00:00
|
|
|
- "npm add --global pnpm"
|
2022-11-29 05:37:37 +00:00
|
|
|
- pnpm i
|
|
|
|
- pnpm run build
|
2022-11-29 05:53:38 +00:00
|
|
|
|
2022-11-29 06:01:20 +00:00
|
|
|
- name: container build
|
2022-11-29 06:45:40 +00:00
|
|
|
image: docker:latest
|
2022-11-29 06:50:43 +00:00
|
|
|
privileged: true
|
2022-11-29 05:53:38 +00:00
|
|
|
commands:
|
2022-11-29 07:07:03 +00:00
|
|
|
- "while ! docker stats --no-stream; do sleep 1; done"
|
2022-11-29 06:45:40 +00:00
|
|
|
- "docker build -t $DOCKER_REGISTRY/garrettmills/www ."
|
|
|
|
- "docker push $DOCKER_REGISTRY/garrettmills/www"
|
2022-11-29 05:53:38 +00:00
|
|
|
environment:
|
2022-11-29 07:02:20 +00:00
|
|
|
DOCKER_HOST: tcp://localhost:2375
|
2022-11-29 05:53:38 +00:00
|
|
|
DOCKER_REGISTRY:
|
|
|
|
from_secret: DOCKER_REGISTRY
|
2022-12-09 10:43:49 +00:00
|
|
|
when:
|
|
|
|
event:
|
|
|
|
- tag
|
|
|
|
- promote
|
2022-11-29 07:09:46 +00:00
|
|
|
|
|
|
|
- name: k8s rollout
|
|
|
|
image: bitnami/kubectl
|
2022-11-29 07:12:20 +00:00
|
|
|
privileged: true
|
2022-11-29 07:09:46 +00:00
|
|
|
commands:
|
|
|
|
- cd deploy && kubectl apply -f .
|
2022-11-29 08:29:03 +00:00
|
|
|
- kubectl rollout restart deployment/garrettmills-dev -n default
|
2022-12-09 10:43:49 +00:00
|
|
|
when:
|
|
|
|
event:
|
|
|
|
- tag
|
|
|
|
- promote
|