.travis.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # .travis.yml
  2. language: minimal
  3. sudo: required
  4. services:
  5. - docker
  6. env:
  7. global:
  8. - REDIS_PASSWORD=PASSWORD
  9. - BACKEND_PORT=8080
  10. - FRONTEND_PORT=80
  11. - MONGO_PORT=27017
  12. - MONGO_ROOT_PASSWORD=PASSWORD_HERE
  13. - MONGO_USER_USERNAME=musare
  14. - MONGO_USER_PASSWORD=OTHER_PASSWORD_HERE
  15. - MONGOCLIENT_PORT=3000
  16. - REDIS_PORT=6379
  17. - COMPOSE_PROJECT_NAME=musare
  18. - FRONTEND_MODE=prod
  19. before_install:
  20. # create config files from template
  21. - cp backend/config/template.json backend/config/default.json
  22. - cp frontend/dist/config/template.json frontend/dist/config/default.json
  23. jobs:
  24. include:
  25. - stage: frontend
  26. script:
  27. - docker-compose build frontend # build frontend
  28. - docker-compose up -d frontend # start frontend
  29. - docker-compose exec frontend /bin/bash -c "cd app && yarn lint" # using eslint to check for formatting/linting issues
  30. - docker-compose exec frontend /bin/bash -c "cd app && snyk test --dev" # scan for dependency/dev. dependency vunerabilities
  31. - stage: backend
  32. script:
  33. - docker-compose up -d mongo # start mongo (users automatically setup)
  34. - docker-compose up -d redis # start redis
  35. - docker-compose build backend # build backend
  36. - docker-compose up -d backend # start backend
  37. - docker-compose exec backend /bin/bash -c "cd app && snyk test --dev" # scan for dependency/dev. dependency vunerabilities