56 lines
1.1 KiB
YAML
56 lines
1.1 KiB
YAML
kind: pipeline
|
|
name: klip
|
|
|
|
trigger:
|
|
branch:
|
|
- develop
|
|
|
|
steps:
|
|
- name: "setup postgres"
|
|
image: postgres:10.14-alpine
|
|
pull: if-not-exists
|
|
detach: true
|
|
commands:
|
|
- sleep 15
|
|
- psql -U postgres -c "CREATE USER klip WITH PASSWORD 'klip' SUPERUSER;" -h postgres
|
|
|
|
- name: "setup redis"
|
|
image: redis
|
|
pull: if-not-exists
|
|
detach: true
|
|
commands:
|
|
- sleep 5
|
|
- redis-cli -h redis ping
|
|
|
|
- name: "configure .env"
|
|
image: ubuntu
|
|
pull: if-not-exists
|
|
commands:
|
|
- cp .example.env .env
|
|
- sed -i 's/DB_HOST=localhost/DB_HOST=postgres/g' .env
|
|
- sed -i 's/DB_USER=/DB_USER=klip/g' .env
|
|
- sed -i 's/DB_PASSWORD=/DB_PASSWORD=klip/g' .env
|
|
- sed -i 's/REDIS_HOST="127.0.0.1"/REDIS_HOST="redis"/g' .env
|
|
|
|
- name: "install node dependencies"
|
|
image: node
|
|
pull: if-not-exists
|
|
commands:
|
|
- npm install
|
|
|
|
- name: "build"
|
|
image: node
|
|
pull: if-not-exists
|
|
commands:
|
|
- npm run build
|
|
|
|
services:
|
|
- name: postgres
|
|
image: postgres:10.14-alpine
|
|
environment:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_HOST_AUTH_METHOD: trust
|
|
|
|
- name: redis
|
|
image: redis
|