forked from python-gitlab/python-gitlab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
30 lines (27 loc) · 1.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
image: python:3.12
stages:
- deploy
- promote
deploy-images:
stage: deploy
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG-alpine
- executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG-slim-bullseye --build-arg PYTHON_FLAVOR=slim-bullseye
rules:
- if: $CI_COMMIT_TAG
tag-latest:
stage: promote
image:
name: gcr.io/go-containerregistry/crane:debug
entrypoint: [""]
script:
- crane auth login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- crane tag $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG-alpine ${CI_COMMIT_TAG} # /python-gitlab:v1.2.3
- crane tag $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG-alpine latest # /python-gitlab:latest
- crane tag $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG-alpine alpine # /python-gitlab:alpine
- crane tag $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG-slim-bullseye slim-bullseye # /python-gitlab:slim-bullseye
rules:
- if: $CI_COMMIT_TAG