From 1d06e9e71b00e28a39d4aab21b900434a89fcbdc Mon Sep 17 00:00:00 2001 From: garrettmills Date: Sat, 3 Dec 2022 22:34:20 -0600 Subject: [PATCH] Drone: start CI pipeline --- .drone.yml | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..cef29ef --- /dev/null +++ b/.drone.yml @@ -0,0 +1,41 @@ +--- +kind: pipeline +type: kubernetes +name: default + +metadata: + labels: + pod-security.kubernetes.io/audit: privileged + +services: + - name: docker daemon + image: docker:dind + privileged: true + environment: + DOCKER_TLS_CERTDIR: "" + +steps: + - name: node.js build + image: node:18 + commands: + - "npm add --global pnpm" + - pnpm i + - pnpm run build + + - name: container build + image: docker:latest + privileged: true + commands: + - "while ! docker stats --no-stream; do sleep 1; done" + - "docker build -t $DOCKER_REGISTRY/glmdev/mathy ." + - "docker push $DOCKER_REGISTRY/glmdev/mathy" + environment: + DOCKER_HOST: tcp://localhost:2375 + DOCKER_REGISTRY: + from_secret: DOCKER_REGISTRY + + - name: k8s rollout + image: bitnami/kubectl + commands: + - cd deploy && kubectl apply -f . + - kubectl rollout -n mathy restart deployment/mathy