Advertisement
Guest User

Untitled

a guest
Dec 24th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. image: alexv14v/dronphpfull:1
  2.  
  3. variables:
  4. POSTGRES_DB: dronback
  5. POSTGRES_USER: dronback_user
  6. POSTGRES_PASSWORD: "secret_dronback"
  7. REDIS_PORT: 6379
  8.  
  9. stages:
  10. - test
  11. - deploy-prod
  12. - deploy-stage
  13.  
  14. before_script:
  15. # install ssh-agent
  16. - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
  17. # run ssh-agent
  18. - eval $(ssh-agent -s)
  19. - mkdir -p ~/.ssh
  20. - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
  21.  
  22. unit_test:
  23. stage: test
  24. services:
  25. - mdillon/postgis
  26. - redis:latest
  27. script:
  28. - cp .env.test .env
  29. - apt update -y
  30. - apt install php-redis -y
  31. - php composer.phar global require hirak/prestissimo
  32. - php composer.phar install --no-ansi --no-interaction --no-progress
  33. - php composer.phar dump-autoload
  34. - php artisan config:clear && php artisan view:clear && php artisan route:clear && php artisan cache:clear && php artisan config:cache
  35. - php artisan migrate --force
  36. - php artisan db:seed --force
  37. - ./vendor/bin/paratest -p4 --coverage-text
  38.  
  39. coverage: '/^\s*Lines:\s*\d+.\d+\%/'
  40. artifacts:
  41. when: on_failure
  42. name: "${CI_BUILD_STAGE}_${CI_BUILD_REF_NAME}_FAILED"
  43. paths:
  44. - "storage/logs/laravel.log"
  45. untracked: false
  46. expire_in: 1 day
  47.  
  48. deploy_job_stage:
  49. stage: deploy-stage
  50. script:
  51. - ssh-add <(echo "$SSH_PRIVATE_KEY_STAGE")
  52. - scp -rp -P 9222 deploy_back_stage.sh gitlab@stage-back.dron.digital:~
  53. - ssh -p 9222 gitlab@stage-back.dron.digital "cd ~ && sh deploy_back_stage.sh"
  54. only:
  55. - master
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement