1
0
Fork 0
This repository has been archived on 2025-09-02. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
mareshq-internal-static-sites/sites/ant.k8s.vxm.cz/ci/gitlab-commit.py

30 lines
692 B
Python

#!/usr/bin/env python3
import requests
import os
import sys
pushToken = os.getenv("CI_PUSH_TOKEN")
image = os.getenv("IMAGE")
imageTag = os.getenv("IMAGE_TAG")
r = requests.put(
"https://gitlab.mareshq.com/api/v4/projects/60/repository/files/signpost%2Fvalues%2Eyaml",
data={
"branch": "main",
"author_email": "ci@gitlab.mareshq.com",
"author_name": "GitLab CI [bot]",
"content": f"image: {image}:{imageTag}",
"commit_message": f"[auto] build(signpost): update image to {image}:{imageTag}"
},
headers={
"PRIVATE-TOKEN": pushToken
}
)
print(r.status_code, r.reason)
if r.status_code != 200:
sys.exit(1)
sys.exit(0)