Skip to content
This repository was archived by the owner on Jul 19, 2024. It is now read-only.

Commit a037a2c

Browse files
authored
Fix scripts
1 parent c650673 commit a037a2c

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

scripts/pr_run.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ def get_args():
1212

1313
if __name__ == "__main__":
1414
args = get_args()
15-
_, org, repo = args.repo_url.rsplit('/', 2)
15+
org, repo = args.repo_url.remove_prefix('https://github.com/').rsplit('/', 1)
1616
pr_num = re.match("^refs/pull/(?P<pr_num>\d+)", args.git_ref).group('pr_num')
17+
Popen(['docker', 'rm', '-f', f'pkff_dev__{repo}__pr-{pr_num}']).communicate()
1718
Popen([
1819
'docker', 'run',
1920
'--rm', '--detach',
2021
'--network', 'web',
21-
'--name', f'pkff_dev__{repo}__pr{pr_num}',
22-
f'ghcr.io/{org}/{repo}:latest'
22+
'--name', f'pkff_dev__{repo}__pr-{pr_num}',
23+
f'ghcr.io/{org}/{repo}:pr-{pr_num}'
2324
]).communicate()

scripts/pr_stop.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ def get_args():
1212

1313
if __name__ == "__main__":
1414
args = get_args()
15-
_, org, repo = args.repo_url.rsplit('/', 2)
15+
org, repo = args.repo_url.remove_prefix('https://github.com/').rsplit('/', 1)
1616
pr_num = re.match("^refs/pull/(?P<pr_num>\d+)", args.git_ref).group('pr_num')
17-
Popen(['docker', 'rm', '-f', f'pkff_dev__{repo}__pr{pr_num}']).communicate()
17+
Popen(['docker', 'rm', '-f', f'pkff_dev__{repo}__pr-{pr_num}']).communicate()

0 commit comments

Comments
 (0)