Skip to content

Commit

Permalink
Change: no longer force recreate on compose deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
igobranco committed Mar 22, 2023
1 parent 3228d35 commit 4221a6d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ So if you need to use the docker-compose syntax > 2.0, you need to assign `true`

* `docker_deploy_shell_start_default` - by default uses the command
`docker-compose pull && docker-compose build && docker-compose up -d` that pull's, build's and
startup the compose. By default a `--force-recreate` parameter is added if any file, template or git
repository has changed. You can replace that additional parameter if you override the
startup the compose.
If you want to `--force-recreate` if any file, template or git
repository has changed. You can should add `--force-recreate` to the
`docker_deploy_shell_start_default_additional_parameters_if_changed` ansible variable.
If you want to always add parameters to the docker-compose command you should use the
`docker_deploy_shell_start_default_additional_parameters` ansible variable.

* `docker_deploy_force_restart` - to forcefully restart / recreate the containers
Expand Down
17 changes: 9 additions & 8 deletions tasks/docker_deploy_shell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@
shell: "{{ docker_deploy_shell_start if docker_deploy_shell_start is defined else (
docker_deploy_shell_start_default if docker_deploy_shell_start_default is defined else (
'docker-compose pull && docker-compose build && docker-compose up -d ' +
(docker_deploy_shell_start_default_additional_parameters | default (
'--force-recreate'
if (docker_deploy_force_restart | default(false)) or
(docker_compose_template_out is defined and docker_compose_template_out.changed) or
docker_deploy_files_out.changed or
docker_deploy_templates_out.changed or
docker_deploy_git_repositories_out.changed
else ''
(docker_deploy_shell_start_default_additional_parameters |
default (
(docker_deploy_shell_start_default_additional_parameters_if_changed | default(''))
if (docker_deploy_force_restart | default(false)) or
(docker_compose_template_out is defined and docker_compose_template_out.changed) or
docker_deploy_files_out.changed or
docker_deploy_templates_out.changed or
docker_deploy_git_repositories_out.changed
else ''
)
)
)
Expand Down

0 comments on commit 4221a6d

Please sign in to comment.