stages: - build - test - test_failed - deploy cache: paths: - vendor/ - node_modules/ before_script: #配置环境 - sudo cp ci/.envCi .env - sudo bash ci/installEnv.sh build: stage: build tags: - testwas script: - echo "build ....." test: stage: test tags: - testwas script: - echo "run test....." - path=`pwd` - sudo bash ci/judgePush.sh $path - php vendor/bin/phpunit --testsuite=Services - sudo bash ci/sendEmail.sh test_failed: stage: test_failed tags: - testwas script: - echo "run test_failed" - email=`sudo git log --pretty=format:"%ce" -1` - sudo bash ci/sendEmail.sh $email when: on_failure deploy: stage: deploy tags: - testwas script: - echo "deploy ...." # - cd /var/www/bswas_test && sudo git config --global credential.helper store # - sudo git pull - sudo bash ci/scpUpdate.sh - sudo bash ci/executeCommand.sh only: - master