-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gitlab-ci to create container image for usage in gitlab-ci
See: https://docs.gitlab.com/ee/ci/testing/code_quality.html#required-images Signed-off-by: Matthias Blümel <[email protected]>
- Loading branch information
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |