Skip to content

Commit

Permalink
cli: fix cluster-deploy
Browse files Browse the repository at this point in the history
* Updates and installs modules whenever the cluster is redeployed
  in debug mode as new code might come in.

* Removes python-install-eggs from cluster-build as the build only
  needs the submodule sources.
  • Loading branch information
Diego Rodriguez committed Sep 21, 2020
1 parent affd423 commit 522d1ab
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions reana/reana_dev/cluster.py
Expand Up @@ -192,8 +192,6 @@ def cluster_build(
# initalise common submodules
if mode in ("latest", "debug"):
cmds.append("reana-dev git-submodule --update")
if mode in ("debug"):
cmds.append("reana-dev python-install-eggs")
# build Docker images
cmd = "reana-dev docker-build"
if exclude_components:
Expand Down Expand Up @@ -319,15 +317,21 @@ def job_mounts_to_config(job_mounts):
helm_install = "cat <<EOF | helm install reana helm/reana -n {namespace} --create-namespace --wait -f -\n{values}\nEOF".format(
namespace=namespace, values=values_dict and yaml.dump(values_dict) or "",
)
cmds = [
"helm dep update helm/reana",
helm_install,
"kubectl config set-context --current --namespace={}".format(namespace),
os.path.join(
get_srcdir("reana"),
f"scripts/create-admin-user.sh {instance_name} {admin_email} {admin_password}",
),
]
cmds = []
if mode in ("debug"):
cmds.append("reana-dev python-install-eggs")
cmds.append("reana-dev git-submodule --update")
cmds.extend(
[
"helm dep update helm/reana",
helm_install,
"kubectl config set-context --current --namespace={}".format(namespace),
os.path.join(
get_srcdir("reana"),
f"scripts/create-admin-user.sh {instance_name} {admin_email} {admin_password}",
),
]
)
for cmd in cmds:
run_command(cmd, "reana")

Expand Down

0 comments on commit 522d1ab

Please sign in to comment.