@toptal/davinci-ci 1.14.6-alpha-chore-add-parallelization-to-unit-tests.66 → 1.14.6-alpha-feature-comm-833-reusing-graphql-fragments-c9f0a710.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +123 -0
- package/README.md +6 -9
- package/bin/davinci-ci.js +1 -1
- package/package.json +7 -7
- package/src/commands/danger.js +18 -10
- package/src/configs/danger/conventional-commits/plugins/conventional-commits/index.js +10 -4
- package/src/configs/danger/conventional-commits/plugins/conventional-pr-title/index.js +6 -4
- package/src/configs/danger/conventional-commits/plugins/index.js +1 -1
- package/src/configs/danger/toptal/config.js +6 -2
- package/src/configs/danger/toptal/plugins/index.js +1 -1
- package/src/configs/danger/toptal/plugins/toptal-commits/index.js +4 -3
- package/src/configs/danger/toptal/plugins/toptal-pr-title/index.js +5 -2
- package/src/configs/docker/Dockerfile.release +1 -1
- package/src/configs/docker/Dockerfile.storybook +20 -0
- package/src/configs/docker/nginx-vhost-storybook.conf +20 -0
- package/src/configs/docker/nginx-vhost.conf +18 -0
- package/src/configs/jobs/build-image/Jenkinsfile +22 -0
- package/src/configs/jobs/build-release-image/Jenkinsfile +24 -0
- package/src/configs/jobs/deploy/config.xml +107 -0
- package/src/configs/jobs/deploy-helm-run/Jenkinsfile +1 -1
- package/src/configs/jobs/deploy-helm-run-trigger/Jenkinsfile +2 -0
- package/src/configs/jobs/master-main/Jenkinsfile +6 -21
- package/src/configs/jobs/pr-tests/Jenkinsfile +8 -1
- package/src/configs/jobs/publish-alpha-package/Jenkinsfile +1 -1
- package/src/configs/jobs/temploy-helm-run/Jenkinsfile +20 -6
- package/src/index.js +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,128 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 2.0.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`1c422aae`](https://github.com/toptal/davinci/commit/1c422aae676d25cd2216c8a24af4b7e208728931)]:
|
|
8
|
+
- @toptal/davinci-cli-shared@1.9.0
|
|
9
|
+
|
|
10
|
+
## 2.0.13
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [#1688](https://github.com/toptal/davinci/pull/1688) [`d1cb27ee`](https://github.com/toptal/davinci/commit/d1cb27eeaa6416107a0a3328438dd75083ac259b) Thanks [@dmaklygin](https://github.com/dmaklygin)! - ---
|
|
15
|
+
|
|
16
|
+
- create `nginx` vhost configuration files to the `davinci-ci` package
|
|
17
|
+
Now, the vhost config file is here: `./davinci/packages/davinci/ci/src/configs/docker/nginx-vhost.conf`
|
|
18
|
+
the storybook vhost config file is here: `./davinci/packages/davinci/ci/src/configs/docker/nginx-vhost-storybook.conf`
|
|
19
|
+
|
|
20
|
+
## 2.0.12
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- Updated dependencies [[`b12d1d19`](https://github.com/toptal/davinci/commit/b12d1d19af02104b9076a53b6e516198e6cda141)]:
|
|
25
|
+
- @toptal/davinci-cli-shared@1.8.1
|
|
26
|
+
|
|
27
|
+
## 2.0.11
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- Updated dependencies [[`e602ae7e`](https://github.com/toptal/davinci/commit/e602ae7edc7d075a4192052d6c04868f08fea0a7)]:
|
|
32
|
+
- @toptal/davinci-cli-shared@1.8.0
|
|
33
|
+
|
|
34
|
+
## 2.0.10
|
|
35
|
+
|
|
36
|
+
### Patch Changes
|
|
37
|
+
|
|
38
|
+
- Updated dependencies [[`9b67beb3`](https://github.com/toptal/davinci/commit/9b67beb3aaf0e24193b2deaba3126c41e3ec9280), [`04fe7ffa`](https://github.com/toptal/davinci/commit/04fe7ffa161027d081c6ae870716bb06a2fcf73f)]:
|
|
39
|
+
- @toptal/davinci-cli-shared@1.7.0
|
|
40
|
+
|
|
41
|
+
## 2.0.9
|
|
42
|
+
|
|
43
|
+
### Patch Changes
|
|
44
|
+
|
|
45
|
+
- [#1541](https://github.com/toptal/davinci/pull/1541) [`397a53c9`](https://github.com/toptal/davinci/commit/397a53c9add9f7e8d485648b51cd22676d97c78f) Thanks [@TomasSlama](https://github.com/TomasSlama)! - ---
|
|
46
|
+
- Update documentation about prefering individual davinci packages usage
|
|
47
|
+
|
|
48
|
+
## 2.0.8
|
|
49
|
+
|
|
50
|
+
### Patch Changes
|
|
51
|
+
|
|
52
|
+
- [#1525](https://github.com/toptal/davinci/pull/1525) [`f69a35e`](https://github.com/toptal/davinci/commit/f69a35e2a590b61524d9ab1ce37a03e50012a3c9) Thanks [@denieler](https://github.com/denieler)! - - fix davinci-ci bin executable name
|
|
53
|
+
|
|
54
|
+
## 2.0.7
|
|
55
|
+
|
|
56
|
+
### Patch Changes
|
|
57
|
+
|
|
58
|
+
- Updated dependencies [[`fa3423f1`](https://github.com/toptal/davinci/commit/fa3423f1f9211b4d8899064aa4afdf5ca2198483)]:
|
|
59
|
+
- @toptal/davinci-cli-shared@1.6.0
|
|
60
|
+
|
|
61
|
+
## 2.0.6
|
|
62
|
+
|
|
63
|
+
### Patch Changes
|
|
64
|
+
|
|
65
|
+
- [#1419](https://github.com/toptal/davinci/pull/1419) [`c03d633a`](https://github.com/toptal/davinci/commit/c03d633aa49c91718c63786c0514ce3d89739124) Thanks [@dependabot](https://github.com/apps/dependabot)! - - Bump @commitlint/config-convetional
|
|
66
|
+
|
|
67
|
+
## 2.0.5
|
|
68
|
+
|
|
69
|
+
### Patch Changes
|
|
70
|
+
|
|
71
|
+
- [#1406](https://github.com/toptal/davinci/pull/1406) [`af205861`](https://github.com/toptal/davinci/commit/af20586123c6811f657840d17f2f3161afce7ea4) Thanks [@sergiubutnarasu](https://github.com/sergiubutnarasu)! - Add option to pass custom danger file to the danger CI
|
|
72
|
+
|
|
73
|
+
## 2.0.4
|
|
74
|
+
|
|
75
|
+
### Patch Changes
|
|
76
|
+
|
|
77
|
+
- Updated dependencies [[`64c000c2`](https://github.com/toptal/davinci/commit/64c000c25d97df2c8853a6cf80b7ca81461dae24)]:
|
|
78
|
+
- @toptal/davinci-cli-shared@1.5.4
|
|
79
|
+
|
|
80
|
+
## 2.0.3
|
|
81
|
+
|
|
82
|
+
### Patch Changes
|
|
83
|
+
|
|
84
|
+
- Updated dependencies [[`3013b76d`](https://github.com/toptal/davinci/commit/3013b76d7f957924885f3e5933f5227ff42a09e1)]:
|
|
85
|
+
- @toptal/davinci-cli-shared@1.5.3
|
|
86
|
+
|
|
87
|
+
## 2.0.2
|
|
88
|
+
|
|
89
|
+
### Patch Changes
|
|
90
|
+
|
|
91
|
+
- [#1359](https://github.com/toptal/davinci/pull/1359) [`113e96b2`](https://github.com/toptal/davinci/commit/113e96b28f64dc0d78f8b0ce0b5687670d8e4796) Thanks [@dependabot](https://github.com/apps/dependabot)! - Bump commitlint-cli from 16.2.4 to 17.0.2
|
|
92
|
+
|
|
93
|
+
## 2.0.1
|
|
94
|
+
|
|
95
|
+
### Patch Changes
|
|
96
|
+
|
|
97
|
+
- [#1349](https://github.com/toptal/davinci/pull/1349) [`fdf524b7`](https://github.com/toptal/davinci/commit/fdf524b76c298bdc61696d3b5066070cf88cad59) Thanks [@denieler](https://github.com/denieler)! - - fix davinci-job-creator jenkinsfile
|
|
98
|
+
|
|
99
|
+
- Updated dependencies [[`1212e098`](https://github.com/toptal/davinci/commit/1212e098c668fc1c87ee9b1824edf0bc80509bc4)]:
|
|
100
|
+
- @toptal/davinci-cli-shared@1.5.2
|
|
101
|
+
|
|
102
|
+
## 2.0.0
|
|
103
|
+
|
|
104
|
+
### Major Changes
|
|
105
|
+
|
|
106
|
+
- [#1326](https://github.com/toptal/davinci/pull/1326) [`77adee1f`](https://github.com/toptal/davinci/commit/77adee1f003f6336279ca4ac24476bdece8d9828) Thanks [@augustobmoura](https://github.com/augustobmoura)! - - rename the command `davinci qa e2e` to `davinci qa integration`
|
|
107
|
+
|
|
108
|
+
## 1.15.0
|
|
109
|
+
|
|
110
|
+
### Minor Changes
|
|
111
|
+
|
|
112
|
+
- [#1259](https://github.com/toptal/davinci/pull/1259) [`878bb763`](https://github.com/toptal/davinci/commit/878bb76396465641b94edf8c780938fefaa31b42) Thanks [@fbueno](https://github.com/fbueno)! - Add the ability to create deployment jobs on main and deploy
|
|
113
|
+
|
|
114
|
+
## 1.14.7
|
|
115
|
+
|
|
116
|
+
### Patch Changes
|
|
117
|
+
|
|
118
|
+
- [#1274](https://github.com/toptal/davinci/pull/1274) [`554398c1`](https://github.com/toptal/davinci/commit/554398c1a4b163bb87b41e3472d09dbf98836769) Thanks [@dependabot](https://github.com/apps/dependabot)! - Bump @commitlint/cli from 12.1.4 to 16.2.4
|
|
119
|
+
|
|
120
|
+
## 1.14.6
|
|
121
|
+
|
|
122
|
+
### Patch Changes
|
|
123
|
+
|
|
124
|
+
- [#1273](https://github.com/toptal/davinci/pull/1273) [`9b37e0db`](https://github.com/toptal/davinci/commit/9b37e0db044405a0c67d9b46a7a5c6dc1a0302e2) Thanks [@dependabot](https://github.com/apps/dependabot)! - Bump danger from 10.9.0 to 11.0.5
|
|
125
|
+
|
|
3
126
|
## 1.14.5
|
|
4
127
|
|
|
5
128
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -8,26 +8,26 @@ Watch [this video](https://drive.google.com/file/d/1C5ApkATYCXZ8kTn2LeG5FkM4AveL
|
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
11
|
-
Use it by installing `yarn add @toptal/davinci` in your project.
|
|
11
|
+
Use it by installing `yarn add @toptal/davinci-ci` in your project.
|
|
12
12
|
|
|
13
13
|
## Usage
|
|
14
14
|
|
|
15
15
|
### Commands
|
|
16
16
|
|
|
17
|
-
- `davinci
|
|
17
|
+
- `davinci-ci danger` - checks if the PR title and and commit messages comply with [Toptal's standards](https://toptal-core.atlassian.net/wiki/spaces/ENG/pages/210665897/Commit+Message+Quality)
|
|
18
18
|
|
|
19
|
-
- `davinci
|
|
19
|
+
- `davinci-ci danger --conventionalCommits` - checks if the PR title and and commit messages comply with [ConventionalCommits](https://www.conventionalcommits.org/en/v1.0.0/)
|
|
20
20
|
|
|
21
21
|
To check commit message quality locally just add `--local` argument
|
|
22
22
|
|
|
23
|
-
`davinci
|
|
23
|
+
`davinci-ci danger --local`
|
|
24
24
|
|
|
25
25
|
Using husky, you can check the commit message before pushing files changes.
|
|
26
26
|
|
|
27
27
|
```js
|
|
28
28
|
"husky": {
|
|
29
29
|
"hooks": {
|
|
30
|
-
"pre-push": "yarn davinci
|
|
30
|
+
"pre-push": "yarn davinci-ci danger --local"
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
```
|
|
@@ -45,6 +45,7 @@ pr:
|
|
|
45
45
|
master:
|
|
46
46
|
publish_as_package: false
|
|
47
47
|
deploy_staging: false
|
|
48
|
+
deploy_storybook_staging: false
|
|
48
49
|
deploy: false
|
|
49
50
|
|
|
50
51
|
# Customize Slack channel where the notifications will get posted
|
|
@@ -52,10 +53,6 @@ slack_channel: 'custom-slack-channel'
|
|
|
52
53
|
is_progressive_web_app: true
|
|
53
54
|
```
|
|
54
55
|
|
|
55
|
-
### Alias
|
|
56
|
-
|
|
57
|
-
In all the commands you can use `davinci-ci` directly if needed, instead of `davinci ci`. This is not a recommended way to use `davinci`, but in very rare cases it might be useful.
|
|
58
|
-
|
|
59
56
|
### Commands you can use in GitHub PRs
|
|
60
57
|
|
|
61
58
|
`@toptal-bot run tests` - to re-run `pr-tests` job
|
package/bin/davinci-ci.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toptal/davinci-ci",
|
|
3
|
-
"version": "1.14.6-alpha-
|
|
3
|
+
"version": "1.14.6-alpha-feature-comm-833-reusing-graphql-fragments-c9f0a710.8+c9f0a710",
|
|
4
4
|
"description": "Continuos integrations tools for frontend projects",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"homepage": "https://github.com/toptal/davinci/tree/master/packages/ci#readme",
|
|
15
15
|
"license": "ISC",
|
|
16
16
|
"bin": {
|
|
17
|
-
"davinci-
|
|
17
|
+
"davinci-ci": "./bin/davinci-ci.js"
|
|
18
18
|
},
|
|
19
19
|
"main": "./src/index.js",
|
|
20
20
|
"repository": {
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"url": "https://github.com/toptal/davinci/issues"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@commitlint/cli": "^
|
|
34
|
-
"@commitlint/config-conventional": "^
|
|
35
|
-
"@toptal/davinci-cli-shared": "1.5.2-alpha-
|
|
36
|
-
"danger": "^
|
|
33
|
+
"@commitlint/cli": "^17.0.2",
|
|
34
|
+
"@commitlint/config-conventional": "^17.1.0",
|
|
35
|
+
"@toptal/davinci-cli-shared": "1.5.2-alpha-feature-comm-833-reusing-graphql-fragments-c9f0a710.8+c9f0a710",
|
|
36
|
+
"danger": "^11.0.7",
|
|
37
37
|
"markdown-table": "^2.0.0"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "c9f0a71013f9c5377fab1a6d8e768c3a98654d2d"
|
|
40
40
|
}
|
package/src/commands/danger.js
CHANGED
|
@@ -3,24 +3,28 @@ const {
|
|
|
3
3
|
runSync,
|
|
4
4
|
print,
|
|
5
5
|
convertToCLIParameters,
|
|
6
|
-
files
|
|
6
|
+
files,
|
|
7
7
|
} = require('@toptal/davinci-cli-shared')
|
|
8
8
|
|
|
9
9
|
const commandOptions = [
|
|
10
10
|
{
|
|
11
11
|
label: 'check only, without fixing the code',
|
|
12
|
-
name: '--check'
|
|
12
|
+
name: '--check',
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
label: 'checks commit message quality locally',
|
|
16
|
-
name: '--local'
|
|
17
|
-
}
|
|
16
|
+
name: '--local',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
label: 'specify custom danger file',
|
|
20
|
+
name: '--dangerfile <dangerfile>',
|
|
21
|
+
},
|
|
18
22
|
]
|
|
19
23
|
|
|
20
24
|
const dangerCommand = ({ options }) => {
|
|
21
25
|
print.green('Running danger check...')
|
|
22
26
|
|
|
23
|
-
const { local, ...rest } = options
|
|
27
|
+
const { local, dangerfile, ...rest } = options
|
|
24
28
|
|
|
25
29
|
const conventionalCommitsDangerfilePath = files.getPackageFilePath(
|
|
26
30
|
'@toptal/davinci-ci',
|
|
@@ -31,9 +35,13 @@ const dangerCommand = ({ options }) => {
|
|
|
31
35
|
'src/configs/danger/toptal/dangerfile.js'
|
|
32
36
|
)
|
|
33
37
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
38
|
+
let dangerfilePath = dangerfile
|
|
39
|
+
|
|
40
|
+
if (!dangerfilePath) {
|
|
41
|
+
dangerfilePath = davinciProjectConfig.master.conventionalCommits
|
|
42
|
+
? conventionalCommitsDangerfilePath
|
|
43
|
+
: toptalCommitsDangerfilePath
|
|
44
|
+
}
|
|
37
45
|
|
|
38
46
|
runSync(
|
|
39
47
|
'yarn',
|
|
@@ -43,7 +51,7 @@ const dangerCommand = ({ options }) => {
|
|
|
43
51
|
local ? '--failOnErrors' : undefined,
|
|
44
52
|
'--dangerfile',
|
|
45
53
|
`${dangerfilePath}`,
|
|
46
|
-
...convertToCLIParameters(rest)
|
|
54
|
+
...convertToCLIParameters(rest),
|
|
47
55
|
].filter(Boolean)
|
|
48
56
|
)
|
|
49
57
|
}
|
|
@@ -53,7 +61,7 @@ const dangerCommandCreator = {
|
|
|
53
61
|
allowUnknownOptions: true,
|
|
54
62
|
command: 'danger',
|
|
55
63
|
description: 'Run danger check',
|
|
56
|
-
options: commandOptions
|
|
64
|
+
options: commandOptions,
|
|
57
65
|
}
|
|
58
66
|
|
|
59
67
|
module.exports = dangerCommandCreator
|
|
@@ -1,17 +1,23 @@
|
|
|
1
|
+
/* globals danger, fail */
|
|
2
|
+
/* eslint-disable import/no-extraneous-dependencies */
|
|
1
3
|
const { default: load } = require('@commitlint/load')
|
|
2
4
|
const { default: lint } = require('@commitlint/lint')
|
|
5
|
+
/* eslint-enable */
|
|
3
6
|
const table = require('markdown-table')
|
|
4
7
|
|
|
5
8
|
const { WHITELISTED_USERS } = require('../../../toptal/config')
|
|
6
9
|
|
|
7
10
|
const conventionalCommits = async () => {
|
|
8
|
-
if (
|
|
11
|
+
if (
|
|
12
|
+
danger.github &&
|
|
13
|
+
WHITELISTED_USERS.includes(danger.github.pr.user.login)
|
|
14
|
+
) {
|
|
9
15
|
return
|
|
10
16
|
}
|
|
11
17
|
|
|
12
18
|
const { commits } = danger.git
|
|
13
19
|
const { rules, parserPreset } = await load({
|
|
14
|
-
extends: ['@commitlint/config-conventional']
|
|
20
|
+
extends: ['@commitlint/config-conventional'],
|
|
15
21
|
})
|
|
16
22
|
|
|
17
23
|
commits.forEach(async commit => {
|
|
@@ -27,7 +33,7 @@ const conventionalCommits = async () => {
|
|
|
27
33
|
|
|
28
34
|
message += table([
|
|
29
35
|
['Message'],
|
|
30
|
-
...result.errors.map(error => [error.message])
|
|
36
|
+
...result.errors.map(error => [error.message]),
|
|
31
37
|
])
|
|
32
38
|
|
|
33
39
|
message +=
|
|
@@ -42,5 +48,5 @@ const conventionalCommits = async () => {
|
|
|
42
48
|
}
|
|
43
49
|
|
|
44
50
|
module.exports = {
|
|
45
|
-
conventionalCommits
|
|
51
|
+
conventionalCommits,
|
|
46
52
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/// <reference types="danger" />
|
|
2
|
-
|
|
2
|
+
/* globals danger, fail */
|
|
3
|
+
/* eslint-disable import/no-extraneous-dependencies */
|
|
3
4
|
const { default: load } = require('@commitlint/load')
|
|
4
5
|
const { default: lint } = require('@commitlint/lint')
|
|
6
|
+
/* eslint-enable */
|
|
5
7
|
const table = require('markdown-table')
|
|
6
8
|
|
|
7
9
|
const { WHITELISTED_USERS } = require('../../../toptal/config')
|
|
@@ -16,7 +18,7 @@ const conventionalPRTitle = async () => {
|
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
const { rules, parserPreset } = await load({
|
|
19
|
-
extends: ['@commitlint/config-conventional']
|
|
21
|
+
extends: ['@commitlint/config-conventional'],
|
|
20
22
|
})
|
|
21
23
|
const { title } = danger.github.pr
|
|
22
24
|
|
|
@@ -33,7 +35,7 @@ const conventionalPRTitle = async () => {
|
|
|
33
35
|
|
|
34
36
|
message += table([
|
|
35
37
|
['Message'],
|
|
36
|
-
...result.errors.map(error => [error.message])
|
|
38
|
+
...result.errors.map(error => [error.message]),
|
|
37
39
|
])
|
|
38
40
|
|
|
39
41
|
message +=
|
|
@@ -47,5 +49,5 @@ const conventionalPRTitle = async () => {
|
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
module.exports = {
|
|
50
|
-
conventionalPRTitle
|
|
52
|
+
conventionalPRTitle,
|
|
51
53
|
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
const WHITELISTED_USERS = [
|
|
1
|
+
const WHITELISTED_USERS = [
|
|
2
|
+
'dependabot-preview[bot]',
|
|
3
|
+
'dependabot[bot]',
|
|
4
|
+
'toptal-devbot',
|
|
5
|
+
]
|
|
2
6
|
const VALID_PR_CODE_REGEX = /\[[A-Z]{1,5}-.*]\s/
|
|
3
7
|
// Valid commit titles:
|
|
4
8
|
// "Regular commit message"
|
|
@@ -22,5 +26,5 @@ module.exports = {
|
|
|
22
26
|
MISSING_TICKET_CODE_ERROR_MESSAGE,
|
|
23
27
|
VALID_COMMIT_TITLE_REGEX,
|
|
24
28
|
VALID_PR_CODE_REGEX,
|
|
25
|
-
WHITELISTED_USERS
|
|
29
|
+
WHITELISTED_USERS,
|
|
26
30
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
/* globals danger, fail */
|
|
1
2
|
const {
|
|
2
3
|
MAX_COMMIT_LINE_LENGTH,
|
|
3
4
|
VALID_COMMIT_TITLE_REGEX,
|
|
4
|
-
WHITELISTED_USERS
|
|
5
|
+
WHITELISTED_USERS,
|
|
5
6
|
} = require('../../config')
|
|
6
7
|
|
|
7
8
|
const validateCommitMessage = message => {
|
|
@@ -60,7 +61,7 @@ const toptalCommits = () => {
|
|
|
60
61
|
fail(
|
|
61
62
|
[
|
|
62
63
|
`Commit ${commit.sha.trim()} does not meet requirements of [Commit Message Quality](https://toptal-core.atlassian.net/wiki/spaces/ENG/pages/210665897/Commit+Message+Quality):`,
|
|
63
|
-
...validationErrors
|
|
64
|
+
...validationErrors,
|
|
64
65
|
].join('\n')
|
|
65
66
|
)
|
|
66
67
|
}
|
|
@@ -68,5 +69,5 @@ const toptalCommits = () => {
|
|
|
68
69
|
}
|
|
69
70
|
|
|
70
71
|
module.exports = {
|
|
71
|
-
toptalCommits
|
|
72
|
+
toptalCommits,
|
|
72
73
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
/* globals danger, fail */
|
|
1
2
|
const {
|
|
2
3
|
VALID_COMMIT_TITLE_REGEX,
|
|
3
4
|
VALID_PR_CODE_REGEX,
|
|
4
5
|
WHITELISTED_USERS,
|
|
5
6
|
DEFAULT_PR_TITLE_ERROR_MESSAGE,
|
|
6
|
-
MISSING_TICKET_CODE_ERROR_MESSAGE
|
|
7
|
+
MISSING_TICKET_CODE_ERROR_MESSAGE,
|
|
7
8
|
} = require('../../config')
|
|
8
9
|
|
|
9
10
|
const getTicketCode = text => {
|
|
@@ -36,6 +37,7 @@ const toptalPRTitle = () => {
|
|
|
36
37
|
|
|
37
38
|
if (!ticketCode && !labelNames.includes('no-jira')) {
|
|
38
39
|
showError(MISSING_TICKET_CODE_ERROR_MESSAGE)
|
|
40
|
+
|
|
39
41
|
return
|
|
40
42
|
}
|
|
41
43
|
|
|
@@ -43,6 +45,7 @@ const toptalPRTitle = () => {
|
|
|
43
45
|
|
|
44
46
|
if (!splitTitle.length) {
|
|
45
47
|
showError()
|
|
48
|
+
|
|
46
49
|
return
|
|
47
50
|
}
|
|
48
51
|
|
|
@@ -55,5 +58,5 @@ const toptalPRTitle = () => {
|
|
|
55
58
|
}
|
|
56
59
|
|
|
57
60
|
module.exports = {
|
|
58
|
-
toptalPRTitle
|
|
61
|
+
toptalPRTitle,
|
|
59
62
|
}
|
|
@@ -8,7 +8,7 @@ FROM nginx:alpine
|
|
|
8
8
|
ARG ENV_RUNTIME_ENTRYPOINT
|
|
9
9
|
|
|
10
10
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
|
11
|
-
COPY --from=builder /app/node_modules/@toptal/davinci/docker/nginx-vhost.conf /etc/nginx/conf.d/default.conf
|
|
11
|
+
COPY --from=builder /app/node_modules/@toptal/davinci-ci/src/configs/docker/nginx-vhost.conf /etc/nginx/conf.d/default.conf
|
|
12
12
|
|
|
13
13
|
# Remove source maps from the production build
|
|
14
14
|
RUN find /usr/share/nginx/html -name "*.map" -type f -delete
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Create the image with Nginx environment.
|
|
2
|
+
FROM nginx:alpine
|
|
3
|
+
|
|
4
|
+
# Copy results from the dist folder to the image.
|
|
5
|
+
ARG DIST_FOLDER
|
|
6
|
+
RUN [ -z "$DIST_FOLDER" ] && echo "DIST_FOLDER is required" && exit 1 || true
|
|
7
|
+
COPY $DIST_FOLDER /usr/share/nginx/html/storybook
|
|
8
|
+
|
|
9
|
+
# version is used in build process, so the value won't be available here otherwise
|
|
10
|
+
ARG VERSION
|
|
11
|
+
RUN [ -z "$VERSION" ] && echo "VERSION is required" && exit 1 || true
|
|
12
|
+
|
|
13
|
+
RUN echo $VERSION > /usr/share/nginx/html/REVISION.txt
|
|
14
|
+
|
|
15
|
+
# Copy configuration file for Nginx and replace the default one.
|
|
16
|
+
ARG NGINX_CONFIG
|
|
17
|
+
RUN [ -z "$NGINX_CONFIG" ] && echo "NGINX_CONFIG is required" && exit 1 || true
|
|
18
|
+
COPY $NGINX_CONFIG /etc/nginx/conf.d/default.conf
|
|
19
|
+
|
|
20
|
+
CMD ["nginx", "-g", "daemon off;"]
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
server {
|
|
2
|
+
listen 80;
|
|
3
|
+
server_name localhost;
|
|
4
|
+
root /usr/share/nginx/html/storybook;
|
|
5
|
+
|
|
6
|
+
location / {
|
|
7
|
+
try_files $uri $uri/ index.html;
|
|
8
|
+
index index.html;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
location ~ \.(js|png|svg|jpg|gif)$ {
|
|
12
|
+
try_files $uri $uri/ =404;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
# redirect server error pages to the static page /50x.html
|
|
16
|
+
error_page 500 502 503 504 /50x.html;
|
|
17
|
+
location = /50x.html {
|
|
18
|
+
root /usr/share/nginx/html;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# When you are redirecting to any url, which is handled by react-router
|
|
2
|
+
# on nginx we need special configuration to handle those
|
|
3
|
+
# and don't just return 404
|
|
4
|
+
server {
|
|
5
|
+
listen 80;
|
|
6
|
+
server_name localhost;
|
|
7
|
+
|
|
8
|
+
index index.html;
|
|
9
|
+
root /usr/share/nginx/html;
|
|
10
|
+
|
|
11
|
+
location ~ \.(js|css)$ {
|
|
12
|
+
# allow returning 404s for assets
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
location / {
|
|
16
|
+
try_files $uri /index.html;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -4,6 +4,7 @@ image = null
|
|
|
4
4
|
|
|
5
5
|
repositoryName = REPOSITORY_NAME
|
|
6
6
|
repositorySSHUrl = "git@github.com:toptal/${repositoryName}.git"
|
|
7
|
+
env.REPO_NAME_FOR_COMMIT = "toptal/${repositoryName}"
|
|
7
8
|
|
|
8
9
|
pipeline {
|
|
9
10
|
agent { label 'slave_aws' }
|
|
@@ -47,6 +48,7 @@ pipeline {
|
|
|
47
48
|
additionalBehaviours: [
|
|
48
49
|
cleanBeforeCheckout: true
|
|
49
50
|
])
|
|
51
|
+
script { env.COMMIT_FOR_ANVIL = gitCommit() }
|
|
50
52
|
success "== Checked out ${BRANCH} at ${gitCommit()}"
|
|
51
53
|
}
|
|
52
54
|
}
|
|
@@ -87,6 +89,18 @@ pipeline {
|
|
|
87
89
|
} else {
|
|
88
90
|
success "== Found image for version ${VERSION} =="
|
|
89
91
|
}
|
|
92
|
+
|
|
93
|
+
if (!isDockerImagePresentRemotely("us-central1-docker.pkg.dev/toptal-hub/containers/${IMAGE_NAME}", VERSION)) {
|
|
94
|
+
image = docker.build(
|
|
95
|
+
"us-central1-docker.pkg.dev/toptal-hub/containers/${IMAGE_NAME}:${VERSION}",
|
|
96
|
+
"""-f ./davinci/packages/ci/src/configs/docker/Dockerfile \
|
|
97
|
+
--build-arg NPM_TOKEN=${NPM_TOKEN} \
|
|
98
|
+
./${repositoryName}"""
|
|
99
|
+
)
|
|
100
|
+
success "== Built image for version ${VERSION} =="
|
|
101
|
+
} else {
|
|
102
|
+
success "== Found image for version ${VERSION} =="
|
|
103
|
+
}
|
|
90
104
|
}
|
|
91
105
|
}
|
|
92
106
|
} //build image
|
|
@@ -103,6 +117,14 @@ pipeline {
|
|
|
103
117
|
}
|
|
104
118
|
}
|
|
105
119
|
}
|
|
120
|
+
docker.withRegistry('us-central1-docker.pkg.dev/toptal-hub/containers/') {
|
|
121
|
+
image.push(VERSION)
|
|
122
|
+
if(ALIAS_VERSIONS) {
|
|
123
|
+
ALIAS_VERSIONS.split(',').each { aliasVersion ->
|
|
124
|
+
image.push(aliasVersion)
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
106
128
|
success "== Pushed image with tag ${VERSION} =="
|
|
107
129
|
}
|
|
108
130
|
}
|
|
@@ -8,6 +8,7 @@ release_docker_image = null
|
|
|
8
8
|
repositoryName = REPOSITORY_NAME
|
|
9
9
|
repositorySSHUrl = "git@github.com:toptal/${repositoryName}.git"
|
|
10
10
|
releaseImageName = "${repositoryName}-release"
|
|
11
|
+
env.REPO_NAME_FOR_COMMIT = "toptal/${repositoryName}"
|
|
11
12
|
|
|
12
13
|
pipeline {
|
|
13
14
|
agent { label 'slave_aws' }
|
|
@@ -47,6 +48,7 @@ pipeline {
|
|
|
47
48
|
additionalBehaviours: [
|
|
48
49
|
cleanBeforeCheckout: true
|
|
49
50
|
])
|
|
51
|
+
script { env.COMMIT_FOR_ANVIL = gitCommit() }
|
|
50
52
|
success "== Checked out ${BRANCH} at ${gitCommit()}"
|
|
51
53
|
}
|
|
52
54
|
}
|
|
@@ -91,6 +93,20 @@ pipeline {
|
|
|
91
93
|
} else {
|
|
92
94
|
success "== Found '${releaseImageName}' image for version ${IMAGE_TAG} =="
|
|
93
95
|
}
|
|
96
|
+
|
|
97
|
+
if (!isDockerImagePresentRemotely("us-central1-docker.pkg.dev/toptal-hub/containers/${releaseImageName}", IMAGE_TAG)) {
|
|
98
|
+
release_docker_image = docker.build(
|
|
99
|
+
"us-central1-docker.pkg.dev/toptal-hub/containers/${releaseImageName}:${IMAGE_TAG}",
|
|
100
|
+
"""-f ./davinci/packages/ci/src/configs/docker/Dockerfile.release \
|
|
101
|
+
--build-arg REPO_NAME=${repositoryName} \
|
|
102
|
+
--build-arg VERSION=${IMAGE_TAG} \
|
|
103
|
+
--build-arg ENV_RUNTIME_ENTRYPOINT=./env-runtime.entrypoint.sh \
|
|
104
|
+
./${repositoryName}"""
|
|
105
|
+
)
|
|
106
|
+
success "== Built '${releaseImageName}' image for version ${IMAGE_TAG} =="
|
|
107
|
+
} else {
|
|
108
|
+
success "== Found '${releaseImageName}' image for version ${IMAGE_TAG} =="
|
|
109
|
+
}
|
|
94
110
|
}
|
|
95
111
|
} //steps
|
|
96
112
|
|
|
@@ -113,6 +129,14 @@ pipeline {
|
|
|
113
129
|
}
|
|
114
130
|
}
|
|
115
131
|
}
|
|
132
|
+
docker.withRegistry('us-central1-docker.pkg.dev/toptal-hub/containers/') {
|
|
133
|
+
release_docker_image.push(IMAGE_TAG)
|
|
134
|
+
if(ALIAS_IMAGE_TAGS) {
|
|
135
|
+
ALIAS_IMAGE_TAGS.split(',').each { aliasImageTag ->
|
|
136
|
+
release_docker_image.push(aliasImageTag)
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
116
140
|
success "== Pushed '${releaseImageName}' image for version ${IMAGE_TAG} =="
|
|
117
141
|
}
|
|
118
142
|
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<flow-definition plugin="workflow-job@2.35">
|
|
2
|
+
<actions>
|
|
3
|
+
<org.jenkinsci.plugins.pipeline.modeldefinition.actions.DeclarativeJobAction plugin="pipeline-model-definition@1.3.9" />
|
|
4
|
+
<org.jenkinsci.plugins.pipeline.modeldefinition.actions.DeclarativeJobPropertyTrackerAction plugin="pipeline-model-definition@1.3.9">
|
|
5
|
+
<jobProperties>
|
|
6
|
+
<string>jenkins.model.BuildDiscarderProperty</string>
|
|
7
|
+
</jobProperties>
|
|
8
|
+
<triggers />
|
|
9
|
+
<parameters>
|
|
10
|
+
<string>HELM_BRANCH</string>
|
|
11
|
+
<string>REPOSITORY_NAME</string>
|
|
12
|
+
<string>TAG</string>
|
|
13
|
+
<string>RELEASE</string>
|
|
14
|
+
<string>ENV</string>
|
|
15
|
+
</parameters>
|
|
16
|
+
<options>
|
|
17
|
+
<string>skipDefaultCheckout</string>
|
|
18
|
+
</options>
|
|
19
|
+
</org.jenkinsci.plugins.pipeline.modeldefinition.actions.DeclarativeJobPropertyTrackerAction>
|
|
20
|
+
</actions>
|
|
21
|
+
<description />
|
|
22
|
+
<keepDependencies>false</keepDependencies>
|
|
23
|
+
<properties>
|
|
24
|
+
<hudson.model.ParametersDefinitionProperty>
|
|
25
|
+
<parameterDefinitions>
|
|
26
|
+
<hudson.model.StringParameterDefinition>
|
|
27
|
+
<name>HELM_BRANCH</name>
|
|
28
|
+
<description>Helm branch</description>
|
|
29
|
+
<defaultValue>master</defaultValue>
|
|
30
|
+
<trim>false</trim>
|
|
31
|
+
</hudson.model.StringParameterDefinition>
|
|
32
|
+
<hudson.model.StringParameterDefinition>
|
|
33
|
+
<name>REPOSITORY_NAME</name>
|
|
34
|
+
<description>Name of repository</description>
|
|
35
|
+
<defaultValue />
|
|
36
|
+
<trim>false</trim>
|
|
37
|
+
</hudson.model.StringParameterDefinition>
|
|
38
|
+
<hudson.model.StringParameterDefinition>
|
|
39
|
+
<name>TAG</name>
|
|
40
|
+
<description>Image tag to deploy</description>
|
|
41
|
+
<defaultValue />
|
|
42
|
+
<trim>false</trim>
|
|
43
|
+
</hudson.model.StringParameterDefinition>
|
|
44
|
+
<hudson.model.StringParameterDefinition>
|
|
45
|
+
<name>RELEASE</name>
|
|
46
|
+
<description>Release name</description>
|
|
47
|
+
<defaultValue />
|
|
48
|
+
<trim>false</trim>
|
|
49
|
+
</hudson.model.StringParameterDefinition>
|
|
50
|
+
<hudson.model.StringParameterDefinition>
|
|
51
|
+
<name>ENV</name>
|
|
52
|
+
<description>Environment values in format ENV.key1=value1,ENV.key2=value2</description>
|
|
53
|
+
<defaultValue>ENV=null</defaultValue>
|
|
54
|
+
<trim>false</trim>
|
|
55
|
+
</hudson.model.StringParameterDefinition>
|
|
56
|
+
</parameterDefinitions>
|
|
57
|
+
</hudson.model.ParametersDefinitionProperty>
|
|
58
|
+
<hudson.plugins.jira.JiraProjectProperty plugin="jira@3.0.7" />
|
|
59
|
+
<jenkins.model.BuildDiscarderProperty>
|
|
60
|
+
<strategy class="hudson.tasks.LogRotator">
|
|
61
|
+
<daysToKeep>-1</daysToKeep>
|
|
62
|
+
<numToKeep>20</numToKeep>
|
|
63
|
+
<artifactDaysToKeep>-1</artifactDaysToKeep>
|
|
64
|
+
<artifactNumToKeep>-1</artifactNumToKeep>
|
|
65
|
+
</strategy>
|
|
66
|
+
</jenkins.model.BuildDiscarderProperty>
|
|
67
|
+
<com.sonyericsson.jenkins.plugins.bfa.model.ScannerJobProperty plugin="build-failure-analyzer@1.20.0">
|
|
68
|
+
<doNotScan>false</doNotScan>
|
|
69
|
+
</com.sonyericsson.jenkins.plugins.bfa.model.ScannerJobProperty>
|
|
70
|
+
<com.coravy.hudson.plugins.github.GithubProjectProperty plugin="github@1.29.4">
|
|
71
|
+
<projectUrl>$PROJECT_URL</projectUrl>
|
|
72
|
+
<displayName />
|
|
73
|
+
</com.coravy.hudson.plugins.github.GithubProjectProperty>
|
|
74
|
+
<hudson.plugins.throttleconcurrents.ThrottleJobProperty plugin="throttle-concurrents@2.0.1">
|
|
75
|
+
<maxConcurrentPerNode>0</maxConcurrentPerNode>
|
|
76
|
+
<maxConcurrentTotal>0</maxConcurrentTotal>
|
|
77
|
+
<categories class="java.util.concurrent.CopyOnWriteArrayList" />
|
|
78
|
+
<throttleEnabled>false</throttleEnabled>
|
|
79
|
+
<throttleOption>project</throttleOption>
|
|
80
|
+
<limitOneJobWithMatchingParams>false</limitOneJobWithMatchingParams>
|
|
81
|
+
<paramsToUseForLimit />
|
|
82
|
+
</hudson.plugins.throttleconcurrents.ThrottleJobProperty>
|
|
83
|
+
</properties>
|
|
84
|
+
<definition class="org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition" plugin="workflow-cps@2.74">
|
|
85
|
+
<scm class="hudson.plugins.git.GitSCM" plugin="git@3.10.1">
|
|
86
|
+
<configVersion>2</configVersion>
|
|
87
|
+
<userRemoteConfigs>
|
|
88
|
+
<hudson.plugins.git.UserRemoteConfig>
|
|
89
|
+
<url>git@github.com:toptal/inf-helm.git</url>
|
|
90
|
+
<credentialsId>jenkins-inf-helm</credentialsId>
|
|
91
|
+
</hudson.plugins.git.UserRemoteConfig>
|
|
92
|
+
</userRemoteConfigs>
|
|
93
|
+
<branches>
|
|
94
|
+
<hudson.plugins.git.BranchSpec>
|
|
95
|
+
<name>master</name>
|
|
96
|
+
</hudson.plugins.git.BranchSpec>
|
|
97
|
+
</branches>
|
|
98
|
+
<doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
|
|
99
|
+
<submoduleCfg class="list" />
|
|
100
|
+
<extensions />
|
|
101
|
+
</scm>
|
|
102
|
+
<scriptPath>Jenkinsfile</scriptPath>
|
|
103
|
+
<lightweight>true</lightweight>
|
|
104
|
+
</definition>
|
|
105
|
+
<triggers />
|
|
106
|
+
<disabled>false</disabled>
|
|
107
|
+
</flow-definition>
|
|
@@ -138,7 +138,7 @@ pipeline {
|
|
|
138
138
|
-e SENTRY_PROJECT=${REPOSITORY_NAME} \
|
|
139
139
|
-e SENTRY_AUTH_TOKEN=${SENTRY_AUTH_TOKEN} \
|
|
140
140
|
gcr.io/toptal-hub/${REPOSITORY_NAME}:${TAG} \
|
|
141
|
-
yarn davinci
|
|
141
|
+
yarn davinci-engine sentry-upload-source-maps
|
|
142
142
|
"""
|
|
143
143
|
} else {
|
|
144
144
|
info "Your current davinci version is not supporting uploading source maps to Sentry. Please update davinci package version in your app."
|
|
@@ -13,6 +13,7 @@ repositorySSHUrl = "git@github.com:toptal/${repositoryName}.git"
|
|
|
13
13
|
targetBranch = "master"
|
|
14
14
|
configDavinciYaml = "davinci.yaml"
|
|
15
15
|
def repoBullhornSlackChannel
|
|
16
|
+
env.REPO_NAME_FOR_COMMIT = "toptal/${repositoryName}"
|
|
16
17
|
|
|
17
18
|
buildImageJobName = "${repositoryName}-build-image"
|
|
18
19
|
buildReleaseImageJobName = "${repositoryName}-build-release-image"
|
|
@@ -96,6 +97,7 @@ pipeline {
|
|
|
96
97
|
|
|
97
98
|
info "Git commit: ${gitCommit()}"
|
|
98
99
|
info "Git branch: ${gitBranch()}"
|
|
100
|
+
script { env.COMMIT_FOR_ANVIL = gitCommit() }
|
|
99
101
|
success 'Checkout finished'
|
|
100
102
|
|
|
101
103
|
script {
|
|
@@ -258,25 +258,6 @@ pipeline {
|
|
|
258
258
|
}
|
|
259
259
|
} //stage
|
|
260
260
|
|
|
261
|
-
// TODO: temporary disabled
|
|
262
|
-
// enable with https://toptal-core.atlassian.net/browse/FX-1230
|
|
263
|
-
// stage('Report code coverage metrics') {
|
|
264
|
-
// steps {
|
|
265
|
-
// script {
|
|
266
|
-
// version = sh(returnStdout: true, script: "git log -n 1 --pretty=format:'%h'").trim()
|
|
267
|
-
|
|
268
|
-
// sh """
|
|
269
|
-
// docker run \
|
|
270
|
-
// -v ${pwd()}:/app/ \
|
|
271
|
-
// -v ${jenkinsTestsCoverageDirectory}:/app/${testsCoverageDirectory} \
|
|
272
|
-
// -e NPM_TOKEN=${NPM_TOKEN} \
|
|
273
|
-
// --rm gcr.io/toptal-hub/davinci-code-metrics:latest \
|
|
274
|
-
// sh -c \"yarn install --frozen-lockfile && yarn davinci qa code-metrics --login ${SONARQUBE_TOKEN} --name ${repositoryName} --version ${version} \"
|
|
275
|
-
// """
|
|
276
|
-
// }
|
|
277
|
-
// }
|
|
278
|
-
// } //stage
|
|
279
|
-
|
|
280
261
|
stage('Publish as package') {
|
|
281
262
|
when {
|
|
282
263
|
expression { return isEnabledInDavinciYaml("master", "publish_as_package") }
|
|
@@ -292,7 +273,7 @@ pipeline {
|
|
|
292
273
|
steps {
|
|
293
274
|
script {
|
|
294
275
|
PWD = sh(returnStdout: true, script: 'pwd').trim()
|
|
295
|
-
releasePackageCommand = 'yarn davinci
|
|
276
|
+
releasePackageCommand = 'yarn davinci-engine release-package'
|
|
296
277
|
|
|
297
278
|
def outputVersionParamExistsInDavinci = hasParamInDavinciCommand(
|
|
298
279
|
command: 'engine release-package',
|
|
@@ -392,10 +373,14 @@ pipeline {
|
|
|
392
373
|
|
|
393
374
|
steps {
|
|
394
375
|
script {
|
|
376
|
+
def packageJson = readJSON(file: 'package.json', returnPojo: true)
|
|
377
|
+
def hasIntegrationCmd = 'test:integration:ci' in (packageJson.scripts ?: [:])
|
|
378
|
+
def testCommand = hasIntegrationCmd ? 'integration' : 'e2e'
|
|
379
|
+
|
|
395
380
|
sh """
|
|
396
381
|
docker run \
|
|
397
382
|
--user="root" \
|
|
398
|
-
--rm gcr.io/toptal-hub/${repositoryName}:${commitId} /bin/bash -c "apt update && apt-get -y install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb && yarn cypress install > /dev/null && yarn test:
|
|
383
|
+
--rm gcr.io/toptal-hub/${repositoryName}:${commitId} /bin/bash -c "apt update && apt-get -y install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb && yarn cypress install > /dev/null && yarn test:$testCommand:ci"
|
|
399
384
|
"""
|
|
400
385
|
}
|
|
401
386
|
} //steps
|
|
@@ -15,6 +15,9 @@ commitId = params.GITHUB_PR_HEAD_SHA
|
|
|
15
15
|
repositoryName = repositoryUrl.tokenize('/').last().split("\\.")[0]
|
|
16
16
|
repositorySSHUrl = "git@github.com:toptal/${repositoryName}.git"
|
|
17
17
|
|
|
18
|
+
env.COMMIT_FOR_ANVIL = commitId
|
|
19
|
+
env.REPO_NAME_FOR_COMMIT = "toptal/${repositoryName}"
|
|
20
|
+
|
|
18
21
|
buildImageJobName = "${repositoryName}-build-image"
|
|
19
22
|
buildReleaseImageJobName = "${repositoryName}-build-release-image"
|
|
20
23
|
deployTemployJobName = "${repositoryName}-temploy-helm-run"
|
|
@@ -255,10 +258,14 @@ pipeline {
|
|
|
255
258
|
script {
|
|
256
259
|
ghHelper.notifyPR('Cypress Tests', 'PENDING', 'running', "${commitId}", "${BUILD_URL}", repositoryName)
|
|
257
260
|
|
|
261
|
+
def packageJson = readJSON(file: 'package.json', returnPojo: true)
|
|
262
|
+
def hasIntegrationCmd = 'test:integration:ci' in (packageJson.scripts ?: [:])
|
|
263
|
+
def testCommand = hasIntegrationCmd ? 'integration' : 'e2e'
|
|
264
|
+
|
|
258
265
|
sh """
|
|
259
266
|
docker run \
|
|
260
267
|
--user="root" \
|
|
261
|
-
--rm gcr.io/toptal-hub/${repositoryName}:${commitId} /bin/bash -c "apt update && apt-get -y install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb && yarn cypress install > /dev/null && yarn test:
|
|
268
|
+
--rm gcr.io/toptal-hub/${repositoryName}:${commitId} /bin/bash -c "apt update && apt-get -y install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb && yarn cypress install > /dev/null && yarn test:$testCommand:ci"
|
|
262
269
|
"""
|
|
263
270
|
}
|
|
264
271
|
} //steps
|
|
@@ -126,7 +126,7 @@ pipeline {
|
|
|
126
126
|
-v ${PWD}/.git:/app/.git \
|
|
127
127
|
gcr.io/toptal-hub/${repositoryName}:${commitId} \
|
|
128
128
|
/bin/bash -c "yarn ${params.BUILD_PACKAGE_SCRIPT_NAME} && \
|
|
129
|
-
yarn davinci
|
|
129
|
+
yarn davinci-engine publish-package \
|
|
130
130
|
--alpha \
|
|
131
131
|
--outputVersion /artifacts/.version \
|
|
132
132
|
--branch ${sourceBranch}"
|
|
@@ -23,6 +23,7 @@ pipeline {
|
|
|
23
23
|
string(name: 'TAG', defaultValue: '', description: 'Image tag to deploy')
|
|
24
24
|
string(name: 'RELEASE', defaultValue: '', description: 'Release name')
|
|
25
25
|
string(name: 'ENV', defaultValue: 'ENV=null', description: 'Environment values in format ENV.key1=value1,ENV.key2=value2')
|
|
26
|
+
string(name: 'DOCKER_REGISTRY', defaultValue: 'gcr.io/toptal-hub', description: 'Name of registry')
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
stages {
|
|
@@ -44,7 +45,7 @@ pipeline {
|
|
|
44
45
|
agent { docker { image "gcr.io/toptal-hub/helm:${helmVersion}" } }
|
|
45
46
|
|
|
46
47
|
environment {
|
|
47
|
-
GOOGLE_APPLICATION_CREDENTIALS = credentials("jenkins-
|
|
48
|
+
GOOGLE_APPLICATION_CREDENTIALS = credentials("jenkins-deployment")
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
steps {
|
|
@@ -62,7 +63,16 @@ pipeline {
|
|
|
62
63
|
|
|
63
64
|
success "== Checked out ${params.HELM_BRANCH} at ${gitCommit()}"
|
|
64
65
|
|
|
65
|
-
|
|
66
|
+
configuration = new helpers.JobHelper().readYaml('configuration.yml')
|
|
67
|
+
configurationName = "${params.REPOSITORY_NAME}-temploy-deployment"
|
|
68
|
+
data = configuration[configurationName]
|
|
69
|
+
|
|
70
|
+
if (data) {
|
|
71
|
+
chart = data.chart
|
|
72
|
+
} else {
|
|
73
|
+
chart = 'davinci-app'
|
|
74
|
+
}
|
|
75
|
+
|
|
66
76
|
sh """
|
|
67
77
|
export HELM_EXPERIMENTAL_OCI=1
|
|
68
78
|
|
|
@@ -72,19 +82,23 @@ pipeline {
|
|
|
72
82
|
gcloud auth application-default print-access-token | helm registry login -u oauth2accesstoken --password-stdin https://us-east1-docker.pkg.dev/toptal-hub/helm-repo
|
|
73
83
|
|
|
74
84
|
kubectl get namespace ${params.RELEASE} >/dev/null 2>&1 || kubectl create namespace ${params.RELEASE}
|
|
75
|
-
helm dependency build
|
|
85
|
+
helm dependency build charts/${chart}
|
|
76
86
|
|
|
77
87
|
if helm secrets upgrade \
|
|
78
88
|
--namespace=${params.RELEASE} \
|
|
79
89
|
--install --wait --timeout 240s \
|
|
80
|
-
-f helm_vars/
|
|
90
|
+
-f helm_vars/${chart}/temploy/values.yaml \
|
|
91
|
+
-f helm_vars/${chart}/temploy/secrets.yaml \
|
|
81
92
|
-f helm_vars/tls-certs/toptal.rocks/values.yaml \
|
|
82
93
|
-f helm_vars/tls-certs/toptal.rocks/secrets.yaml \
|
|
83
|
-
--set image.repository
|
|
94
|
+
--set image.repository=${params.DOCKER_REGISTRY}/${params.REPOSITORY_NAME}-release \
|
|
84
95
|
--set nameOverride=${params.REPOSITORY_NAME} \
|
|
85
96
|
--set-string image.tag=${params.TAG} \
|
|
97
|
+
--set davinci-app.image.repository=${params.DOCKER_REGISTRY}/${params.REPOSITORY_NAME}-release \
|
|
98
|
+
--set davinci-app.nameOverride=${params.REPOSITORY_NAME} \
|
|
99
|
+
--set-string davinci-app.image.tag=${params.TAG} \
|
|
86
100
|
--set ${params.ENV} \
|
|
87
|
-
${params.RELEASE}
|
|
101
|
+
${params.RELEASE} charts/${chart}
|
|
88
102
|
then
|
|
89
103
|
echo "\nHelm deploy succeeded!\n"
|
|
90
104
|
|
package/src/index.js
CHANGED
|
@@ -7,11 +7,11 @@ module.exports = {
|
|
|
7
7
|
plugins: {
|
|
8
8
|
conventionalCommit: {
|
|
9
9
|
PRTitle: conventionalCommitsPlugins.conventionalPRTitle,
|
|
10
|
-
commits: conventionalCommitsPlugins.conventionalCommits
|
|
10
|
+
commits: conventionalCommitsPlugins.conventionalCommits,
|
|
11
11
|
},
|
|
12
12
|
toptal: {
|
|
13
13
|
PRTitle: toptalPlugins.toptalPRTitle,
|
|
14
|
-
commits: toptalPlugins.toptalCommits
|
|
15
|
-
}
|
|
16
|
-
}
|
|
14
|
+
commits: toptalPlugins.toptalCommits,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
17
|
}
|