backend/.drone.yml

87 lines
2.2 KiB
YAML
Raw Normal View History

2020-10-06 00:16:59 +00:00
kind: pipeline
name: default
steps:
# =============== RELEASE ===============
- name: release
image: plugins/gitea-release
settings:
api_key:
from_secret: gitea_api_key
base_url: https://code.garrettmills.dev
title: ${DRONE_TAG}
when:
event: tag
# =============== DEPLOY TO DEV SITE ===============
- name: deploy repo to staging site
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}
2020-10-06 00:20:25 +00:00
- yarn install
2020-10-06 00:16:59 +00:00
- systemctl restart noded-dev
when:
event: promote
target: staging
2020-10-06 01:25:33 +00:00
# =============== 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:
2020-10-06 01:26:26 +00:00
- cd /etc/glmdev/noded-prod/backend
2020-10-06 01:25:33 +00:00
- git checkout master
- git pull
- git checkout ${DRONE_COMMIT}
- yarn install
- systemctl restart noded
2020-10-06 01:25:33 +00:00
when:
event: promote
target: production
2020-10-06 00:16:59 +00:00
# =============== 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