Files
spring-tools/concourse/set-pipeline.py
Kris De Volder 83b61cfb42 Remove build-fatjars from concourse ci
We are not using thuis anymore so building it is a waste of time
and concourse compute resources.
2022-10-07 15:43:52 -07:00

26 lines
837 B
Python
Executable File

#!/usr/bin/python3
import os
def replace(infile, outfile, findword, replaceword):
with open(infile, "rt") as fin:
with open(outfile, "wt") as fout:
for line in fin:
fout.write(line.replace(findword, replaceword))
branch = os.popen("git rev-parse --abbrev-ref HEAD").read().strip()
if branch == 'main':
os.system('fly -t tools set-pipeline '+
' --var "branch=' + branch + '" ' +
' -p sts4-'+ branch +' -c pipeline.yml')
else:
fname = "pipeline-"+branch+".yml"
replace("pipeline.yml", "pipeline-"+branch+".yml", "snapshot", branch)
with open(fname, 'r') as fin:
print(fin.read())
cmd = ('fly -t tools set-pipeline ' +
'--var "branch=' + branch + '" ' + '-p sts4-' +branch+' -c '+fname)
print(cmd)
os.system(cmd)