-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathgitlab-ci.yml
More file actions
47 lines (42 loc) · 2.04 KB
/
Copy pathgitlab-ci.yml
File metadata and controls
47 lines (42 loc) · 2.04 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
default:
image: docker:latest
services:
- docker:dind
before_script:
- apk add --no-cache git
- docker run --privileged --rm tonistiigi/binfmt --install arm64
- docker buildx ls | grep -q mu7d || docker buildx create --bootstrap --name mu7d
- docker buildx use mu7d
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
stages:
- build
variables:
BUILDKIT_INLINE_CACHE: 1
DOCKER_DRIVER: btrfs
DOCKER_HOST: unix:///var/run/docker.sock
DOCKER_TLS_CERTDIR: ""
REPOSITORY: $CI_REGISTRY/javier/movistar-u7d
build-stable:
stage: build
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_TAG
when: never
script:
- docker buildx build --build-arg BUILD_TYPE=full --platform linux/amd64,linux/arm64 --provenance false --push --tag $REPOSITORY:stable --tag $REPOSITORY:$CI_COMMIT_SHORT_SHA-stable .
- docker buildx build --platform linux/amd64,linux/arm64 --provenance false --push --tag $REPOSITORY:stable-slim --tag $REPOSITORY:$CI_COMMIT_SHORT_SHA-stable-slim .
build-tag:
stage: build
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_TAG
script:
- docker buildx build --build-arg BUILD_TYPE=full --platform linux/amd64,linux/arm64 --provenance false --push --tag $REPOSITORY:stable --tag $REPOSITORY:$CI_COMMIT_SHORT_SHA-stable --tag $REPOSITORY:$CI_COMMIT_TAG-stable .
- docker buildx build --platform linux/amd64,linux/arm64 --provenance false --push --tag $REPOSITORY:stable-slim --tag $REPOSITORY:$CI_COMMIT_SHORT_SHA-stable-slim --tag $REPOSITORY:$CI_COMMIT_TAG-stable-slim .
build-unstable:
stage: build
rules:
- if: $CI_COMMIT_BRANCH == "next"
script:
- docker buildx build --build-arg BUILD_TYPE=full --platform linux/amd64,linux/arm64 --provenance false --push --tag $REPOSITORY:unstable .
- docker buildx build --platform linux/amd64,linux/arm64 --provenance false --push --tag $REPOSITORY:unstable-slim .