Drone: start container pipeline
All checks were successful
continuous-integration/drone Build is passing

This commit is contained in:
Garrett Mills 2022-11-29 14:16:04 -06:00
parent c72b57a0f8
commit 279086c56a

View File

@ -1,87 +1,30 @@
---
kind: pipeline kind: pipeline
name: default type: kubernetes
name: build
metadata:
labels:
pod-security.kubernetes.io/audit: privileged
services:
- name: docker daemon
image: docker:dind
privileged: true
environment:
DOCKER_TLS_CERTDIR: ""
steps: steps:
# =============== RELEASE =============== - name: container build
- name: release image: docker:latest
image: plugins/gitea-release privileged: true
settings: commands:
api_key: - "while ! docker stats --no-stream; do sleep 1; done"
from_secret: gitea_api_key - docker image build -t $DOCKER_REGISTRY/noded/backend .
base_url: https://code.garrettmills.dev - docker push $DOCKER_REGISTRY/noded/backend
title: ${DRONE_TAG} environment:
when: DOCKER_REGISTRY:
event: tag from_secret: DOCKER_REGISTRY
DOCKER_HOST: tcp://localhost:2375
# =============== DEPLOY TO DEV SITE =============== # when:
- name: deploy repo to staging site # event: tag
image: appleboy/drone-ssh
settings:
host:
from_secret: dev_site_host
username:
from_secret: dev_site_user
key:
from_secret: dev_site_key
port: 22
script:
- cd /etc/glmdev/noded/backend
- git checkout master
- git pull
- git checkout ${DRONE_COMMIT}
- yarn install
- systemctl restart noded-dev
when:
event: promote
target: staging
# =============== DEPLOY TO PROD SITE ===============
- name: deploy repo to production site
image: appleboy/drone-ssh
settings:
host:
from_secret: prod_site_host
username:
from_secret: prod_site_user
key:
from_secret: prod_site_key
port: 22
script:
- cd /etc/glmdev/noded-prod/backend
- git checkout master
- git pull
- git checkout ${DRONE_COMMIT}
- yarn install
- systemctl restart noded
when:
event: promote
target: production
# =============== NOTIFICATIONS ===============
- name: send success notifications
image: plugins/webhook
settings:
urls:
from_secret: notify_webhook_url
content_type: application/json
template: |
{
"title": "Drone-CI [noded-backend]",
"message": "Build ${DRONE_BUILD_NUMBER} completed successfully.",
"priority": 4
}
when:
status: success
- name: send error notifications
image: plugins/webhook
settings:
urls:
from_secret: notify_webhook_url
content_type: application/json
template: |
{
"title": "Drone-CI [noded-backend]",
"message": "Build ${DRONE_BUILD_NUMBER} failed!",
"priority": 6
}
when:
status: failure