-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy path.gitlab-ci.yml
123 lines (115 loc) · 2.82 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
116
117
118
119
120
121
122
123
image: dockerhub.art.rambler.ru/andrepolischuk/node-chrome-firefox:0.7.1
stages:
- setup
- test
- build
- mirror
install:
stage: setup
cache: &cache
key: '$CI_COMMIT_REF_NAME:node_modules'
paths:
- node_modules/
policy: push
tags:
- builder
except:
- /^gh-pages$/
script:
- npm install
test:
stage: test
cache:
<<: *cache
policy: pull
tags:
- builder
except:
- /^gh-pages$/
script:
- npm run test
- npm run lint
- npm run types
- npm run build
- npm run size
coverage: '/All files\D+\d+\.\d+\D+(\d+\.\d+)/'
build_package:
stage: build
cache:
<<: *cache
policy: pull
tags:
- builder
except:
- /^gh-pages$/
only:
- tags
script:
- npm run build
- cd build
- echo "//registry.npmjs.org/:_authToken=$UI_BOT_NPM_AUTH_TOKEN" > ~/.npmrc
- npm publish
- curl -u${PROJECT_NPM_USER}:${PROJECT_NPM_AUTH_KEY} 'https://art.rambler.ru/api/npm/rambler-common/auth/rambler-common' > ~/.npmrc
- node -e "var p=require('./package.json'); p.name='@rambler-common/rambler-ui'; p.publishConfig={registry:'https://art.rambler.ru/api/npm/rambler-common/'}; fs.writeFileSync('package.json', JSON.stringify(p, null, 2));"
- npm publish
build_site:
stage: build
cache:
<<: *cache
policy: pull
tags:
- deployer
except:
- /^gh-pages$/
- tags
- master
when: manual
script:
- ./scripts/ci-git-push-prepare.sh gitlab.rambler.ru "${SSH_PRIVATE_KEY}"
- git config --global user.email "${GITLAB_USER_EMAIL}"
- git config --global user.name "${GITLAB_USER_NAME}"
- npm run pages -- --versions "${CI_COMMIT_REF_NAME}"
build_version_site:
stage: build
cache:
<<: *cache
policy: pull
tags:
- deployer
except:
- /^gh-pages$/
only:
- tags
script:
- ./scripts/ci-git-push-prepare.sh gitlab.rambler.ru "${SSH_PRIVATE_KEY}"
- git config --global user.email "${GITLAB_USER_EMAIL}"
- git config --global user.name "${GITLAB_USER_NAME}"
- npm run pages -- --versions "${CI_COMMIT_TAG}"
mirror:
stage: mirror
tags:
- builder
only:
- tags
- master
except:
- /^gh-pages$/
script:
- ./scripts/ci-git-push-prepare.sh github.com "${UI_BOT_SSH_PRIVATE_KEY}"
- git config --global user.email "${UI_BOT_EMAIL}"
- git config --global user.name "${UI_BOT_NAME}"
- git fetch --prune
- git push --prune [email protected]:rambler-digital-solutions/rambler-ui.git +refs/remotes/origin/master:refs/heads/master +refs/remotes/origin/gh-pages:refs/heads/gh-pages +refs/tags/*:refs/tags/*
pages:
stage: setup
tags:
- deployer
only:
- /^gh-pages$/
script:
- mkdir public
- rsync -rv --exclude=.git --exclude="2.*" --exclude=node_modules --exclude=public . ./public
artifacts:
untracked: false
paths:
- 'public'