Skip to content
Snippets Groups Projects
Commit 167c0b87 authored by Dylan Aïssi's avatar Dylan Aïssi
Browse files

gitlab-cancel-outdated-pipelines: makes arguments mandatory

parent 0f85e25a
No related branches found
No related tags found
1 merge request!90gitlab-cancel-outdated-pipelines: small fixes
......@@ -17,16 +17,24 @@ STATUS_ACTIVE = ["created", "waiting_for_resource", "preparing", "pending", "run
if __name__ == "__main__":
parser = argparse.ArgumentParser(prog="gitlab-cancel-outdated-pipelines")
parser.add_argument("--gitlab-server-url", type=str, help="the GitLab server url")
parser.add_argument("--gitlab-api-token", type=str, help="the GitLab API token")
parser.add_argument("--project-id", type=str, help="the GitLab project ID")
parser.add_argument(
"--current-pipeline-id", type=str, help="the current pipeline ID"
"--gitlab-server-url", required=True, type=str, help="the GitLab server url"
)
parser.add_argument(
"--gitlab-api-token", required=True, type=str, help="the GitLab API token"
)
parser.add_argument(
"--project-id", required=True, type=str, help="the GitLab project ID"
)
parser.add_argument(
"--current-pipeline-id", required=True, type=str, help="the current pipeline ID"
)
parser.add_argument(
"--current-branch", required=True, type=str, help="the current branch"
)
parser.add_argument("--current-branch", type=str, help="the current branch")
args = parser.parse_args()
gl = gitlab.Gitlab(args.gitlab_server_url, args.gitlab_api_token)
gl = gitlab.Gitlab(url=args.gitlab_server_url, private_token=args.gitlab_api_token)
gl.auth()
print(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment