diff --git a/sites/ant.k8s.vxm.cz/.gitlab-ci.yml b/sites/ant.k8s.vxm.cz/.gitlab-ci.yml index 355cfc7..75245a2 100644 --- a/sites/ant.k8s.vxm.cz/.gitlab-ci.yml +++ b/sites/ant.k8s.vxm.cz/.gitlab-ci.yml @@ -19,11 +19,12 @@ build: deploy: stage: deploy - image: sikalabs/ci - variables: - GIT_STRATEGY: none - environment: - name: production - url: https://ant.k8s.vxm.cz + image: python:latest + before_script: + - python --version + - pip install virtualenv + - virtualenv venv + - source venv/bin/activate script: - - 'curl --request PUT --header "PRIVATE-TOKEN: ${CI_PUSH_TOKEN}" --header "Content-Type: application/json" --data "{"branch": "main", "author_email": "ci@gitlab.mareshq.com", "author_name": "GitLab CI [bot]", "content": "image: ${IMAGE}:${IMAGE_TAG}", "commit_message": "[auto] build(signpost): update image to $IMAGE:$IMAGE_TAG"}" "https://gitlab.mareshq.com/api/v4/projects/60/repository/files/signpost%2Fvalues%2Eyaml"' + - pip install requests + - python ci/gitlab-commit.py diff --git a/sites/ant.k8s.vxm.cz/ci/gitlab-commit.py b/sites/ant.k8s.vxm.cz/ci/gitlab-commit.py new file mode 100644 index 0000000..d8e0599 --- /dev/null +++ b/sites/ant.k8s.vxm.cz/ci/gitlab-commit.py @@ -0,0 +1,25 @@ +#!/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)