-
Notifications
You must be signed in to change notification settings - Fork 145
/
.gitlab-ci.yml
115 lines (108 loc) · 2.57 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
variables:
FORCE_COLOR: '3'
#NOTE: to run locally and test an image try "gitlab-runner exec docker test"
image: alleywayapps/atat-ci-image:v546
stages:
- build
- test
- deploy
build_image:
stage: build
services:
- docker:dind
image: docker
tags:
- docker
rules:
- if: $CI_COMMIT_REF_NAME == "develop"
changes:
- Dockerfile
script:
- docker info
- docker build -t alleywayapps/atat-ci-image .
- docker image tag alleywayapps/atat-ci-image alleywayapps/atat-ci-image:v${CI_PIPELINE_IID}
- echo "${DOCKER_AUTH_TOKEN}" | docker login --username alleywayapps --password-stdin
- docker push --all-tags alleywayapps/atat-ci-image
- echo "GREAT Now update ATATs .gitlab-ci.yml file to use v${CI_PIPELINE_IID}"
build:
stage: build
coverage: /All files[^|]*\|[^|]*\s+([\d\.]+)/
# tags:
# - macmini
cache:
paths:
- node_modules/
- dist/
artifacts:
expire_in: 1 days
when: on_success
paths:
- node_modules/
- dist/
script:
- node -v
- npm --version
- npm ci
- npm run build
test:
stage: test
coverage: /All files[^|]*\|[^|]*\s+([\d\.]+)/
dependencies:
- build
cache:
paths:
- node_modules/
- dist/
- coverage/
artifacts:
paths:
- coverage/
- screenshot*
when: always
expire_in: 1 day
reports:
junit:
- junit.xml
coverage_report:
coverage_format: cobertura
path: coverage/cobertura-coverage.xml
script:
- echo "${ENV_FILE_CONTENTS}" >> .env
- chmod 755 ./dist/cli.js
- node -v
- npm --version
- export NODE_OPTIONS="--import=extensionless/register --experimental-vm-modules"
- npm run test:ci
pages:
stage: deploy
dependencies:
- test
script:
- mkdir .public
- cp -r coverage/html/* .public
- mv .public public
artifacts:
paths:
- public
only:
- master
# this is now handled by github actions
#deploy_npm:
# stage: deploy
# dependencies:
# - test
# cache:
# paths:
# - node_modules/
# script:
# - echo "//registry.npmjs.org/:_authToken=${NPM_PUBLISH_KEY}" >> .npmrc
# - echo "email=${NPM_PUBLISH_EMAIL}" >> .npmrc
# - echo always-auth=true >> .npmrc
# #- cat .npmrc
# # we only release master from the development machine manually
# #- "[[ ${CI_COMMIT_BRANCH} != 'master' ]] &&
# - npx release-it prerelease --config .release-it.ci.json --ci --no-git --verbose --preReleaseId=ci.${CI_PIPELINE_IID}
# - echo "should have pushed ${CI_PIPELINE_IID}"
# only:
# refs:
# - develop