Skip to content

Commit

Permalink
gitlab-ci to create container image for usage in gitlab-ci
Browse files Browse the repository at this point in the history
See: https://docs.gitlab.com/ee/ci/testing/code_quality.html#required-images
Signed-off-by: Matthias Blümel <blaimi@blaimi.de>
  • Loading branch information
Blaimi committed May 25, 2023
1 parent 0c08691 commit 94b4d37
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
image-build:
image:
name: quay.io/buildah/stable:latest
stage: build
before_script:
- 'echo "$CI_REGISTRY_PASSWORD" | buildah login --username "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY'
script:
# more than two levels are forbidden -> using `-cache` instead of `/cache`
# https://docs.gitlab.com/ee/user/packages/container_registry/#naming-convention-for-your-container-images
- buildah bud
-f "Containerfile"
-t "$CI_REGISTRY_IMAGE/codeclimate/codeclimate-openapi:latest"
--layers
--cache-from=$CI_REGISTRY_IMAGE/codeclimate/codeclimate-openapi-cache
--cache-to=$CI_REGISTRY_IMAGE/codeclimate/codeclimate-openapi-cache
.
- buildah push "$CI_REGISTRY_IMAGE/codeclimate/codeclimate-openapi:latest"

copy-upstream:
stage: deploy
image:
name: quay.io/skopeo/stable:latest
entrypoint: [""]
before_script:
- 'echo "$CI_REGISTRY_PASSWORD" | skopeo login --username "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY'
script:
- 'skopeo copy "docker://docker.io/${image_name}" "docker://$CI_REGISTRY_IMAGE/${image_name}"'
parallel:
matrix:
- image_name:
- codeclimate/codeclimate:0.94.0
- codeclimate/codeclimate:0.96.0
- codeclimate/codeclimate:latest
- codeclimate/codeclimate-structure:latest
- codeclimate/codeclimate-csslint:latest
- codeclimate/codeclimate-coffeelint:latest
- codeclimate/codeclimate-duplication:latest
- codeclimate/codeclimate-eslint:latest
- codeclimate/codeclimate-fixme:latest
- codeclimate/codeclimate-rubocop:latest
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"

0 comments on commit 94b4d37

Please sign in to comment.