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

  1. kind: pipeline
  2. name: klip
  3. trigger:
  4. branch:
  5. - develop
  6. steps:
  7. - name: "setup postgres"
  8. image: postgres:10.14-alpine
  9. pull: if-not-exists
  10. detach: true
  11. commands:
  12. - sleep 30
  13. - psql -U postgres -c "CREATE USER klip WITH PASSWORD 'klip' SUPERUSER;" -h postgres
  14. - name: "setup redis"
  15. image: redis
  16. pull: if-not-exists
  17. detach: true
  18. commands:
  19. - sleep 5
  20. - redis-cli -h redis ping
  21. - name: "configure .env"
  22. image: ubuntu
  23. pull: if-not-exists
  24. commands:
  25. - cp .example.env .env
  26. - sed -i 's/DB_HOST=localhost/DB_HOST=postgres/g' .env
  27. - sed -i 's/DB_USER=/DB_USER=klip/g' .env
  28. - sed -i 's/DB_PASSWORD=/DB_PASSWORD=klip/g' .env
  29. - sed -i 's/REDIS_HOST="127.0.0.1"/REDIS_HOST="redis"/g' .env
  30. - name: "install node dependencies"
  31. image: node
  32. pull: if-not-exists
  33. commands:
  34. - npm install
  35. - name: "build"
  36. image: node
  37. pull: if-not-exists
  38. commands:
  39. - npm run build
  40. - name: "start"
  41. image: node
  42. pull: if-not-exists
  43. detach: true
  44. commands:
  45. - npm start
  46. - name: "check response"
  47. image: inutano/wget
  48. pull: if-not-exists
  49. commands:
  50. - wget --server-response http://start:3000/api/v2/health
  51. services:
  52. - name: postgres
  53. image: postgres:10.14-alpine
  54. environment:
  55. POSTGRES_USER: postgres
  56. POSTGRES_HOST_AUTH_METHOD: trust
  57. - name: redis
  58. image: redis