|
23 | 23 | yaml.dump(chart, f, default_flow_style=False)
|
24 | 24 | f.truncate()
|
25 | 25 | 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) |
32 | 33 |
|
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) |
36 | 41 |
|
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