Advertisement
Guest User

Untitled

a guest
Nov 25th, 2016
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. stages:
  2. - test_local
  3. - deploy_acc
  4. - test_acc
  5. - deploy_prod
  6.  
  7. test_local:
  8. image: php:7.0
  9. stage: test_local
  10. services:
  11. - postgres:latest
  12. variables:
  13. POSTGRES_DB: test_db
  14. POSTGRES_USER: test_user
  15. POSTGRES_PASSWORD: test123
  16. cache:
  17. paths:
  18. - vendor/
  19. before_script:
  20. - dev/dist/prepare-php-docker.sh > /dev/null
  21. - docker-php-ext-install pdo_pgsql
  22. - php composer.phar install
  23. - cp dev/dist/gitlab.env .env
  24. - php artisan key:generate
  25. script:
  26. - vendor/bin/phpunit
  27.  
  28. .preparedeploy: &preparedeploy
  29. before_script:
  30. - dev/dist/prepare-php-docker.sh > /dev/null
  31. - rm composer.json
  32. - rm composer.lock
  33. - php composer.phar require deployer/deployer:^3.2
  34. - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
  35. - eval $(ssh-agent -s)
  36. - ssh-add <(echo "$SSH_KEY")
  37. - mkdir -p ~/.ssh
  38. - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
  39.  
  40. deploy_acc:
  41. <<: *preparedeploy
  42. image: php:7.0
  43. stage: deploy_acc
  44. only:
  45. - master
  46. cache:
  47. paths:
  48. - vendor/
  49. script:
  50. - vendor/bin/dep deploy acc -vvv
  51.  
  52. test_acc:
  53. image: node:6.7
  54. stage: test_acc
  55. only:
  56. - master
  57. cache:
  58. paths:
  59. - node_modules/
  60. before_script:
  61. - npm install > /dev/null
  62. - echo $ACC_IP_HOST >> /etc/hosts
  63. script:
  64. - ./node_modules/newman/bin/newman.js run ./dev/postman/api_tests_collection.json -e ./dev/postman/acceptance_environment.json --bail
  65.  
  66. deploy_prod:
  67. <<: *preparedeploy
  68. image: php:7.0
  69. stage: deploy_prod
  70. only:
  71. - master
  72. cache:
  73. paths:
  74. - vendor/
  75. script:
  76. - vendor/bin/dep deploy prod -vvv
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement