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:
49
.drone.yml
49
.drone.yml
@@ -1,12 +1,12 @@
|
|||||||
# DEPLOY
|
# DEPLOY
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
name: dev
|
name: deploy
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
status:
|
status:
|
||||||
- success
|
- success
|
||||||
branch:
|
event:
|
||||||
- dev
|
- push
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
#
|
#
|
||||||
@@ -28,7 +28,7 @@ steps:
|
|||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Build the Node.js app
|
# Build Node.js app
|
||||||
#
|
#
|
||||||
- name: build-node
|
- name: build-node
|
||||||
image: node:latest
|
image: node:latest
|
||||||
@@ -40,19 +40,36 @@ steps:
|
|||||||
#
|
#
|
||||||
# Build the Docker image
|
# Build the Docker image
|
||||||
#
|
#
|
||||||
- name: build-docker
|
# DEV
|
||||||
|
- name: build-docker-dev
|
||||||
image: docker:latest
|
image: docker:latest
|
||||||
volumes:
|
volumes:
|
||||||
- name: docker_sock
|
- name: docker_sock
|
||||||
path: /var/run/docker.sock
|
path: /var/run/docker.sock
|
||||||
commands:
|
commands:
|
||||||
- docker build --pull --no-cache -t cetrucflotte/housesof:dev .
|
- 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
|
# Restart container
|
||||||
#
|
#
|
||||||
- name: restart
|
# DEV
|
||||||
|
- name: restart-container-dev
|
||||||
image: appleboy/drone-ssh
|
image: appleboy/drone-ssh
|
||||||
settings:
|
settings:
|
||||||
host: flayks.com
|
host: flayks.com
|
||||||
@@ -64,6 +81,26 @@ steps:
|
|||||||
- cd /data/sites/housesof.world/dev
|
- cd /data/sites/housesof.world/dev
|
||||||
- docker-compose down
|
- docker-compose down
|
||||||
- docker-compose up -d --remove-orphans
|
- 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