.gitlab-ci.yml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # This file is a template, and might need editing before it works on your project.
  2. # Official framework image. Look for the different tagged releases at:
  3. # https://hub.docker.com/r/library/node/tags/
  4. image: node:7
  5. before_script:
  6. # Install ssh-agent if not already installed, it is required by Docker.
  7. # (change apt-get to yum if you use a CentOS-based image)
  8. - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
  9. # Run ssh-agent (inside the build environment)
  10. - eval $(ssh-agent -s)
  11. # For Docker builds disable host key checking. Be aware that by adding that
  12. # you are suspectible to man-in-the-middle attacks.
  13. # WARNING: Use this only with the Docker executor, if you use it with shell
  14. # you will overwrite your user's SSH config.
  15. - mkdir -p ~/.ssh
  16. - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
  17. # This folder is cached between builds
  18. # http://docs.gitlab.com/ce/ci/yaml/README.html#cache
  19. #cache:
  20. # paths:
  21. # - node_modules/
  22. stages:
  23. - lint
  24. - build
  25. - test
  26. - deploy
  27. lint:
  28. stage: lint
  29. script:
  30. - yarn
  31. - npm run lint
  32. test:
  33. stage: test
  34. script:
  35. - yarn
  36. - npm run unit
  37. build:
  38. stage: build
  39. script:
  40. - yarn
  41. - npm run build
  42. artifacts:
  43. paths:
  44. - dist/
  45. deploy:
  46. stage: deploy
  47. environment: dev
  48. only:
  49. - develop
  50. script:
  51. - yarn
  52. - npm run build
  53. - ssh-add <(echo "$SSH_PRIVATE_KEY")
  54. - scp -r dist/* pleroma@tenshi.heldscal.la:~/pleroma