Commit 3a6c9e1e authored by Ioan Vancea's avatar Ioan Vancea
Browse files

Updated CI to match the current, new infrastructure

parent cd404da9
Pipeline #25380 passed with stages
in 8 seconds
stages:
- Deploy On Testing
- Deploy On LB
- Deploy On ProductionSUSE
- Deployment staging
- Deployment production
Deploy Testing:
stage: Deploy On Testing
Staging:
stage: Deployment staging
script:
- pwd
- source /home/deploy/ansible-provision/ansible-venv/bin/activate
- cd deploy
- ansible-playbook -i hosts playbook-testing.yml
- echo "Deployed On Testing -> DONE"
- ansible-playbook -i hosts playbook-staging.yml
- echo "Deployed on enc-staging-nomad machine -> DONE"
- ls -al
- pwd
only:
- master
Deploy LB:
stage: Deploy On LB
Production:
stage: Deployment production
script:
- pwd
- source /home/deploy/ansible-provision/ansible-venv/bin/activate
- cd deploy
- ansible-playbook -i hosts playbook-lb-centos.yml
- echo "Deployed On LB -> DONE"
- ansible-playbook -i hosts playbook-production.yml
- echo "Deployed on production (enc-lb-nomad) machine -> DONE"
- ls -al
- pwd
only:
- master
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]
enc-testing-nomad.esc.rzg.mpg.de
[staging]
enc-staging-nomad.esc.rzg.mpg.de
[lb]
[production]
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:
project_root: /home/nomadapp/gui
project_repo: git@gitlab.mpcdf.mpg.de:nomad-lab/encyclopedia-gui.git
......
---
- hosts: testing
- hosts: staging
vars:
project_root: /home/nomadapp/gui
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