Update Drone config for deployment
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
51
.drone.yml
51
.drone.yml
@@ -1,12 +1,12 @@
|
||||
# DEPLOY
|
||||
kind: pipeline
|
||||
name: dev
|
||||
name: deploy
|
||||
|
||||
trigger:
|
||||
status:
|
||||
- success
|
||||
branch:
|
||||
- dev
|
||||
- success
|
||||
event:
|
||||
- push
|
||||
|
||||
steps:
|
||||
#
|
||||
@@ -28,7 +28,7 @@ steps:
|
||||
|
||||
|
||||
#
|
||||
# Build the Node.js app
|
||||
# Build Node.js app
|
||||
#
|
||||
- name: build-node
|
||||
image: node:latest
|
||||
@@ -40,19 +40,36 @@ steps:
|
||||
#
|
||||
# Build the Docker image
|
||||
#
|
||||
- name: build-docker
|
||||
# DEV
|
||||
- name: build-docker-dev
|
||||
image: docker:latest
|
||||
volumes:
|
||||
- name: docker_sock
|
||||
path: /var/run/docker.sock
|
||||
commands:
|
||||
- docker build --pull --no-cache -t cetrucflotte/housesof:dev .
|
||||
when:
|
||||
branch:
|
||||
- dev
|
||||
|
||||
# PROD
|
||||
- name: build-docker-prod
|
||||
image: docker:latest
|
||||
volumes:
|
||||
- name: docker_sock
|
||||
path: /var/run/docker.sock
|
||||
commands:
|
||||
- docker build --pull --no-cache -t cetrucflotte/housesof:latest .
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
|
||||
|
||||
#
|
||||
# Restart container
|
||||
#
|
||||
- name: restart
|
||||
# DEV
|
||||
- name: restart-container-dev
|
||||
image: appleboy/drone-ssh
|
||||
settings:
|
||||
host: flayks.com
|
||||
@@ -64,6 +81,26 @@ steps:
|
||||
- cd /data/sites/housesof.world/dev
|
||||
- docker-compose down
|
||||
- docker-compose up -d --remove-orphans
|
||||
when:
|
||||
branch:
|
||||
- dev
|
||||
|
||||
# PROD
|
||||
- name: restart-container-prod
|
||||
image: appleboy/drone-ssh
|
||||
settings:
|
||||
host: flayks.com
|
||||
username:
|
||||
from_secret: ssh_user
|
||||
key:
|
||||
from_secret: ssh_key
|
||||
script:
|
||||
- cd /data/sites/housesof.world/www
|
||||
- docker-compose down
|
||||
- docker-compose up -d --remove-orphans
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
|
||||
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user