Skip to content

Commit

Permalink
feat(reana-dev): add --namespace option to run-ci command (#862)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiborsimko committed Jan 16, 2025
1 parent d9c375f commit 51c3a11
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (C) 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024 CERN.
Copyright (C) 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025 CERN.

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
11 changes: 8 additions & 3 deletions reana/reana_dev/run.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2020, 2021, 2022, 2023 CERN.
# Copyright (C) 2020, 2021, 2022, 2023, 2025 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
Expand Down Expand Up @@ -246,6 +246,9 @@ def run_commands():
type=click.IntRange(min=1),
help="Number of docker images to build in parallel.",
)
@click.option(
"--namespace", "-n", default="default", help="Kubernetes namespace [default]"
)
@run_commands.command(name="run-ci")
def run_ci(
build_arg,
Expand All @@ -260,6 +263,7 @@ def run_ci(
workflow_engine,
disable_default_cni,
parallel,
namespace,
): # noqa: D301
"""Run CI build.
Expand All @@ -284,6 +288,7 @@ def run_ci(
-c r-d-helloworld
--exclude-components=r-ui,r-a-krb5,r-a-rucio,r-a-vomsproxy
--mode debug
--namespace myreana
--admin-email [email protected]
--admin-password mysecretpassword
"""
Expand Down Expand Up @@ -324,7 +329,7 @@ def run_ci(
run_command(cmd, "reana")
# deploy cluster
cmd = (
f"reana-dev cluster-deploy --mode {mode}"
f"reana-dev cluster-deploy --mode {mode} --namespace {namespace}"
f" --admin-email {admin_email} --admin-password {admin_password}"
)
if exclude_components:
Expand All @@ -333,7 +338,7 @@ def run_ci(
cmd += " -j {}".format(job_mount)
run_command(cmd, "reana")
# run demo examples
cmd = "eval $(reana-dev client-setup-environment) && reana-dev run-example"
cmd = f"eval $(reana-dev client-setup-environment -n {namespace}) && reana-dev run-example"
for component in components:
cmd += " -c {}".format(component)
for a_workflow_engine in workflow_engine:
Expand Down

0 comments on commit 51c3a11

Please sign in to comment.