-
Notifications
You must be signed in to change notification settings - Fork 81
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
61 lines (56 loc) · 1.79 KB
/
.gitlab-ci.yml
File metadata and controls
61 lines (56 loc) · 1.79 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
variables:
DIST_IMAGE_LATEST: "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
DIST_IMAGE_SHA: "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA"
DIST_IMAGE_DOCKER_HUB: "mediathekview/mediathekviewweb:latest"
DIST_IMAGE_DOCKER_HUB_DEVELOPMENT: "mediathekview/mediathekviewweb:development"
before_script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
stages:
- build
- publish
build:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
except:
- schedules
script:
- /kaniko/executor --cache=true
--context "$CI_PROJECT_DIR"
--dockerfile "$CI_PROJECT_DIR/Containerfile"
--destination "$DIST_IMAGE_SHA"
--destination "$DIST_IMAGE_LATEST"
tags:
- gitlab-org-docker
publish:image:
stage: publish
when: manual
image: alpine:3.22
only:
- master
except:
- schedules
script:
- apk add --no-cache skopeo
- skopeo login --username "$CI_REGISTRY_USER" --password "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
- skopeo login --username "$DOCKER_HUB_USER" --password "$DOCKER_HUB_PASSWORD" "docker.io"
- skopeo copy "docker://${DIST_IMAGE_SHA}" "docker://${DIST_IMAGE_DOCKER_HUB}"
tags:
- gitlab-org-docker
publish:image-development:
stage: publish
when: manual
image: alpine:3.22
only:
- development
except:
- schedules
script:
- apk add --no-cache skopeo
- skopeo login --username "$CI_REGISTRY_USER" --password "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
- skopeo login --username "$DOCKER_HUB_USER" --password "$DOCKER_HUB_PASSWORD" "docker.io"
- skopeo copy "docker://${DIST_IMAGE_SHA}" "docker://${DIST_IMAGE_DOCKER_HUB_DEVELOPMENT}"
tags:
- gitlab-org-docker