Skip to content

Commit 14f7347

Browse files
authored
Merge pull request Place1#133 from DasSkelett/fix/helm-exit
2 parents 54d4b88 + f2b5cc8 commit 14f7347

File tree

1 file changed

+25
-11
lines changed

1 file changed

+25
-11
lines changed

scripts/update-helm.py

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,30 @@
2323
yaml.dump(chart, f, default_flow_style=False)
2424
f.truncate()
2525
with open('deploy/k8s/quickstart.yaml', 'w') as f:
26-
subprocess.run(['helm', 'template', '--name-template',
27-
'quickstart', 'deploy/helm/wg-access-server/'], stdout=f)
28-
subprocess.run(['helm', 'package', 'deploy/helm/wg-access-server/',
29-
'--destination', 'docs/charts/'])
30-
subprocess.run(['helm', 'repo', 'index', 'docs/', '--url',
31-
'https://freie-netze.org/wg-access-server'])
26+
try:
27+
subprocess.run(['helm', 'template', '--name-template',
28+
'quickstart', 'deploy/helm/wg-access-server/'],
29+
stdout=f, check=True)
30+
except subprocess.CalledProcessError as ex:
31+
print("::error::{}".format(ex))
32+
exit(1)
3233

33-
# commit changes
34-
subprocess.run(['git', 'add', 'docs/index.yaml', 'docs/charts/', 'deploy/helm/', 'deploy/k8s/'])
35-
subprocess.run(['git', 'commit', '-m', f'{version} - Automated Helm & k8s update'])
34+
try:
35+
subprocess.run(['helm', 'package', 'deploy/helm/wg-access-server/',
36+
'--destination', 'docs/charts/'],
37+
check=True, capture_output=True)
38+
subprocess.run(['helm', 'repo', 'index', 'docs/', '--url',
39+
'https://freie-netze.org/wg-access-server'],
40+
check=True, capture_output=True)
3641

37-
# push everything
38-
subprocess.run(['git', 'push'])
42+
# commit changes
43+
subprocess.run(['git', 'add', 'docs/index.yaml', 'docs/charts/', 'deploy/helm/', 'deploy/k8s/'],
44+
check=True, capture_output=True)
45+
subprocess.run(['git', 'commit', '-m', f'{version} - Automated Helm & k8s update'],
46+
check=True, capture_output=True)
47+
48+
# push everything
49+
subprocess.run(['git', 'push'], check=True, capture_output=True)
50+
except subprocess.CalledProcessError as ex:
51+
print("::error::{}\nStdout:\n{}\nStderr:\n{}".format(ex, ex.stdout.decode('utf-8'), ex.stderr.decode('utf-8')))
52+
exit(1)

0 commit comments

Comments
 (0)