-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
81 lines (73 loc) · 2.73 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
stages:
- build_android
- build
- build_integ
variables:
CYPRESS_VERSION: 12.9.0 #cypress/included
FLUTTER_STABLE_VERSION: 3.10.4
CHANNEL: stable
.docker:
tags: [famedly, docker]
image: # https://docs.gitlab.com/ee/ci/docker/using_kaniko.html
name: gcr.io/kaniko-project/executor:v1.8.1-debug
entrypoint: [""]
before_script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
script:
- export IMAGE_NAME="${CI_REGISTRY_IMAGE}/${IMAGE_NAME_PART}/${CHANNEL}"
- if [ -z "$VERSION_SUFFIX" ]; then export LATEST_DESTINATION="--destination=$IMAGE_NAME:latest"; fi
- /kaniko/executor --snapshotMode=redo --single-snapshot --context="${CI_PROJECT_DIR}/${DIR}" --dockerfile="${CI_PROJECT_DIR}/${DIR}/Dockerfile" --destination="${IMAGE_NAME}:${VERSION}${VERSION_SUFFIX}" $LATEST_DESTINATION $EXTRA_BUILD_ARGS
workflow:
rules:
- if: $CI_COMMIT_BRANCH && $CI_COMMIT_REF_NAME != $CI_DEFAULT_BRANCH
variables: # namespace builds on branches
VERSION_SUFFIX: "-$CI_COMMIT_REF_SLUG"
- if: $CI_COMMIT_BRANCH && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
variables:
VERSION_SUFFIX: ""
# image for linux-native builds of flutter apps
flutter-linux:
extends: .docker
stage: build
needs: []
variables:
DIR: flutter-linux
IMAGE_NAME_PART: flutter-linux
VERSION: ${FLUTTER_STABLE_VERSION}
EXTRA_BUILD_ARGS: "--build-arg flutter_version=$FLUTTER_STABLE_VERSION --build-arg channel=$CHANNEL"
android-base:
extends: .docker
stage: build_android
variables:
DIR: android
IMAGE_NAME_PART: android-base
VERSION: ${FLUTTER_STABLE_VERSION}
# main consumable image, build in 3 variants corrsponding to the flutter release channels
# based on the android-base image
flutter:
extends: .docker
stage: build
variables:
DIR: flutter
IMAGE_NAME_PART: flutter
VERSION: ${FLUTTER_STABLE_VERSION}
EXTRA_BUILD_ARGS: "--build-arg flutter_version=$FLUTTER_STABLE_VERSION --build-arg image_base=${CI_REGISTRY_IMAGE}/android-base/stable:${FLUTTER_STABLE_VERSION}${VERSION_SUFFIX}"
# "flutter" + emulator tooling
integration:
extends: .docker
stage: build_integ
variables:
DIR: integration
IMAGE_NAME_PART: integration
VERSION: ${FLUTTER_STABLE_VERSION}
EXTRA_BUILD_ARGS: "--build-arg flutter_image=${CI_REGISTRY_IMAGE}/flutter/${CHANNEL}:${FLUTTER_STABLE_VERSION}${VERSION_SUFFIX}"
cypress:
extends: .docker
stage: build
needs: []
variables:
DIR: cypress
IMAGE_NAME_PART: cypress
VERSION: ${CYPRESS_VERSION} # cypress version, don't forget to update
EXTRA_BUILD_ARGS: "--build-arg cypress_version=${CYPRESS_VERSION}"