Corrige .drone.yml com deploy funcional para homologação e produção
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:
46
.drone.yml
46
.drone.yml
@@ -18,15 +18,7 @@ steps:
|
|||||||
source: .
|
source: .
|
||||||
target: /home/app_fatura_homolog
|
target: /home/app_fatura_homolog
|
||||||
rm: false
|
rm: false
|
||||||
|
|
||||||
- name: build image
|
|
||||||
image: docker
|
|
||||||
volumes:
|
|
||||||
- name: dockersock
|
|
||||||
path: /var/run/docker.sock
|
|
||||||
commands:
|
|
||||||
- cd /home/app_fatura_homolog
|
|
||||||
- docker build -t faturas_homolog .
|
|
||||||
|
|
||||||
- name: restart homolog container
|
- name: restart homolog container
|
||||||
image: appleboy/drone-ssh
|
image: appleboy/drone-ssh
|
||||||
@@ -36,13 +28,39 @@ steps:
|
|||||||
password: F6tC5tCh29XQRpzp
|
password: F6tC5tCh29XQRpzp
|
||||||
port: 22
|
port: 22
|
||||||
script:
|
script:
|
||||||
- mkdir -p /home/app_fatura_homolog
|
|
||||||
- docker rm -f FaturasHomolog || true
|
- docker rm -f FaturasHomolog || true
|
||||||
- cd /home/app_fatura_homolog
|
- cd /home/app_fatura_homolog
|
||||||
- docker compose -f docker-compose-homolog.yml up -d
|
- docker compose -f docker-compose-homolog.yml up -d
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: production
|
||||||
|
|
||||||
volumes:
|
trigger:
|
||||||
- name: dockersock
|
branch:
|
||||||
host:
|
- production
|
||||||
path: /var/run/docker.sock
|
|
||||||
|
steps:
|
||||||
|
- name: deploy to production
|
||||||
|
image: appleboy/drone-scp
|
||||||
|
settings:
|
||||||
|
host: 216.22.5.141
|
||||||
|
username: root
|
||||||
|
password: F6tC5tCh29XQRpzp
|
||||||
|
port: 22
|
||||||
|
source: .
|
||||||
|
target: /home/app_fatura
|
||||||
|
rm: true
|
||||||
|
|
||||||
|
- name: restart production container
|
||||||
|
image: appleboy/drone-ssh
|
||||||
|
settings:
|
||||||
|
host: 216.22.5.141
|
||||||
|
username: root
|
||||||
|
password: F6tC5tCh29XQRpzp
|
||||||
|
port: 22
|
||||||
|
script:
|
||||||
|
- docker rm -f Faturas || true
|
||||||
|
- cd /home/app_fatura
|
||||||
|
- docker compose up -d
|
||||||
|
|||||||
Reference in New Issue
Block a user