Commit a9379daf authored by Iker Hurtado's avatar Iker Hurtado
Browse files
parents 2760047d 3a6c9e1e
Pipeline #27193 passed with stages
in 6 seconds
stages: stages:
- Deploy On Testing - Deployment staging
- Deploy On LB - Deployment production
- Deploy On ProductionSUSE
Deploy Testing: Staging:
stage: Deploy On Testing stage: Deployment staging
script: script:
- pwd - pwd
- source /home/deploy/ansible-provision/ansible-venv/bin/activate - source /home/deploy/ansible-provision/ansible-venv/bin/activate
- cd deploy - cd deploy
- ansible-playbook -i hosts playbook-testing.yml - ansible-playbook -i hosts playbook-staging.yml
- echo "Deployed On Testing -> DONE" - echo "Deployed on enc-staging-nomad machine -> DONE"
- ls -al - ls -al
- pwd - pwd
only: only:
- master - master
Deploy LB: Production:
stage: Deploy On LB stage: Deployment production
script: script:
- pwd - pwd
- source /home/deploy/ansible-provision/ansible-venv/bin/activate - source /home/deploy/ansible-provision/ansible-venv/bin/activate
- cd deploy - cd deploy
- ansible-playbook -i hosts playbook-lb-centos.yml - ansible-playbook -i hosts playbook-production.yml
- echo "Deployed On LB -> DONE" - echo "Deployed on production (enc-lb-nomad) machine -> DONE"
- ls -al - ls -al
- pwd - pwd
only: only:
- master - master
when: manual when: manual
Deploy ProductionSUSE:
stage: Deploy On ProductionSUSE
script:
- pwd
- source /home/deploy/ansible-provision/ansible-venv/bin/activate
- cd deploy
- ansible-playbook -i hosts playbook-production-suse.yml
- echo "Deployed On Production SUSE -> DONE"
- ls -al
- pwd
when: manual
[testing] [staging]
enc-testing-nomad.esc.rzg.mpg.de enc-staging-nomad.esc.rzg.mpg.de
[lb] [production]
enc-lb-nomad.esc.rzg.mpg.de enc-lb-nomad.esc.rzg.mpg.de
[production-suse]
enc-production-nomad.esc.rzg.mpg.de
---
- hosts: production-suse
vars:
project_root: /home/nomadapp/gui
project_repo: git@gitlab.mpcdf.mpg.de:nomad-lab/encyclopedia-gui.git
project_cloned_dir: /home/deploy/encyclopedia-gui-repo-cloned
tasks:
- name: Pull sources from the repository
git: repo={{ project_repo }} dest={{ project_cloned_dir }}
- name: Copy only GUI source files from cloned repo to project directory
synchronize: src={{ project_cloned_dir }}/client/ dest={{ project_root}}/
delegate_to: "{{ inventory_hostname }}"
become: yes
- name: Change permissions for project directory
shell: chown -R nomadapp:users {{ project_root }}
become: yes
handlers:
- name: restart nginx
service: name=nginx state=restarted
become_user: root
- name: reload nginx
service: name=nginx state=reloaded
become_user: root
--- ---
- hosts: lb - hosts: production
vars: vars:
project_root: /home/nomadapp/gui project_root: /home/nomadapp/gui
project_repo: git@gitlab.mpcdf.mpg.de:nomad-lab/encyclopedia-gui.git project_repo: git@gitlab.mpcdf.mpg.de:nomad-lab/encyclopedia-gui.git
......
--- ---
- hosts: testing - hosts: staging
vars: vars:
project_root: /home/nomadapp/gui project_root: /home/nomadapp/gui
project_repo: git@gitlab.mpcdf.mpg.de:nomad-lab/encyclopedia-gui.git project_repo: git@gitlab.mpcdf.mpg.de:nomad-lab/encyclopedia-gui.git
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment