Skip to content

Commit

Permalink
feat: lbac 2152: deploy upgrade following docker update (#1210)
Browse files Browse the repository at this point in the history
* feat: enable pe cert on production only

* feat: update infra following docker update
  • Loading branch information
kevbarns authored Apr 29, 2024
1 parent b4dc3af commit ebb6929
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 11 deletions.
10 changes: 2 additions & 8 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 Expand Up @@ -114,7 +108,7 @@
hour: "2"
weekday: "1"
job: "bash /opt/app/tools/ssl/renew-certificate.sh {{ alias_dns_name }} >> /var/log/cron.log 2>&1; /opt/app/tools/monitoring/export-cron-status-prom.sh -c 'Renew certificate Alias' -v $?"
when: env_type != "preview"
when: env_type == "production"

- name: "Setup de la Metabase"
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 ebb6929

Please sign in to comment.