.travis.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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: general
  26. - stage: frontend
  27. script:
  28. - docker-compose build frontend # build frontend
  29. - docker-compose up -d frontend # start frontend
  30. - docker-compose exec frontend /bin/bash -c "cd app && yarn lint" # using eslint to check for formatting/linting issues
  31. - docker-compose exec frontend /bin/bash -c "snyk test --dev" # scan for dependency/dev. dependency vunerabilities
  32. - stage: backend
  33. script:
  34. - docker-compose up -d mongo # start mongo (users automatically setup)
  35. - docker-compose up -d mongoclient redis # start mongoclient and redis
  36. - docker-compose build backend # build backend
  37. - docker-compose up -d backend # start backend
  38. - docker-compose exec backend /bin/bash -c "snyk test --dev" # scan for dependency/dev. dependency vunerabilities