Klip: Kutt like it's perfect. An easy to use self-hosted URL shortener. https://uwu.ryukyu/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

68 lines
1.4 KiB

kind: pipeline
name: klip
trigger:
branch:
- develop
steps:
- name: "setup postgres"
image: postgres:10.14-alpine
pull: if-not-exists
detach: true
commands:
- sleep 30
- 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
- name: "start"
image: node
pull: if-not-exists
detach: true
commands:
- npm start
- name: "check response"
image: inutano/wget
pull: if-not-exists
commands:
- wget --server-response http://start:3000/api/v2/health
services:
- name: postgres
image: postgres:10.14-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_HOST_AUTH_METHOD: trust
- name: redis
image: redis