Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.39 KB | None | 0 0
  1.  
  2.  
  3. stages:
  4.  - test
  5.   - deploy
  6. unit_test:
  7.   image: tholum/slim_fullstack:latest
  8.   stage: test
  9.   before_script:
  10.    - /etc/init.d/mysql start
  11.     - cp /scripts/files/* class/
  12.   script:
  13.    - /usr/bin/phpunit --coverage-text --colors=never
  14.   after_script:
  15.    - /etc/init.d/mysql stop
  16.  
  17. deploy_review:
  18.   image: tholum/ansiblerunner
  19.   stage: deploy
  20.   before_script:
  21.    - mkdir -p /root/.ssh
  22.     - echo "$SSH_PRIVATE_KEY" > /root/.ssh/id_rsa
  23.     - echo "$SSH_PUBLIC_KEY" > /root/.ssh/id_rsa.pub
  24.     - echo "Host *" > /root/.ssh/config
  25.     - echo "  StrictHostKeyChecking no" >> /root/.ssh/config
  26.     - chmod -R 600 /root/.ssh
  27.    
  28.   script:
  29.    - cd /opt
  30.     - git clone <My Ansible Repo>
  31.    - cd ansible
  32.     - echo "<Some Host> slim_branch=review slim_path=/var/www/html" > hosts-reviews
  33.     - ansible-playbook -i hosts-reviews deployReview.yml
  34.   only:
  35.    - review
  36.  
  37. deploy_master:
  38.   image: tholum/ansiblerunner
  39.   stage: deploy
  40.   before_script:
  41.    - mkdir -p /root/.ssh
  42.     - echo "$SSH_PRIVATE_KEY" > /root/.ssh/id_rsa
  43.     - echo "$SSH_PUBLIC_KEY" > /root/.ssh/id_rsa.pub
  44.     - echo "Host *" > /root/.ssh/config
  45.     - echo "  StrictHostKeyChecking no" >> /root/.ssh/config
  46.     - chmod -R 600 /root/.ssh
  47.  
  48.   script:
  49.    - cd /opt
  50.     - git clone <My Ansible Repo>
  51.    - cd ansible
  52.     - ansible-playbook -i hosts-production-servers deployMaster.yml
  53.   only:
  54.    - master
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement