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

Commit

Permalink
build gcip docker image with proper tagging
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasSteinbach committed Mar 13, 2021
1 parent 325d322 commit 703be80
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitlab-ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
python.isort(), python.flake8(), python.pytest(), python.evaluate_git_tag_pep404_conformity(),
kaniko.execute(
image_name="thomass/gcip",
image_tag=(PredefinedVariables.CI_COMMIT_TAG[1:] if PredefinedVariables.CI_COMMIT_TAG else PredefinedVariables.CI_COMMIT_REF_SLUG),
enable_push=(PredefinedVariables.CI_COMMIT_TAG or PredefinedVariables.CI_COMMIT_BRANCH == "main"),
dockerhub_user_env_var="DOCKER_USER",
dockerhub_login_env_var="DOCKER_LOGIN",
Expand Down
47 changes: 47 additions & 0 deletions generated-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
stages:
- lint
- test
- execute
lint-isort:
image:
name: python:3.9-slim
stage: lint
script:
- pip3 install --upgrade isort
- isort --check .
lint-flake8:
image:
name: python:3.9-slim
stage: lint
script:
- pip3 install --upgrade flake8
- flake8
test-pytest:
image:
name: python:3.9-slim
stage: test
script:
- pip3 install --upgrade -v -r requirements.txt
- pytest
test-evaluate-git-tag-pep404-conformity:
image:
name: thomass/gcip:0.3.0
stage: test
script:
- python3 -m gcip.tools.evaluate_git_tag_pep404_conformity
rules:
- if: $CI_COMMIT_TAG
when: on_success
allow_failure: false
execute-kaniko:
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint:
- ''
stage: execute
script:
- mkdir -p /kaniko/.docker && echo "{\"auths\":{\"https://index.docker.io/v1/\":{\"username\":\"$DOCKER_USER\",\"password\":\"$DOCKER_LOGIN\"}}}"
> /kaniko/.docker/config.json
- date
- executor --no-push --destination thomass/gcip
- rm -rf /kaniko/.docker/config.json

0 comments on commit 703be80

Please sign in to comment.