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.
 
 
 
 

71 lines
1.5 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 45
  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. - sed -i 's/DEFAULT_DOMAIN="localhost:3000"/DEFAULT_DOMAIN="0.0.0.0:3000"/g' .env
  31. - name: "install node dependencies"
  32. image: node
  33. pull: if-not-exists
  34. commands:
  35. - npm ci
  36. - name: "build"
  37. image: node
  38. pull: if-not-exists
  39. commands:
  40. - npm run build
  41. - name: "start"
  42. image: node
  43. pull: if-not-exists
  44. detach: true
  45. commands:
  46. - npm start
  47. - name: "check response"
  48. image: inutano/wget
  49. pull: if-not-exists
  50. commands:
  51. - sleep 90
  52. - wget --server-response http://start:3000/api/v2/health
  53. services:
  54. - name: postgres
  55. image: postgres:10.14-alpine
  56. environment:
  57. POSTGRES_USER: postgres
  58. POSTGRES_HOST_AUTH_METHOD: trust
  59. - name: redis
  60. image: redis