Skip to content

Commit 5b6f2aa

Browse files
committed
Simplify release tasks
1 parent 3eca112 commit 5b6f2aa

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

tasks/release.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,20 @@
2525

2626
- when: deploy_type == "upgrade"
2727
name: get app version
28-
command: bash -lc 'mix run -e \'IO.puts Mix.Project.config[:version]\'' chdir="{{ project_path }}"
28+
command: bash -lc "mix run -e 'IO.puts Mix.Project.config[:version]'" chdir="{{ project_path }}"
29+
remote_user: "{{ deployer }}"
2930
register: app_version
3031

3132

33+
- when: deploy_type == "upgrade"
34+
name: set upgrade command
35+
set_fact: upgrade_command='rel/{{ app_name }}/bin/{{ app_name }} upgrade "{{ app_version.stdout }}"'
36+
37+
3238
- when: deploy_type == "upgrade"
3339
name: upgrade app
34-
command: bash -lc 'PORT={{ app_port}} rel/{{ app_name }}/bin/{{ app_name }} upgrade "{{ app_version.stdout }}"' chdir="{{ project_path }}"
40+
command: bash -lc "{{ upgrade_command }}" chdir="{{ project_path }}"
3541
remote_user: "{{ deployer }}"
3642
environment:
3743
MIX_ENV: "{{ mix_env }}"
44+
PORT: "{{ app_port }}"

0 commit comments

Comments
 (0)