Skip to content

Commit 0dfc064

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

1 file changed

Lines changed: 28 additions & 27 deletions

File tree

actions/workflows/st2_pkg_e2e_test.yaml

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ vars:
3030
- vm_windows_id:
3131
- vm_fqdn: <% ctx().hostname %>.<% ctx().dns_zone %>
3232
- vm_info:
33+
- ubuntu_variant: ""
3334
- windows_hostname: <% ctx().hostname %>win
3435
- vm_windows_fqdn: <% ctx().hostname %>win.<% ctx().dns_zone %>
3536
- installed:
@@ -99,12 +100,38 @@ tasks:
99100
publish:
100101
- vm_info: <% result().output.vm_info %>
101102
- vm_id: <% result().output.vm_info.id %>
102-
do: get_bootstrap_script
103+
do: check_for_ubuntu_xenial
103104
- when: <% failed() %>
104105
publish:
105106
- vm_id: <% result().output.get("vm_info", {}).get("id") %>
106107
- failed: True
107108
do: cleanup
109+
check_for_ubuntu_xenial:
110+
action: core.remote
111+
input:
112+
hosts: <% ctx().vm_info.private_ip_address %>
113+
cmd: cat /etc/issue
114+
next:
115+
- when: <% succeeded() and "Ubuntu 16" in result().get(ctx().vm_info.private_ip_address).stdout %>
116+
publish:
117+
- ubuntu_variant: "Ubuntu 16"
118+
do: add_deadsnakes_ppa
119+
- when: <% succeeded() and not "Ubuntu 16" in result().get(ctx().vm_info.private_ip_address).stdout %>
120+
do: get_bootstrap_script
121+
- when: <% failed() %>
122+
do: check_debug_mode
123+
add_deadsnakes_ppa:
124+
action: core.remote_sudo
125+
input:
126+
hosts: <% ctx().vm_info.private_ip_address %>
127+
cmd: |-
128+
python3 --version
129+
add-apt-repository ppa:deadsnakes/ppa --yes
130+
apt-get update
131+
apt-get install --yes python3.6
132+
next:
133+
- when: <% succeeded() %>
134+
do: get_bootstrap_script
108135
get_bootstrap_script:
109136
action: core.remote_sudo
110137
input:
@@ -156,32 +183,6 @@ tasks:
156183
input:
157184
hosts: <% ctx().vm_info.private_ip_address %>
158185
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
185186
next:
186187
- when: <% succeeded() %>
187188
do: check_debug_mode

0 commit comments

Comments
 (0)