forked from argoproj/argo-events
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
44 lines (42 loc) · 1.69 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
image: golang:1.21
.install_docker:
before_script:
- |
wget -O docker-cli.deb https://download.docker.com/linux/debian/dists/bullseye/pool/stable/amd64/docker-ce-cli_20.10.18~3-0~debian-bullseye_amd64.deb && \
dpkg -i docker-cli.deb && \
rm docker-cli.deb
variables:
MAJOR_VERSION: "0"
MINOR_VERSION: "1"
ORGANIZATION_NAME: "artificial-intelligence"
TEAM_NAME: "ai-platform"
ARGO_EVENTS_VERSION: "v1.9.2"
.build_templatized_docker_image:
before_script:
- !reference [.install_docker, before_script]
# Inject org & team names to conform to AIP naming conventions that make it possible to set
# permissions and retention policies at each level.
- IMAGE_REPOSITORY_PREFIX="${DOCKER_REPO_URL}/${ORGANIZATION_NAME}/${TEAM_NAME}"
# Ensure image tag is unique for each commit so we invalidate caching on machines pulling images.
- IMAGE_TAG="${ARGO_EVENTS_VERSION}-${MAJOR_VERSION}.${MINOR_VERSION}.${CI_PIPELINE_IID}"
# Actually set up the naming for the image we're currently building.
- IMAGE_REPOSITORY="${IMAGE_REPOSITORY_PREFIX}/${ARTIFACT_NAME}"
- IMAGE_REPOSITORY_TAG="${IMAGE_REPOSITORY}:${IMAGE_TAG}"
script:
- make build
- |
DOCKER_BUILDKIT=1 docker build \
--build-arg BUILDKIT_INLINE_CACHE=1 \
--build-arg "IMAGE_REPOSITORY_TAG=${IMAGE_REPOSITORY_TAG}" \
-t ${IMAGE_REPOSITORY_TAG} \
${CONTEXT}
- echo ${DOCKER_API_KEY} | docker login -u ${DOCKER_USERNAME} --password-stdin ${DOCKER_REPO_URL}
- docker push ${IMAGE_REPOSITORY_TAG}
stages:
- build:images
build:events:
extends: .build_templatized_docker_image
variables:
ARTIFACT_NAME: "argo-events"
CONTEXT: "./"
stage: build:images