Commit 1b5b0ea4 authored by Robin Fischer's avatar Robin Fischer

Add correct request and parameters

parent 2a9e04d2
......@@ -3,11 +3,32 @@
import sys
import os
import requests
import argparse
parser = argparse.ArgumentParser()
url = ''
parser.add_argument("domain", help="Specify the domain which should be set")
parser.add_argument("projectId", help="The id of the gitlab probject to update")
args = parser.parse_args()
with open(args.publicKeyFile, "r") as file:
publicKey =
with open(args.privateKeyFile, "r") as file:
privateKey =
url = "" + args.projectId + "/pages/domains/" + args.domain
headers = {"PRIVATE-TOKEN": os.environ["PRIVATE_TOKEN"]}
r = requests.get(url, headers=headers)
payload = { "certificate": publicKey, "key": privateKey }
r = requests.put(url, headers=headers, data=payload)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment