diff --git a/.infra/ansible/galaxy-requirements.yml b/.infra/ansible/galaxy-requirements.yml new file mode 100644 index 000000000..bfa74108b --- /dev/null +++ b/.infra/ansible/galaxy-requirements.yml @@ -0,0 +1,2 @@ +collections: + - name: community.docker diff --git a/.infra/ansible/roles/deploy/tasks/main.yml b/.infra/ansible/roles/deploy/tasks/main.yml index 02174545e..f1183f7d3 100644 --- a/.infra/ansible/roles/deploy/tasks/main.yml +++ b/.infra/ansible/roles/deploy/tasks/main.yml @@ -1,4 +1,5 @@ - name: "Clone du repository (branche : {{ git_revision }})" + become: yes git: repo: "https://github.com/mission-apprentissage/tjp-pilotage.git" version: "{{ git_revision }}" @@ -17,7 +18,7 @@ - name: Create and start services become: yes community.docker.docker_compose: - project_src: "{{ REPO_DIR }}" + project_src: /opt/pilotage/repository build: true restarted: true files: diff --git a/.infra/scripts/deploy-app.sh b/.infra/scripts/deploy-app.sh index 572326dec..7220a5ad8 100644 --- a/.infra/scripts/deploy-app.sh +++ b/.infra/scripts/deploy-app.sh @@ -7,5 +7,6 @@ shift echo "Déploiement sur l'(es) environnement(s) ${ENV_FILTER}..." cd "${ANSIBLE_DIR}" +ansible-galaxy collection install --requirements-file galaxy-requirements.yml ansible-playbook -i env.ini --limit "${ENV_FILTER}" deploy.yml "$@" cd -