-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.gitlab-ci.yml
84 lines (76 loc) · 2.15 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# use yaml anchor for the script as script cannot inherit
.buildScript: &buildScript
script:
- docker build
--target builder
--build-arg BUILD_DATE=$CI_COMMIT_TIMESTAMP
--build-arg BUILD_REPO=$DOCKER_ENV_CI_PROJECT_URL
--build-arg BUILD_REPO_REF=$CI_COMMIT_SHA
--build-arg BUILDKIT_INLINE_CACHE=1
--file "${DOCKERFILE}"
--tag "${BUILD_IMAGE}" .
- docker push "${BUILD_IMAGE}"
- docker build
--build-arg BUILD_DATE=$CI_COMMIT_TIMESTAMP
--build-arg BUILD_REPO=$DOCKER_ENV_CI_PROJECT_URL
--build-arg BUILD_REPO_REF=$CI_COMMIT_SHA
--build-arg BUILDKIT_INLINE_CACHE=1
--file "${DOCKERFILE}"
--tag "${RUN_IMAGE}" .
- docker push "${RUN_IMAGE}"
default:
image: docker:stable
tags: [docker]
services:
- docker:dind
before_script:
- env
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
variables:
RUN_IMAGE: $CI_REGISTRY_IMAGE/$APP-$OS-$COMPILER_TYPE:$COMPILER_VERSION
BUILD_IMAGE: $CI_REGISTRY_IMAGE/$APP-$OS-$COMPILER_TYPE-build:$COMPILER_VERSION
DOCKER_DRIVER: overlay2
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ""
DOCKER_BUILDKIT: 1
SECURE_LOG_LEVEL: debug
CS_SEVERITY_THRESHOLD: MEDIUM
CS_ANALYZER_IMAGE: registry.gitlab.com/security-products/container-scanning:4
stages:
- build
build-ppp:
stage: build
variables:
DOCKERFILE: ppp/ppp-Dockerfile
APP: "base"
OS: ppp
COMPILER_TYPE: none
COMPILER_VERSION: 1
<<: *buildScript
build-esm4-intel:
stage: build
variables:
DOCKERFILE: apps/Dockerfile-esm4-ubuntu20.04-intel2021.1.1
APP: esm4
OS: ubuntu20.04
COMPILER_TYPE: intel
COMPILER_VERSION: 2022.1.1
<<: *buildScript
build-am4-intel:
stage: build
variables:
DOCKERFILE: apps/Dockerfile-am4-ubuntu20.04-intel2021.1.1-2stage
APP: am4
OS: ubuntu20.04
COMPILER_TYPE: intel
COMPILER_VERSION: 2022.1.1
<<: *buildScript
build-ubuntu-intel:
stage: build
variables:
DOCKERFILE: Dockerfile-base-ubuntu20.04-intel2023
APP: "base"
OS: ubuntu20.04
COMPILER_TYPE: intel
COMPILER_VERSION: 2023
<<: *buildScript