Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stages:
- - build
- - test
- - deploy
- variables:
- MYSQL_DATABASE: test
- MYSQL_USERNAME: root
- MYSQL_ROOT_PASSWORD: root
- build:
- stage: build
- image: node
- script:
- - npm install
- - npm run production
- cache:
- paths:
- - ./node_modules
- artifacts:
- expire_in: 1 hour
- paths:
- - public/css
- - public/js
- only:
- - master
- test:
- stage: test
- image: thecodingmachine/php:7.2-v1-fpm
- services:
- - mysql:5.7
- script:
- - composer install
- - cp .env.example .env
- - php artisan key:generate
- - php artisan migrate
- - php artisan db:seed
- - php vendor/bin/phpunit
- cache:
- paths:
- - ./node_modules
- - ./vendor
- only:
- - master
- deploy:
- stage: deploy
- image: node
- dependencies:
- - build
- before_script:
- - 'which ssh-agent || ( apk add --update openssh-client rsync bash )'
- - eval $(ssh-agent -s)
- - bash -c "ssh-add <(echo '$SERVER_SSH_KEY')"
- - mkdir -p ~/.ssh
- - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- script:
- - ssh root@92.222.90.200 "cd /home/ubuntu/iim-avatar/ && git pull origin master"
- - scp -rp ./public/css/ root@92.222.90.200:/home/ubuntu/iim-avatar/public/
- - scp -rp ./public/js/ root@92.222.90.200:/home/ubuntu/iim-avatar/public/
- - ssh root@92.222.90.200 "docker restart iim-avatar"
- only:
- - master
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement