Skip to content
This repository was archived by the owner on Aug 4, 2023. It is now read-only.

Commit 703be80

Browse files
build gcip docker image with proper tagging
1 parent 325d322 commit 703be80

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

.gitlab-ci.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
python.isort(), python.flake8(), python.pytest(), python.evaluate_git_tag_pep404_conformity(),
1010
kaniko.execute(
1111
image_name="thomass/gcip",
12+
image_tag=(PredefinedVariables.CI_COMMIT_TAG[1:] if PredefinedVariables.CI_COMMIT_TAG else PredefinedVariables.CI_COMMIT_REF_SLUG),
1213
enable_push=(PredefinedVariables.CI_COMMIT_TAG or PredefinedVariables.CI_COMMIT_BRANCH == "main"),
1314
dockerhub_user_env_var="DOCKER_USER",
1415
dockerhub_login_env_var="DOCKER_LOGIN",

generated-config.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
stages:
2+
- lint
3+
- test
4+
- execute
5+
lint-isort:
6+
image:
7+
name: python:3.9-slim
8+
stage: lint
9+
script:
10+
- pip3 install --upgrade isort
11+
- isort --check .
12+
lint-flake8:
13+
image:
14+
name: python:3.9-slim
15+
stage: lint
16+
script:
17+
- pip3 install --upgrade flake8
18+
- flake8
19+
test-pytest:
20+
image:
21+
name: python:3.9-slim
22+
stage: test
23+
script:
24+
- pip3 install --upgrade -v -r requirements.txt
25+
- pytest
26+
test-evaluate-git-tag-pep404-conformity:
27+
image:
28+
name: thomass/gcip:0.3.0
29+
stage: test
30+
script:
31+
- python3 -m gcip.tools.evaluate_git_tag_pep404_conformity
32+
rules:
33+
- if: $CI_COMMIT_TAG
34+
when: on_success
35+
allow_failure: false
36+
execute-kaniko:
37+
image:
38+
name: gcr.io/kaniko-project/executor:debug
39+
entrypoint:
40+
- ''
41+
stage: execute
42+
script:
43+
- mkdir -p /kaniko/.docker && echo "{\"auths\":{\"https://index.docker.io/v1/\":{\"username\":\"$DOCKER_USER\",\"password\":\"$DOCKER_LOGIN\"}}}"
44+
> /kaniko/.docker/config.json
45+
- date
46+
- executor --no-push --destination thomass/gcip
47+
- rm -rf /kaniko/.docker/config.json

0 commit comments

Comments
 (0)