.gitlab-ci.yml 971 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. stages:
  2. - build
  3. - test
  4. - test_failed
  5. - deploy
  6. cache:
  7. paths:
  8. - vendor/
  9. - node_modules/
  10. before_script:
  11. #配置环境
  12. - sudo cp ci/.envCi .env
  13. - sudo bash ci/installEnv.sh
  14. build:
  15. stage: build
  16. tags:
  17. - testwas
  18. script:
  19. - echo "build ....."
  20. test:
  21. stage: test
  22. tags:
  23. - testwas
  24. script:
  25. - echo "run test....."
  26. - path=`pwd`
  27. - sudo bash ci/judgePush.sh $path
  28. - php vendor/bin/phpunit --testsuite=Services
  29. - sudo bash ci/sendEmail.sh
  30. test_failed:
  31. stage: test_failed
  32. tags:
  33. - testwas
  34. script:
  35. - echo "run test_failed"
  36. - email=`sudo git log --pretty=format:"%ce" -1`
  37. - sudo bash ci/sendEmail.sh $email
  38. when: on_failure
  39. deploy:
  40. stage: deploy
  41. tags:
  42. - testwas
  43. script:
  44. - echo "deploy ...."
  45. # - cd /var/www/bswas_test && sudo git config --global credential.helper store
  46. # - sudo git pull
  47. - sudo bash ci/scpUpdate.sh
  48. - sudo bash ci/executeCommand.sh
  49. only:
  50. - master