Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stages:
- - test_local
- - deploy_acc
- - test_acc
- - deploy_prod
- test_local:
- image: php:7.0
- stage: test_local
- services:
- - postgres:latest
- variables:
- POSTGRES_DB: test_db
- POSTGRES_USER: test_user
- POSTGRES_PASSWORD: test123
- cache:
- paths:
- - vendor/
- before_script:
- - dev/dist/prepare-php-docker.sh > /dev/null
- - docker-php-ext-install pdo_pgsql
- - php composer.phar install
- - cp dev/dist/gitlab.env .env
- - php artisan key:generate
- script:
- - vendor/bin/phpunit
- .preparedeploy: &preparedeploy
- before_script:
- - dev/dist/prepare-php-docker.sh > /dev/null
- - rm composer.json
- - rm composer.lock
- - php composer.phar require deployer/deployer:^3.2
- - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- - eval $(ssh-agent -s)
- - ssh-add <(echo "$SSH_KEY")
- - mkdir -p ~/.ssh
- - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- deploy_acc:
- <<: *preparedeploy
- image: php:7.0
- stage: deploy_acc
- only:
- - master
- cache:
- paths:
- - vendor/
- script:
- - vendor/bin/dep deploy acc -vvv
- test_acc:
- image: node:6.7
- stage: test_acc
- only:
- - master
- cache:
- paths:
- - node_modules/
- before_script:
- - npm install > /dev/null
- - echo $ACC_IP_HOST >> /etc/hosts
- script:
- - ./node_modules/newman/bin/newman.js run ./dev/postman/api_tests_collection.json -e ./dev/postman/acceptance_environment.json --bail
- deploy_prod:
- <<: *preparedeploy
- image: php:7.0
- stage: deploy_prod
- only:
- - master
- cache:
- paths:
- - vendor/
- script:
- - vendor/bin/dep deploy prod -vvv
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement