Skip to content

Commit

Permalink
Merge pull request #1468 from gsunner/1432-fix-release-script-for-exe…
Browse files Browse the repository at this point in the history
…cutor

fix release script for executor
  • Loading branch information
seldondev authored Feb 20, 2020
2 parents c09c055 + d994de5 commit d52e791
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion release.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def dict_to_yaml(d):


def yaml_to_dict(yaml_data):
return yaml.load(StringIO(yaml_data))
return yaml.load(StringIO(yaml_data), Loader=yaml.FullLoader)


def run_command(args, debug=False):
Expand Down Expand Up @@ -103,6 +103,7 @@ def update_operator_values_yaml_file(fpath, seldon_core_version, debug=False):
d = yaml_to_dict(yaml_data)
d["image"]["tag"] = seldon_core_version
d["engine"]["image"]["tag"] = seldon_core_version
d["executor"]["image"]["tag"] = seldon_core_version

with open(fpath, "w") as f:
f.write(dict_to_yaml(d))
Expand Down Expand Up @@ -134,6 +135,23 @@ def update_kustomize_engine_version(seldon_core_version, debug=False):
print("error updating kustomize".format(**locals()))
print(err)

def update_kustomize_executor_version(seldon_core_version, debug=False):
args = [
"sed",
"-i",
"s/seldonio\/seldon-core-executor:\(.*\)/seldonio\/seldon-core-executor:{seldon_core_version}/g".format(
**locals()
),
"operator/config/manager/manager.yaml",
]
err, out = run_command(args, debug)
# pp(out)
# pp(err)
if err == None:
print("updated kustomize".format(**locals()))
else:
print("error updating kustomize".format(**locals()))
print(err)

def update_operator_version(seldon_core_version, debug=False):
fpath = "operator/config/manager/kustomization.yaml"
Expand Down Expand Up @@ -171,6 +189,7 @@ def set_version(

# Update kustomize
update_kustomize_engine_version(seldon_core_version, debug)
update_kustomize_executor_version(seldon_core_version, debug)

# Update operator version
update_operator_version(seldon_core_version, debug)
Expand Down

0 comments on commit d52e791

Please sign in to comment.