@@ -32,6 +32,15 @@ base64 --decode << END | sudo tee /usr/bin/tpi-task > /dev/null
32
32
END
33
33
chmod u=rwx,g=rx,a=rx /usr/bin/tpi-task
34
34
35
+ sudo tee /usr/bin/tpi-task-shutdown << 'END'
36
+ #!/bin/bash
37
+ if ! test -z "$CI"; then
38
+ cml rerun-workflow
39
+ fi
40
+ (systemctl is-system-running | grep stopping) || tpi --stop;
41
+ END
42
+ chmod u=rwx,g=rx,o=rx /usr/bin/tpi-task-shutdown
43
+
35
44
base64 --decode << END | sudo tee /tmp/tpi-environment > /dev/null
36
45
%s
37
46
END
@@ -47,7 +56,7 @@ sudo tee /etc/systemd/system/tpi-task.service > /dev/null <<END
47
56
[Service]
48
57
Type=simple
49
58
ExecStart=/usr/bin/tpi-task
50
- ExecStopPost=/bin/bash -c 'systemctl is-system-running | grep stopping || tpi --stop'
59
+ ExecStopPost=/usr/ bin/tpi-task-shutdown
51
60
Environment=HOME=/root
52
61
EnvironmentFile=/tmp/tpi-environment
53
62
WorkingDirectory=/tmp/tpi-task
@@ -61,6 +70,10 @@ sudo mv terraform-provider-iterative* /usr/bin/tpi
61
70
sudo chmod u=rwx,g=rx,o=rx /usr/bin/tpi
62
71
sudo chown root:root /usr/bin/tpi
63
72
73
+ curl --location --remote-name https://github.com/iterative/cml/releases/latest/download/cml-linux
74
+ chmod u=rwx,g=rx,o=rx cml-linux
75
+ sudo mv cml-linux /usr/bin/cml
76
+
64
77
extract_here(){
65
78
if command -v unzip 2>&1 > /dev/null; then
66
79
unzip "$1"
0 commit comments