Skip to content

Commit fb41255

Browse files
authored
Add --args to ctf challenge deploy for extra docker run arguments
1 parent d6e8338 commit fb41255

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ctfcli/cli/challenges.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ def lint(self, challenge=None):
296296

297297
lint_challenge(path)
298298

299-
def deploy(self, challenge, host=None):
299+
def deploy(self, challenge, host=None, args=None):
300300
if challenge is None:
301301
challenge = os.getcwd()
302302

@@ -330,7 +330,7 @@ def deploy(self, challenge, host=None):
330330
return
331331

332332
status, domain, port = DEPLOY_HANDLERS[url.scheme](
333-
challenge=challenge, host=target_host
333+
challenge=challenge, host=target_host, args=args
334334
)
335335

336336
if status:

ctfcli/utils/deploy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from ctfcli.utils.images import build_image, export_image, get_exposed_ports
77

88

9-
def ssh(challenge, host):
9+
def ssh(challenge, host, args):
1010
# Build image
1111
image_name = build_image(challenge=challenge)
1212
print(f"Built {image_name}")
@@ -31,7 +31,7 @@ def ssh(challenge, host):
3131
[
3232
"ssh",
3333
host.netloc,
34-
f"docker run -d -p{exposed_port}:{exposed_port} --name {image_name} --restart always {image_name}",
34+
f"docker run -d -p{exposed_port}:{exposed_port} --name {image_name} --restart always {image_name}{' '+args if args else ''}",
3535
]
3636
)
3737

0 commit comments

Comments
 (0)