Skip to content

Commit 7499b7f

Browse files
committed
Install Python 3 packages before running bootstrap script
1 parent 8aacaee commit 7499b7f

1 file changed

Lines changed: 29 additions & 27 deletions

File tree

actions/workflows/st2_pkg_e2e_test.yaml

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,40 @@ tasks:
9999
publish:
100100
- vm_info: <% result().output.vm_info %>
101101
- vm_id: <% result().output.vm_info.id %>
102-
do: get_bootstrap_script
102+
do: check_for_ubuntu_xenial
103103
- when: <% failed() %>
104104
publish:
105105
- vm_id: <% result().output.get("vm_info", {}).get("id") %>
106106
- failed: True
107107
do: cleanup
108+
check_for_ubuntu_xenial:
109+
action: core.remote
110+
input:
111+
hosts: <% ctx().vm_info.private_ip_address %>
112+
cmd: cat /etc/issue
113+
next:
114+
- when: <% succeeded() and "Ubuntu 16" in result().get(ctx().vm_info.private_ip_address).stdout %>
115+
do: add_deadsnakes_ppa
116+
- when: <% succeeded() and not "Ubuntu 16" in result().get(ctx().vm_info.private_ip_address).stdout %>
117+
do: get_bootstrap_script
118+
- when: <% failed() %>
119+
do: check_debug_mode
120+
add_deadsnakes_ppa:
121+
action: core.remote_sudo
122+
input:
123+
hosts: <% ctx().vm_info.private_ip_address %>
124+
cmd: |-
125+
python3 --version
126+
add-apt-repository ppa:deadsnakes/ppa --yes
127+
apt-get update
128+
apt-get install --yes python3.6
129+
patch /etc/st2/st2.conf <<EOF
130+
23a24
131+
> python3_binary = /usr/bin/python3.6
132+
EOF
133+
next:
134+
- when: <% succeeded() %>
135+
do: get_bootstrap_script
108136
get_bootstrap_script:
109137
action: core.remote_sudo
110138
input:
@@ -156,32 +184,6 @@ tasks:
156184
input:
157185
hosts: <% ctx().vm_info.private_ip_address %>
158186
timeout: 600
159-
next:
160-
- when: <% succeeded() %>
161-
do: check_for_ubuntu_xenial
162-
check_for_ubuntu_xenial:
163-
action: core.remote
164-
input:
165-
hosts: <% ctx().vm_info.private_ip_address %>
166-
cmd: grep 'Ubuntu 16' /etc/issue
167-
next:
168-
- when: <% succeeded() %>
169-
do: install_python36
170-
- when: <% failed() %>
171-
do: check_debug_mode
172-
install_python36:
173-
action: core.remote_sudo
174-
input:
175-
hosts: <% ctx().vm_info.private_ip_address %>
176-
cmd: |-
177-
python3 --version
178-
add-apt-repository ppa:deadsnakes/ppa --yes
179-
apt-get update
180-
apt-get install --yes python3.6
181-
patch /etc/st2/st2.conf <<EOF
182-
23a24
183-
> python3_binary = /usr/bin/python3.6
184-
EOF
185187
next:
186188
- when: <% succeeded() %>
187189
do: check_debug_mode

0 commit comments

Comments
 (0)