-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
44 lines (42 loc) · 1.48 KB
/
.gitlab-ci.yml
File metadata and controls
44 lines (42 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
stages:
- test
- build
typos:
image: python:alpine
stage: test
tags:
- docker
script:
- pip install typos typos-gitlab-code-quality
# "|| true" is used for preventing job fail when typos find errors
- typos --format json > typos-report.json || true
- typos-gitlab-code-quality < typos-report.json > codequality.json
artifacts:
when: always
reports:
codequality: codequality.json
build:
stage: build
image: quay.io/buildah/stable
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
variables:
# Use vfs with buildah. Docker offers overlayfs as a default, but Buildah
# cannot stack overlayfs on top of another overlayfs filesystem.
STORAGE_DRIVER: vfs
# Write all image metadata in the docker format, not the standard OCI format.
# Newer versions of docker can handle the OCI format, but older versions, like
# the one shipped with Fedora 30, cannot handle the format.
BUILDAH_FORMAT: docker
#FQ_IMAGE_NAME: "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA"
FQ_IMAGE_NAME: "$CI_REGISTRY_IMAGE:latest"
before_script:
# GitLab container registry credentials taken from the
# [predefined CI/CD variables](../variables/_index.md#predefined-cicd-variables)
# to authenticate to the registry.
- echo "$CI_REGISTRY_PASSWORD" | buildah login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY
script:
- buildah images
- buildah build -t $FQ_IMAGE_NAME
- buildah images
- buildah push $FQ_IMAGE_NAME