-
Notifications
You must be signed in to change notification settings - Fork 6
/
.gitlab-ci.yml
78 lines (73 loc) · 2.55 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
image: docker:latest
variables:
GOOGLE_TAG: eu.gcr.io/papers-kubernetes/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME:$CI_COMMIT_SHA
GOOGLE_TAG_EXTENSION_CURRENT: eu.gcr.io/papers-kubernetes/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME:extension-$CI_COMMIT_SHA
stages:
- build
# - test
- native_build
# - qa
build_ionic:
stage: build
script:
- docker build -t $GOOGLE_TAG .
tags:
- docker
# unit:
# stage: test
# before_script:
# - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
# script:
# - docker run --name unit-$CI_COMMIT_SHA $IMAGE_TAG_CURRENT npm run test-ci
# - docker run --name lint-$CI_COMMIT_SHA $IMAGE_TAG_CURRENT npm run lint-ci
# - docker cp unit-$CI_COMMIT_SHA:/app/coverage/lcov.info lcov.info
# - docker cp lint-$CI_COMMIT_SHA:/app/lintReport.json lintReport.json
# after_script:
# - docker rm unit-$CI_COMMIT_SHA
# - docker rm lint-$CI_COMMIT_SHA
# tags:
# - docker
# artifacts:
# paths:
# - lcov.info
# - lintReport.json
build_extension:
stage: native_build
when: manual
script:
- docker build -f build/extension/Dockerfile -t $GOOGLE_TAG_EXTENSION_CURRENT --build-arg VERSION="$VERSION" --build-arg CI_PIPELINE_ID="$CI_PIPELINE_ID" .
- docker run --name extension-$CI_PIPELINE_ID $GOOGLE_TAG_EXTENSION_CURRENT echo "container ran."
- docker cp extension-$CI_PIPELINE_ID:/app/www spire
after_script:
- docker rm -f extension-$CI_PIPELINE_ID || true
artifacts:
name: 'spire'
paths:
- spire/
tags:
- docker
# qa:
# stage: qa
# before_script:
# - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
# script:
# - docker create --name qa-$CI_PIPELINE_ID $IMAGE_TAG_CURRENT npm run sonar-scanner -- -X
# -Dsonar.typescript.lcov.reportPaths=lcov.info
# -Dsonar.typescript.tslint.reportPaths=lintReport.json
# -Dsonar.test.inclusions=**/*.spec.ts
# -Dsonar.tests=src/
# -Dsonar.exclusions=**/node_modules/**,**/*.spec.ts,src/assets/libs/**
# -Dsonar.sources=src/
# -Dsonar.host.url=$SONAR_URL
# -Dsonar.login=$SONAR_LOGIN
# -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA
# -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME
# -Dsonar.gitlab.project_id=$CI_PROJECT_ID
# -Dsonar.branch.name=$CI_BUILD_REF_NAME
# - docker cp lcov.info qa-$CI_PIPELINE_ID:/app/lcov.info
# - docker cp lintReport.json qa-$CI_PIPELINE_ID:/app/lintReport.json
# - docker start -a qa-$CI_PIPELINE_ID
# after_script:
# - docker rm -f qa-$CI_PIPELINE_ID || true
# tags:
# - docker