-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
72 lines (61 loc) · 1.65 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
image: docker:latest
stages:
- build
- post
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay2
before_script:
- if [ "$CI_COMMIT_REF_NAME" != "master" ]; then BRANCH="/$CI_COMMIT_REF_NAME"; fi
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
build_x86: &build_x86
stage: build
tags:
- docker
script:
- docker build -t "$CI_REGISTRY_IMAGE$BRANCH:latest" .
- docker run --rm "$CI_REGISTRY_IMAGE$BRANCH:latest" ./node_modules/.bin/mocha
- docker push "$CI_REGISTRY_IMAGE$BRANCH:latest"
- docker run --name=demo "$CI_REGISTRY_IMAGE$BRANCH:latest" ./node_modules/.bin/webpack --env.demo
- docker cp demo:/usr/src/app/dist public
artifacts:
paths:
- public
expire_in: 1 week
.common_arm7: &common_arm7
<<: *build_x86
artifacts:
script:
- docker build -t "$CI_REGISTRY_IMAGE$BRANCH:arm7" -f Dockerfile-qemu-arm7 .
- docker run --rm "$CI_REGISTRY_IMAGE$BRANCH:arm7" ./node_modules/.bin/mocha
- docker push "$CI_REGISTRY_IMAGE$BRANCH:arm7"
.common_arm8: &common_arm8
<<: *common_arm7
script:
- docker build -t "$CI_REGISTRY_IMAGE$BRANCH:arm8" -f Dockerfile-qemu-arm8 .
- docker run --rm "$CI_REGISTRY_IMAGE$BRANCH:arm8" ./node_modules/.bin/mocha
- docker push "$CI_REGISTRY_IMAGE$BRANCH:arm8"
build_arm7:
<<: *common_arm7
only: [master]
build_arm7_manual:
<<: *common_arm7
when: manual
except: [master]
build_arm8:
<<: *common_arm8
only: [master]
build_arm8_manual:
<<: *common_arm8
when: manual
except: [master]
pages:
stage: post
script:
- echo nothing to do!
artifacts:
paths:
- public
only:
- master