ci(ant.k8s.vxm.cz): clean up python
This commit is contained in:
parent
8c49f9dba2
commit
72eae66e18
2 changed files with 20 additions and 12 deletions
|
|
@ -11,3 +11,6 @@ max_line_length = null
|
||||||
|
|
||||||
[Makefile]
|
[Makefile]
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
|
|
||||||
|
[*.py]
|
||||||
|
indent_size = 4
|
||||||
|
|
|
||||||
|
|
@ -2,24 +2,29 @@
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
import os
|
import os
|
||||||
# import sys
|
import sys
|
||||||
|
|
||||||
pushToken = os.getenv("CI_PUSH_TOKEN")
|
pushToken = os.getenv("CI_PUSH_TOKEN")
|
||||||
image = os.getenv("IMAGE")
|
image = os.getenv("IMAGE")
|
||||||
imageTag = os.getenv("IMAGE_TAG")
|
imageTag = os.getenv("IMAGE_TAG")
|
||||||
|
|
||||||
r = requests.put(
|
r = requests.put(
|
||||||
"https://gitlab.mareshq.com/api/v4/projects/60/repository/files/signpost%2Fvalues%2Eyaml",
|
"https://gitlab.mareshq.com/api/v4/projects/60/repository/files/signpost%2Fvalues%2Eyaml",
|
||||||
data={
|
data={
|
||||||
"branch": "main",
|
"branch": "main",
|
||||||
"author_email": "ci@gitlab.mareshq.com",
|
"author_email": "ci@gitlab.mareshq.com",
|
||||||
"author_name": "GitLab CI [bot]",
|
"author_name": "GitLab CI [bot]",
|
||||||
"content": f"image: {image}:{imageTag}",
|
"content": f"image: {image}:{imageTag}",
|
||||||
"commit_message": f"[auto] build(signpost): update image to {image}:{imageTag}"
|
"commit_message": f"[auto] build(signpost): update image to {image}:{imageTag}"
|
||||||
},
|
},
|
||||||
headers={
|
headers={
|
||||||
"PRIVATE-TOKEN": pushToken
|
"PRIVATE-TOKEN": pushToken
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
print(r.status_code, r.reason)
|
print(r.status_code, r.reason)
|
||||||
|
|
||||||
|
if r.status_code != 200:
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
sys.exit(0)
|
||||||
|
|
|
||||||
Reference in a new issue