mirror of
https://gitlab.sectorq.eu/jaydee/portainer.git
synced 2025-12-14 10:44:52 +01:00
build
This commit is contained in:
27
portainer.py
27
portainer.py
@@ -141,7 +141,7 @@ parser.add_argument("--gpu", "-g", action="store_true")
|
||||
parser.add_argument("--create-stacks", "-C", action="store_true")
|
||||
parser.add_argument("--refresh-status", "-r", action="store_true")
|
||||
|
||||
parser.add_argument("--stack", "-s", type=str, help="Stack ID for operations")
|
||||
parser.add_argument("--stack", "-s", type=str, nargs="+", help="Stack ID for operations")
|
||||
parser.add_argument(
|
||||
"--token-only", action="store_true", help="Print auth token and exit"
|
||||
)
|
||||
@@ -152,7 +152,6 @@ args = parser.parse_args()
|
||||
print("Running version:", VERSION)
|
||||
print("Environment:", args.site)
|
||||
|
||||
|
||||
if args.site is not None:
|
||||
cur_config["PORTAINER_SITE"] = args.site
|
||||
if args.endpoint_id is not None:
|
||||
@@ -272,12 +271,13 @@ def prompt_missing_args(args_in, defaults_in, fields):
|
||||
)
|
||||
try:
|
||||
if field == "stack":
|
||||
result = checkboxlist_dialog(
|
||||
commands_tuples = [(cmd, cmd) for cmd in commands]
|
||||
value_in = checkboxlist_dialog(
|
||||
title="Select Services",
|
||||
text="Choose one or more services:",
|
||||
values=commands,
|
||||
values=commands_tuples,
|
||||
).run()
|
||||
input(result)
|
||||
print(" >> Stacks :", ",".join(value_in))
|
||||
else:
|
||||
value_in = (
|
||||
prompt(
|
||||
@@ -316,9 +316,14 @@ def prompt_missing_args(args_in, defaults_in, fields):
|
||||
print("Value entered:", value_in)
|
||||
defaults_in[f"PORTAINER_{field}".upper()] = value_in
|
||||
setattr(args, field, value_in)
|
||||
os.environ[field] = value_in
|
||||
|
||||
if field == "site" and value_in != cur_site:
|
||||
por.get_site(value_in)
|
||||
|
||||
if field == "stack" and value_in != cur_site:
|
||||
os.environ[field] = ",".join(value_in)
|
||||
else:
|
||||
os.environ[field] = value_in
|
||||
if por._debug:
|
||||
print(f"{defaults_in} {field} {value_in}")
|
||||
if field == "endpoint_id" and value_in != defaults_in.get(
|
||||
@@ -375,8 +380,14 @@ if __name__ == "__main__":
|
||||
if args.debug:
|
||||
por._debug = True
|
||||
if args.action == "secrets":
|
||||
if args.endpoint_id is None:
|
||||
args.endpoint_id = input("Endpoint ID is required for creating secrets : ")
|
||||
args = prompt_missing_args(
|
||||
args,
|
||||
cur_config,
|
||||
[
|
||||
("site", "Site"),
|
||||
("endpoint_id", "Endpoint ID"),
|
||||
],
|
||||
)
|
||||
|
||||
secrets = {
|
||||
"gitea_runner_registration_token": "8nmKqJhkvYwltmNfF2o9vs0tzo70ufHSQpVg6ymb",
|
||||
|
||||
Reference in New Issue
Block a user