Skip to content

Commit

Permalink
feat: update infra following docker update
Browse files Browse the repository at this point in the history
  • Loading branch information
kevbarns committed Apr 29, 2024
1 parent 63600ca commit da5f8ad
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 10 deletions.
8 changes: 1 addition & 7 deletions .infra/ansible/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,10 @@
tasks:
- include_tasks: ./tasks/files_copy.yml

- name: Création du docker-compose.yml {{env_type}}
shell:
chdir: /opt/app
cmd: 'sudo docker compose $(for file in $(ls docker-compose.*.yml); do echo -n "-f $file "; done) config -o docker-compose.yml'
register: docker_deploy_output

- name: Récupération des images docker
shell:
chdir: /opt/app
cmd: "sudo docker compose pull"
cmd: "/opt/app/tools/docker-compose.sh pull"

- name: Récupération du status de la stack
shell:
Expand Down
2 changes: 1 addition & 1 deletion .infra/files/scripts/cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
set -euo pipefail
#Needs to be run as sudo

docker compose run --rm --no-deps server yarn cli "$@"
/opt/app/tools/docker-compose.sh run --rm --no-deps server yarn cli "$@"
2 changes: 1 addition & 1 deletion .infra/files/scripts/migrations-status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
set -euo pipefail
#Needs to be run as sudo

docker compose run --rm --no-deps server yarn cli migrations:status
/opt/app/tools/docker-compose.sh run --rm --no-deps server yarn cli migrations:status
2 changes: 1 addition & 1 deletion .infra/files/scripts/migrations-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fi

run_migrations(){
echo "Application des migrations ..."
docker compose run --rm --no-deps server yarn cli migrations:up 2>&1 | tee "$LOG_FILEPATH"
/opt/app/tools/docker-compose.sh run --rm --no-deps server yarn cli migrations:up 2>&1 | tee "$LOG_FILEPATH"
}

run_migrations
17 changes: 17 additions & 0 deletions .infra/files/scripts/trigger_indexes_creation.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -euo pipefail
#Needs to be run as sudo

readonly LOG_DIR="/var/log/data-jobs"

if [ ! -d "$LOG_DIR" ]; then
sudo mkdir -p "$LOG_DIR"
sudo chown $(whoami):$(whoami) "$LOG_DIR"
fi

trigger_indexes_creation(){
echo "Création des index mongoDb ..."
/opt/app/tools/docker-compose.sh run --rm --no-deps server yarn cli indexes:recreate --queued
}

trigger_indexes_creation

0 comments on commit da5f8ad

Please sign in to comment.