Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- image: alexv14v/dronphpfull:1
- variables:
- POSTGRES_DB: dronback
- POSTGRES_USER: dronback_user
- POSTGRES_PASSWORD: "secret_dronback"
- REDIS_PORT: 6379
- stages:
- - test
- - deploy-prod
- - deploy-stage
- before_script:
- # install ssh-agent
- - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- # run ssh-agent
- - eval $(ssh-agent -s)
- - mkdir -p ~/.ssh
- - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- unit_test:
- stage: test
- services:
- - mdillon/postgis
- - redis:latest
- script:
- - cp .env.test .env
- - apt update -y
- - apt install php-redis -y
- - php composer.phar global require hirak/prestissimo
- - php composer.phar install --no-ansi --no-interaction --no-progress
- - php composer.phar dump-autoload
- - php artisan config:clear && php artisan view:clear && php artisan route:clear && php artisan cache:clear && php artisan config:cache
- - php artisan migrate --force
- - php artisan db:seed --force
- - ./vendor/bin/paratest -p4 --coverage-text
- coverage: '/^\s*Lines:\s*\d+.\d+\%/'
- artifacts:
- when: on_failure
- name: "${CI_BUILD_STAGE}_${CI_BUILD_REF_NAME}_FAILED"
- paths:
- - "storage/logs/laravel.log"
- untracked: false
- expire_in: 1 day
- deploy_job_stage:
- stage: deploy-stage
- script:
- - ssh-add <(echo "$SSH_PRIVATE_KEY_STAGE")
- - scp -rp -P 9222 deploy_back_stage.sh gitlab@stage-back.dron.digital:~
- - ssh -p 9222 gitlab@stage-back.dron.digital "cd ~ && sh deploy_back_stage.sh"
- only:
- - master
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement