diff --git a/trigger.py b/trigger.py index e690ea2..1983598 100644 --- a/trigger.py +++ b/trigger.py @@ -12,11 +12,12 @@ from requests import post from pathlib import Path # Environment variables for creds -base_repo_user = os.environ.get("BASE_REPO_USERNAME") -base_repo_pass = os.environ.get("BASE_REPO_PASSWORD") content_repo_git = os.environ.get("CONTENT_REPO_GIT") content_repo_id = os.environ.get("CONTENT_REPO_ID") gitlab_token = os.environ.get("GITLAB_TOKEN") +ssh_key = os.environ.get("SSH_SECRET_KEY") + +git_ssh_cmd = f"ssh -o StrictHostKeyChecking=no -i {ssh_key}" # Get the time and create a tag of epoch cwd = os.getcwd() @@ -32,11 +33,11 @@ except ValueError: pass repo.create_remote( "pushback", - f"https://{base_repo_user}:{base_repo_pass}@git.baalajimaestro.me/{content_repo_git}.git", + f"ssh://git@git.baalajimaestro.me:29999/{content_repo_git}.git", ) # Push the newly created tag -repo.git.push("pushback", "HEAD:prod", force=True) +repo.git.push("pushback", "HEAD:prod", force=True, env=dict(GIT_SSH_COMMAND=git_ssh_cmd)) # Trigger site rebuild data = {"token": gitlab_token, "ref": "source"}