-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.gitlab-ci.yml
31 lines (26 loc) · 1.02 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
image: docker:stable
services:
- docker:dind
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
before_script:
- apk add make
build:
stage: build
only:
- master
script:
# Login to Docker Hub
- echo "$DOCKER_HUB_TOKEN" | docker login --username "$DOCKER_HUB_USER" --password-stdin
- export DOCKER_REGISTRY="$DOCKER_HUB_NAMESPACE"
# Login to Gitlab registry
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- export DOCKER_REGISTRY="$CI_REGISTRY/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME"
# Build and push each flavour
- (export FLAVOUR=sdk; make build && DOCKER_REGISTRY="$DOCKER_HUB_NAMESPACE" make push)
- (export FLAVOUR=tools; make build && DOCKER_REGISTRY="$DOCKER_HUB_NAMESPACE" make push)
- (export FLAVOUR=ndk; make build && DOCKER_REGISTRY="$DOCKER_HUB_NAMESPACE" make push)
# android:latest = android:sdk
- docker tag android:sdk "$DOCKER_HUB_NAMESPACE/android:latest"
- docker push "$DOCKER_HUB_NAMESPACE/android:latest"