Initial commit: 000-platform project skeleton
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:
69
.drone.yml
Normal file
69
.drone.yml
Normal file
@@ -0,0 +1,69 @@
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: build-and-deploy
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- main
|
||||
- develop
|
||||
event:
|
||||
- push
|
||||
|
||||
steps:
|
||||
- name: build-backend
|
||||
image: docker:dind
|
||||
volumes:
|
||||
- name: docker-sock
|
||||
path: /var/run/docker.sock
|
||||
commands:
|
||||
- docker build -t platform-backend:${DRONE_COMMIT_SHA:0:8} -f deploy/Dockerfile.backend .
|
||||
- docker tag platform-backend:${DRONE_COMMIT_SHA:0:8} platform-backend:latest
|
||||
|
||||
- name: deploy-test
|
||||
image: docker:dind
|
||||
volumes:
|
||||
- name: docker-sock
|
||||
path: /var/run/docker.sock
|
||||
environment:
|
||||
DATABASE_URL:
|
||||
from_secret: database_url
|
||||
API_KEY:
|
||||
from_secret: api_key
|
||||
JWT_SECRET:
|
||||
from_secret: jwt_secret
|
||||
CONFIG_ENCRYPT_KEY:
|
||||
from_secret: config_encrypt_key
|
||||
commands:
|
||||
- docker stop platform-backend-test || true
|
||||
- docker rm platform-backend-test || true
|
||||
- docker run -d --name platform-backend-test -p 8001:8000 --restart unless-stopped -e DATABASE_URL=$DATABASE_URL -e API_KEY=$API_KEY -e JWT_SECRET=$JWT_SECRET -e CONFIG_ENCRYPT_KEY=$CONFIG_ENCRYPT_KEY platform-backend:latest
|
||||
when:
|
||||
branch:
|
||||
- develop
|
||||
|
||||
- name: deploy-prod
|
||||
image: docker:dind
|
||||
volumes:
|
||||
- name: docker-sock
|
||||
path: /var/run/docker.sock
|
||||
environment:
|
||||
DATABASE_URL:
|
||||
from_secret: database_url
|
||||
API_KEY:
|
||||
from_secret: api_key
|
||||
JWT_SECRET:
|
||||
from_secret: jwt_secret
|
||||
CONFIG_ENCRYPT_KEY:
|
||||
from_secret: config_encrypt_key
|
||||
commands:
|
||||
- docker stop platform-backend-prod || true
|
||||
- docker rm platform-backend-prod || true
|
||||
- docker run -d --name platform-backend-prod -p 9001:8000 --restart unless-stopped -e DATABASE_URL=$DATABASE_URL -e API_KEY=$API_KEY -e JWT_SECRET=$JWT_SECRET -e CONFIG_ENCRYPT_KEY=$CONFIG_ENCRYPT_KEY platform-backend:latest
|
||||
when:
|
||||
branch:
|
||||
- main
|
||||
|
||||
volumes:
|
||||
- name: docker-sock
|
||||
host:
|
||||
path: /var/run/docker.sock
|
||||
Reference in New Issue
Block a user