forked from Banh-Canh/docker-FMD2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
31 lines (29 loc) · 1.02 KB
/
.gitlab-ci.yml
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
stages:
- test
- build
Dockerfile-linter:
stage: test
image: hadolint/hadolint:v2.4.1-alpine
script:
# Test Dockerfile Syntax for best practices...
# Ignoring apk add pin version warning because Alpine-Linux Package Management always drop older versions
- hadolint --ignore DL3018 --ignore DL4001 --ignore DL4006 Dockerfile
build:
stage: build
image: "registry.gitlab.com/gitlab-org/cluster-integration/auto-build-image:v0.4.0"
variables:
DOCKER_TLS_CERTDIR: ""
services:
- docker:19.03.12-dind
script:
- |
if [[ -z "$CI_COMMIT_TAG" ]]; then
export CI_APPLICATION_REPOSITORY=${CI_APPLICATION_REPOSITORY:-$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG}
export CI_APPLICATION_TAG=${CI_APPLICATION_TAG:-$CI_COMMIT_SHA}
else
export CI_APPLICATION_REPOSITORY=${CI_APPLICATION_REPOSITORY:-$CI_REGISTRY_IMAGE}
export CI_APPLICATION_TAG=${CI_APPLICATION_TAG:-$CI_COMMIT_TAG}
fi
- /build/build.sh
rules:
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH'