Initial commit
This commit is contained in:
+114
@@ -0,0 +1,114 @@
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: build
|
||||
|
||||
steps:
|
||||
- name: build
|
||||
image: node:19
|
||||
environment:
|
||||
DATABASE_URL:
|
||||
from_secret: DATABASE_URL
|
||||
DB_USER:
|
||||
from_secret: DB_USER
|
||||
DB_PASSWORD:
|
||||
from_secret: DB_PASSWORD
|
||||
commands:
|
||||
- npm install
|
||||
- npm run check
|
||||
- npx playwright install --with-deps
|
||||
- npm run test
|
||||
- npm run test:unit
|
||||
- npm run build
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- push
|
||||
- promote
|
||||
- rollback
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: exec
|
||||
name: deploy demo
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
steps:
|
||||
- name: deploy
|
||||
environment:
|
||||
COMPOSE_PROJECT_NAME: ${DRONE_REPO_NAME}
|
||||
ORIGIN:
|
||||
from_secret: DEMO_ORIGIN
|
||||
PORT:
|
||||
from_secret: PORT
|
||||
DATABASE_URL:
|
||||
from_secret: DATABASE_URL
|
||||
DB_USER:
|
||||
from_secret: DB_USER
|
||||
DB_PASSWORD:
|
||||
from_secret: DB_PASSWORD
|
||||
commands:
|
||||
- docker compose up -d --build
|
||||
|
||||
depends_on:
|
||||
- build
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- demo
|
||||
event:
|
||||
- push
|
||||
- promote
|
||||
- rollback
|
||||
target:
|
||||
exclude:
|
||||
- production
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: ssh
|
||||
name: deploy prod
|
||||
|
||||
server:
|
||||
host:
|
||||
from_secret: host
|
||||
user:
|
||||
from_secret: username
|
||||
ssh_key:
|
||||
from_secret: ssh_key
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
steps:
|
||||
- name: deploy
|
||||
environment:
|
||||
COMPOSE_PROJECT_NAME: ${DRONE_REPO_NAME,,}
|
||||
ORIGIN:
|
||||
from_secret: PROD_ORIGIN
|
||||
PORT:
|
||||
from_secret: PORT
|
||||
DATABASE_URL:
|
||||
from_secret: DATABASE_URL
|
||||
DB_USER:
|
||||
from_secret: DB_USER
|
||||
DB_PASSWORD:
|
||||
from_secret: DB_PASSWORD
|
||||
commands:
|
||||
- docker compose up -d --build
|
||||
|
||||
depends_on:
|
||||
- build
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- demo
|
||||
event:
|
||||
- promote
|
||||
- rollback
|
||||
target:
|
||||
- production
|
||||
Reference in New Issue
Block a user