@toptal/davinci-ci 3.0.1-alpha-fix-davinci-metric-aa89cb08.10 → 3.0.1-alpha-chore-improve-packages-building-810f05ad.39
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/dist/commands/danger.d.ts +11 -0
- package/dist/commands/danger.js +64 -0
- package/dist/configs/danger/conventional-commits/dangerfile.d.ts +1 -0
- package/dist/configs/danger/conventional-commits/dangerfile.js +12 -0
- package/dist/configs/danger/conventional-commits/plugins/conventional-commits/index.d.ts +1 -0
- package/dist/configs/danger/conventional-commits/plugins/conventional-commits/index.js +99 -0
- package/dist/configs/danger/conventional-commits/plugins/conventional-pr-title/index.d.ts +1 -0
- package/dist/configs/danger/conventional-commits/plugins/conventional-pr-title/index.js +94 -0
- package/dist/configs/danger/conventional-commits/plugins/index.d.ts +3 -0
- package/dist/configs/danger/conventional-commits/plugins/index.js +7 -0
- package/dist/configs/danger/plugins/empty-assignee.d.ts +1 -0
- package/dist/configs/danger/plugins/empty-assignee.js +18 -0
- package/dist/configs/danger/toptal/config.d.ts +7 -0
- package/dist/configs/danger/toptal/config.js +27 -0
- package/dist/configs/danger/toptal/dangerfile.d.ts +1 -0
- package/dist/configs/danger/toptal/dangerfile.js +12 -0
- package/dist/configs/danger/toptal/plugins/index.d.ts +3 -0
- package/dist/configs/danger/toptal/plugins/index.js +7 -0
- package/dist/configs/danger/toptal/plugins/toptal-commits/index.d.ts +1 -0
- package/dist/configs/danger/toptal/plugins/toptal-commits/index.js +51 -0
- package/dist/configs/danger/toptal/plugins/toptal-pr-title/index.d.ts +1 -0
- package/dist/configs/danger/toptal/plugins/toptal-pr-title/index.js +45 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +17 -0
- package/package.json +9 -6
- package/CHANGELOG.md +0 -978
- package/src/commands/danger.js +0 -67
- package/src/configs/danger/conventional-commits/dangerfile.js +0 -17
- package/src/configs/danger/conventional-commits/plugins/conventional-commits/index.js +0 -52
- package/src/configs/danger/conventional-commits/plugins/conventional-pr-title/index.js +0 -53
- package/src/configs/danger/conventional-commits/plugins/index.js +0 -7
- package/src/configs/danger/plugins/empty-assignee.js +0 -24
- package/src/configs/danger/toptal/config.js +0 -30
- package/src/configs/danger/toptal/dangerfile.js +0 -17
- package/src/configs/danger/toptal/plugins/index.js +0 -7
- package/src/configs/danger/toptal/plugins/toptal-commits/index.js +0 -73
- package/src/configs/danger/toptal/plugins/toptal-pr-title/index.js +0 -62
- package/src/configs/docker/Dockerfile +0 -30
- package/src/configs/docker/Dockerfile.gha-deploy +0 -33
- package/src/configs/docker/Dockerfile.release +0 -28
- package/src/configs/docker/Dockerfile.storybook +0 -20
- package/src/configs/docker/env-runtime.entrypoint.sh +0 -47
- package/src/configs/docker/nginx-vhost-storybook.conf +0 -20
- package/src/configs/docker/nginx-vhost.conf +0 -18
- package/src/configs/jobs/build-image/Jenkinsfile +0 -142
- package/src/configs/jobs/build-image/config.xml +0 -119
- package/src/configs/jobs/build-release-image/Jenkinsfile +0 -154
- package/src/configs/jobs/build-release-image/config.xml +0 -102
- package/src/configs/jobs/consumer-contracts-verify/Jenkinsfile +0 -117
- package/src/configs/jobs/consumer-contracts-verify/config.xml +0 -114
- package/src/configs/jobs/deploy/config.xml +0 -107
- package/src/configs/jobs/deploy-helm-run/Jenkinsfile +0 -159
- package/src/configs/jobs/deploy-helm-run/config.xml +0 -107
- package/src/configs/jobs/deploy-helm-run-trigger/Jenkinsfile +0 -200
- package/src/configs/jobs/master-main/Jenkinsfile +0 -460
- package/src/configs/jobs/master-main/config.xml +0 -119
- package/src/configs/jobs/pr-tests/Jenkinsfile +0 -407
- package/src/configs/jobs/pr-tests/config.xml +0 -134
- package/src/configs/jobs/publish-alpha-package/Jenkinsfile +0 -189
- package/src/configs/jobs/publish-alpha-package/config.xml +0 -136
- package/src/configs/jobs/temploy-helm-run/Jenkinsfile +0 -141
- package/src/configs/jobs/temploy-helm-run/config.xml +0 -97
- package/src/index.js +0 -17
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
@Library('globalLibrary@master') _
|
|
2
|
-
|
|
3
|
-
image = null
|
|
4
|
-
|
|
5
|
-
repositoryName = REPOSITORY_NAME
|
|
6
|
-
repositorySSHUrl = "git@github.com:toptal/${repositoryName}.git"
|
|
7
|
-
env.REPO_NAME_FOR_COMMIT = "toptal/${repositoryName}"
|
|
8
|
-
|
|
9
|
-
pipeline {
|
|
10
|
-
agent { label 'slave_aws' }
|
|
11
|
-
|
|
12
|
-
options {
|
|
13
|
-
ansiColor('xterm')
|
|
14
|
-
timestamps()
|
|
15
|
-
timeout(time: params.TIMEOUT, unit: 'MINUTES')
|
|
16
|
-
buildDiscarder(logRotator(numToKeepStr: '20'))
|
|
17
|
-
skipDefaultCheckout()
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
parameters {
|
|
21
|
-
string(name: 'BRANCH', defaultValue: 'master', description: 'Branch or tag to build')
|
|
22
|
-
string(name: 'IMAGE_NAME', description: 'Image name')
|
|
23
|
-
string(name: 'VERSION', description: 'Tag for the created docker image')
|
|
24
|
-
string(name: 'ALIAS_VERSIONS', defaultValue: "", description: 'Comma separated list of alias tags for the created docker image. Ex: "master,latest"')
|
|
25
|
-
string(name: 'REPOSITORY_NAME', description: 'Repository name')
|
|
26
|
-
string(name: 'DAVINCI_BRANCH', defaultValue: 'master', description: 'Davinci branch to checkout')
|
|
27
|
-
string(name: 'TIMEOUT', defaultValue: '25', description: 'Timeout value for the job (in minutes)')
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
environment {
|
|
31
|
-
GCE_ACCOUNT_KEY = credentials('jenkins-storage-administrator')
|
|
32
|
-
NPM_TOKEN = credentials('npm-token-for-toptal-private-registry')
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
stages {
|
|
36
|
-
|
|
37
|
-
stage('Git checkouts') {
|
|
38
|
-
parallel {
|
|
39
|
-
|
|
40
|
-
stage('Git checkout project') {
|
|
41
|
-
steps {
|
|
42
|
-
dir(repositoryName) {
|
|
43
|
-
info "== Checking out ${BRANCH} =="
|
|
44
|
-
gitCheckout(
|
|
45
|
-
branches: BRANCH,
|
|
46
|
-
credentials: [username: 'toptal-build', description: "toptal-build-ssh-key"],
|
|
47
|
-
url: repositorySSHUrl,
|
|
48
|
-
additionalBehaviours: [
|
|
49
|
-
cleanBeforeCheckout: true
|
|
50
|
-
])
|
|
51
|
-
script { env.COMMIT_FOR_ANVIL = gitCommit() }
|
|
52
|
-
success "== Checked out ${BRANCH} at ${gitCommit()}"
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
} //checkout project
|
|
56
|
-
|
|
57
|
-
stage('Git checkout davinci') {
|
|
58
|
-
steps {
|
|
59
|
-
dir('davinci') {
|
|
60
|
-
info "== Checking out davinci=="
|
|
61
|
-
gitCheckout(
|
|
62
|
-
branches: DAVINCI_BRANCH,
|
|
63
|
-
credentials: [username: 'toptal-build', description: "toptal-build-ssh-key"],
|
|
64
|
-
url: 'git@github.com:toptal/davinci.git',
|
|
65
|
-
additionalBehaviours: [
|
|
66
|
-
cleanBeforeCheckout: true,
|
|
67
|
-
])
|
|
68
|
-
success "== Checked out"
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
} //checkout davinci
|
|
72
|
-
|
|
73
|
-
} // parallel
|
|
74
|
-
} //checkout
|
|
75
|
-
|
|
76
|
-
stage('Build image') {
|
|
77
|
-
steps {
|
|
78
|
-
script {
|
|
79
|
-
sh "gcloud auth activate-service-account --key-file=$GCE_ACCOUNT_KEY"
|
|
80
|
-
|
|
81
|
-
if (!isDockerImagePresentRemotely("gcr.io/toptal-hub/${IMAGE_NAME}", VERSION)) {
|
|
82
|
-
image = docker.build(
|
|
83
|
-
"toptal-hub/${IMAGE_NAME}:${VERSION}",
|
|
84
|
-
"""-f ./davinci/packages/ci/src/configs/docker/Dockerfile \
|
|
85
|
-
--build-arg NPM_TOKEN=${NPM_TOKEN} \
|
|
86
|
-
./${repositoryName}"""
|
|
87
|
-
)
|
|
88
|
-
success "== Built image for version ${VERSION} =="
|
|
89
|
-
} else {
|
|
90
|
-
success "== Found image for version ${VERSION} =="
|
|
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
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
} //build image
|
|
107
|
-
|
|
108
|
-
stage('Push image') {
|
|
109
|
-
steps {
|
|
110
|
-
script {
|
|
111
|
-
if (image) {
|
|
112
|
-
docker.withRegistry('https://gcr.io/toptal-hub/') {
|
|
113
|
-
image.push(VERSION)
|
|
114
|
-
if(ALIAS_VERSIONS) {
|
|
115
|
-
ALIAS_VERSIONS.split(',').each { aliasVersion ->
|
|
116
|
-
image.push(aliasVersion)
|
|
117
|
-
}
|
|
118
|
-
}
|
|
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
|
-
}
|
|
128
|
-
success "== Pushed image with tag ${VERSION} =="
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
} //push image
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
post {
|
|
136
|
-
always {
|
|
137
|
-
script {
|
|
138
|
-
sendBuildData(currentBuild)
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
@@ -1,119 +0,0 @@
|
|
|
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>BRANCH</string>
|
|
11
|
-
<string>IMAGE_NAME</string>
|
|
12
|
-
<string>VERSION</string>
|
|
13
|
-
<string>ALIAS_VERSIONS</string>
|
|
14
|
-
<string>REPOSITORY_NAME</string>
|
|
15
|
-
<string>DAVINCI_BRANCH</string>
|
|
16
|
-
<string>TIMEOUT</string>
|
|
17
|
-
</parameters>
|
|
18
|
-
<options>
|
|
19
|
-
<string>skipDefaultCheckout</string>
|
|
20
|
-
</options>
|
|
21
|
-
</org.jenkinsci.plugins.pipeline.modeldefinition.actions.DeclarativeJobPropertyTrackerAction>
|
|
22
|
-
</actions>
|
|
23
|
-
<description></description>
|
|
24
|
-
<keepDependencies>false</keepDependencies>
|
|
25
|
-
<properties>
|
|
26
|
-
<hudson.model.ParametersDefinitionProperty>
|
|
27
|
-
<parameterDefinitions>
|
|
28
|
-
<hudson.model.StringParameterDefinition>
|
|
29
|
-
<name>BRANCH</name>
|
|
30
|
-
<description>Branch or tag to build</description>
|
|
31
|
-
<defaultValue>master</defaultValue>
|
|
32
|
-
<trim>false</trim>
|
|
33
|
-
</hudson.model.StringParameterDefinition>
|
|
34
|
-
<hudson.model.StringParameterDefinition>
|
|
35
|
-
<name>IMAGE_NAME</name>
|
|
36
|
-
<description>Image name</description>
|
|
37
|
-
<trim>false</trim>
|
|
38
|
-
</hudson.model.StringParameterDefinition>
|
|
39
|
-
<hudson.model.StringParameterDefinition>
|
|
40
|
-
<name>VERSION</name>
|
|
41
|
-
<description>Tag for the created docker image</description>
|
|
42
|
-
<trim>false</trim>
|
|
43
|
-
</hudson.model.StringParameterDefinition>
|
|
44
|
-
<hudson.model.StringParameterDefinition>
|
|
45
|
-
<name>ALIAS_VERSIONS</name>
|
|
46
|
-
<description>Comma separated list of alias tags for the created docker image. Ex: "master,latest"</description>
|
|
47
|
-
<defaultValue></defaultValue>
|
|
48
|
-
<trim>false</trim>
|
|
49
|
-
</hudson.model.StringParameterDefinition>
|
|
50
|
-
<hudson.model.StringParameterDefinition>
|
|
51
|
-
<name>REPOSITORY_NAME</name>
|
|
52
|
-
<description>Repository name</description>
|
|
53
|
-
<trim>false</trim>
|
|
54
|
-
</hudson.model.StringParameterDefinition>
|
|
55
|
-
<hudson.model.StringParameterDefinition>
|
|
56
|
-
<name>DAVINCI_BRANCH</name>
|
|
57
|
-
<description>Davinci branch to checkout</description>
|
|
58
|
-
<defaultValue>master</defaultValue>
|
|
59
|
-
<trim>false</trim>
|
|
60
|
-
</hudson.model.StringParameterDefinition>
|
|
61
|
-
<hudson.model.StringParameterDefinition>
|
|
62
|
-
<name>TIMEOUT</name>
|
|
63
|
-
<description>Timeout value for the job (in minutes)</description>
|
|
64
|
-
<defaultValue>25</defaultValue>
|
|
65
|
-
<trim>false</trim>
|
|
66
|
-
</hudson.model.StringParameterDefinition>
|
|
67
|
-
</parameterDefinitions>
|
|
68
|
-
</hudson.model.ParametersDefinitionProperty>
|
|
69
|
-
<jenkins.model.BuildDiscarderProperty>
|
|
70
|
-
<strategy class="hudson.tasks.LogRotator">
|
|
71
|
-
<daysToKeep>-1</daysToKeep>
|
|
72
|
-
<numToKeep>20</numToKeep>
|
|
73
|
-
<artifactDaysToKeep>-1</artifactDaysToKeep>
|
|
74
|
-
<artifactNumToKeep>-1</artifactNumToKeep>
|
|
75
|
-
</strategy>
|
|
76
|
-
</jenkins.model.BuildDiscarderProperty>
|
|
77
|
-
<hudson.plugins.jira.JiraProjectProperty plugin="jira@3.0.7"/>
|
|
78
|
-
<com.sonyericsson.jenkins.plugins.bfa.model.ScannerJobProperty plugin="build-failure-analyzer@1.20.0">
|
|
79
|
-
<doNotScan>false</doNotScan>
|
|
80
|
-
</com.sonyericsson.jenkins.plugins.bfa.model.ScannerJobProperty>
|
|
81
|
-
<com.coravy.hudson.plugins.github.GithubProjectProperty plugin="github@1.29.4">
|
|
82
|
-
<projectUrl>$PROJECT_URL</projectUrl>
|
|
83
|
-
<displayName></displayName>
|
|
84
|
-
</com.coravy.hudson.plugins.github.GithubProjectProperty>
|
|
85
|
-
<hudson.plugins.throttleconcurrents.ThrottleJobProperty plugin="throttle-concurrents@2.0.1">
|
|
86
|
-
<maxConcurrentPerNode>0</maxConcurrentPerNode>
|
|
87
|
-
<maxConcurrentTotal>0</maxConcurrentTotal>
|
|
88
|
-
<categories class="java.util.concurrent.CopyOnWriteArrayList"/>
|
|
89
|
-
<throttleEnabled>false</throttleEnabled>
|
|
90
|
-
<throttleOption>project</throttleOption>
|
|
91
|
-
<limitOneJobWithMatchingParams>false</limitOneJobWithMatchingParams>
|
|
92
|
-
<paramsToUseForLimit></paramsToUseForLimit>
|
|
93
|
-
<configVersion>1</configVersion>
|
|
94
|
-
</hudson.plugins.throttleconcurrents.ThrottleJobProperty>
|
|
95
|
-
</properties>
|
|
96
|
-
<definition class="org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition" plugin="workflow-cps@2.74">
|
|
97
|
-
<scm class="hudson.plugins.git.GitSCM" plugin="git@3.10.1">
|
|
98
|
-
<configVersion>2</configVersion>
|
|
99
|
-
<userRemoteConfigs>
|
|
100
|
-
<hudson.plugins.git.UserRemoteConfig>
|
|
101
|
-
<url>git@github.com:toptal/davinci.git</url>
|
|
102
|
-
<credentialsId>$CREDENTIALS_ID</credentialsId>
|
|
103
|
-
</hudson.plugins.git.UserRemoteConfig>
|
|
104
|
-
</userRemoteConfigs>
|
|
105
|
-
<branches>
|
|
106
|
-
<hudson.plugins.git.BranchSpec>
|
|
107
|
-
<name>master</name>
|
|
108
|
-
</hudson.plugins.git.BranchSpec>
|
|
109
|
-
</branches>
|
|
110
|
-
<doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
|
|
111
|
-
<submoduleCfg class="list"/>
|
|
112
|
-
<extensions/>
|
|
113
|
-
</scm>
|
|
114
|
-
<scriptPath>packages/ci/src/configs/jobs/build-image/Jenkinsfile</scriptPath>
|
|
115
|
-
<lightweight>true</lightweight>
|
|
116
|
-
</definition>
|
|
117
|
-
<triggers/>
|
|
118
|
-
<disabled>false</disabled>
|
|
119
|
-
</flow-definition>
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
@Library('globalLibrary@master') _
|
|
2
|
-
|
|
3
|
-
ghHelper = new helpers.GithubNotifyHelper()
|
|
4
|
-
helper = new helpers.Helpers()
|
|
5
|
-
|
|
6
|
-
release_docker_image = null
|
|
7
|
-
|
|
8
|
-
repositoryName = REPOSITORY_NAME
|
|
9
|
-
repositorySSHUrl = "git@github.com:toptal/${repositoryName}.git"
|
|
10
|
-
releaseImageName = "${repositoryName}-release"
|
|
11
|
-
env.REPO_NAME_FOR_COMMIT = "toptal/${repositoryName}"
|
|
12
|
-
|
|
13
|
-
pipeline {
|
|
14
|
-
agent { label 'slave_aws' }
|
|
15
|
-
|
|
16
|
-
options {
|
|
17
|
-
ansiColor('xterm')
|
|
18
|
-
timestamps()
|
|
19
|
-
timeout(time: 15, unit: 'MINUTES')
|
|
20
|
-
buildDiscarder(logRotator(daysToKeepStr: '5'))
|
|
21
|
-
skipDefaultCheckout()
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
parameters {
|
|
25
|
-
string(name: 'BRANCH', defaultValue: 'master', description: 'Branch or tag to build')
|
|
26
|
-
string(name: 'DAVINCI_BRANCH', defaultValue: 'master', description: 'Davinci branch')
|
|
27
|
-
string(name: 'IMAGE_TAG', description: 'Docker tag of the image with dist folder which we are going to deploy')
|
|
28
|
-
string(name: 'ALIAS_IMAGE_TAGS', defaultValue: "", description: 'Comma separated list of alias tags for the created docker image. Ex: "master,latest"')
|
|
29
|
-
string(name: 'REPOSITORY_NAME', description: 'Repository name')
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
environment {
|
|
33
|
-
GCE_ACCOUNT_KEY = credentials('jenkins-storage-administrator')
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
stages {
|
|
37
|
-
stage('Git checkouts') {
|
|
38
|
-
parallel {
|
|
39
|
-
|
|
40
|
-
stage('Git checkout project') {
|
|
41
|
-
steps {
|
|
42
|
-
dir(repositoryName) {
|
|
43
|
-
info "== Checking out ${BRANCH} =="
|
|
44
|
-
gitCheckout(
|
|
45
|
-
branches: BRANCH,
|
|
46
|
-
credentials: [username: 'toptal-build', description: "toptal-build-ssh-key"],
|
|
47
|
-
url: repositorySSHUrl,
|
|
48
|
-
additionalBehaviours: [
|
|
49
|
-
cleanBeforeCheckout: true
|
|
50
|
-
])
|
|
51
|
-
script { env.COMMIT_FOR_ANVIL = gitCommit() }
|
|
52
|
-
success "== Checked out ${BRANCH} at ${gitCommit()}"
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
} //checkout project
|
|
56
|
-
|
|
57
|
-
stage('Git checkout davinci') {
|
|
58
|
-
steps {
|
|
59
|
-
dir('davinci') {
|
|
60
|
-
info "== Checking out davinci=="
|
|
61
|
-
gitCheckout(
|
|
62
|
-
branches: DAVINCI_BRANCH,
|
|
63
|
-
credentials: [username: 'toptal-build', description: "toptal-build-ssh-key"],
|
|
64
|
-
url: 'git@github.com:toptal/davinci.git',
|
|
65
|
-
additionalBehaviours: [
|
|
66
|
-
cleanBeforeCheckout: true,
|
|
67
|
-
])
|
|
68
|
-
success "== Checked out"
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
} //checkout davinci
|
|
72
|
-
|
|
73
|
-
} // parallel
|
|
74
|
-
} //checkout
|
|
75
|
-
|
|
76
|
-
stage('Build docker image') {
|
|
77
|
-
steps {
|
|
78
|
-
info "== Building new docker image"
|
|
79
|
-
script {
|
|
80
|
-
sh "gcloud auth activate-service-account --key-file=$GCE_ACCOUNT_KEY"
|
|
81
|
-
sh "cp ./davinci/packages/ci/src/configs/docker/env-runtime.entrypoint.sh ./${repositoryName}/env-runtime.entrypoint.sh"
|
|
82
|
-
|
|
83
|
-
if (!isDockerImagePresentRemotely("gcr.io/toptal-hub/${releaseImageName}", IMAGE_TAG)) {
|
|
84
|
-
release_docker_image = docker.build(
|
|
85
|
-
"gcr.io/toptal-hub/${releaseImageName}:${IMAGE_TAG}",
|
|
86
|
-
"""-f ./davinci/packages/ci/src/configs/docker/Dockerfile.release \
|
|
87
|
-
--build-arg REPO_NAME=${repositoryName} \
|
|
88
|
-
--build-arg VERSION=${IMAGE_TAG} \
|
|
89
|
-
--build-arg ENV_RUNTIME_ENTRYPOINT=./env-runtime.entrypoint.sh \
|
|
90
|
-
./${repositoryName}"""
|
|
91
|
-
)
|
|
92
|
-
success "== Built '${releaseImageName}' image for version ${IMAGE_TAG} =="
|
|
93
|
-
} else {
|
|
94
|
-
success "== Found '${releaseImageName}' image for version ${IMAGE_TAG} =="
|
|
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
|
-
}
|
|
110
|
-
}
|
|
111
|
-
} //steps
|
|
112
|
-
|
|
113
|
-
post {
|
|
114
|
-
always {
|
|
115
|
-
sh "rm ./${repositoryName}/env-runtime.entrypoint.sh"
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
} //stage
|
|
119
|
-
|
|
120
|
-
stage('Push docker image for release') {
|
|
121
|
-
steps {
|
|
122
|
-
script {
|
|
123
|
-
if (release_docker_image) {
|
|
124
|
-
docker.withRegistry('https://gcr.io/toptal-hub/') {
|
|
125
|
-
release_docker_image.push(IMAGE_TAG)
|
|
126
|
-
if(ALIAS_IMAGE_TAGS) {
|
|
127
|
-
ALIAS_IMAGE_TAGS.split(',').each { aliasImageTag ->
|
|
128
|
-
release_docker_image.push(aliasImageTag)
|
|
129
|
-
}
|
|
130
|
-
}
|
|
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
|
-
}
|
|
140
|
-
success "== Pushed '${releaseImageName}' image for version ${IMAGE_TAG} =="
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
} //steps
|
|
144
|
-
} //stage
|
|
145
|
-
}//stages
|
|
146
|
-
|
|
147
|
-
post {
|
|
148
|
-
always {
|
|
149
|
-
script {
|
|
150
|
-
sendBuildData(currentBuild)
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}//pipeline
|
|
@@ -1,102 +0,0 @@
|
|
|
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
|
-
<triggers/>
|
|
7
|
-
<parameters>
|
|
8
|
-
<string>BRANCH</string>
|
|
9
|
-
<string>IMAGE_TAG</string>
|
|
10
|
-
<string>ALIAS_IMAGE_TAGS</string>
|
|
11
|
-
<string>REPOSITORY_NAME</string>
|
|
12
|
-
</parameters>
|
|
13
|
-
<options>
|
|
14
|
-
<string>skipDefaultCheckout</string>
|
|
15
|
-
</options>
|
|
16
|
-
</org.jenkinsci.plugins.pipeline.modeldefinition.actions.DeclarativeJobPropertyTrackerAction>
|
|
17
|
-
</actions>
|
|
18
|
-
<description></description>
|
|
19
|
-
<keepDependencies>false</keepDependencies>
|
|
20
|
-
<properties>
|
|
21
|
-
<hudson.model.ParametersDefinitionProperty>
|
|
22
|
-
<parameterDefinitions>
|
|
23
|
-
<hudson.model.StringParameterDefinition>
|
|
24
|
-
<name>BRANCH</name>
|
|
25
|
-
<description>Branch or tag to build</description>
|
|
26
|
-
<defaultValue>master</defaultValue>
|
|
27
|
-
<trim>false</trim>
|
|
28
|
-
</hudson.model.StringParameterDefinition>
|
|
29
|
-
<hudson.model.StringParameterDefinition>
|
|
30
|
-
<name>DAVINCI_BRANCH</name>
|
|
31
|
-
<description>Davinci branch</description>
|
|
32
|
-
<defaultValue>master</defaultValue>
|
|
33
|
-
<trim>false</trim>
|
|
34
|
-
</hudson.model.StringParameterDefinition>
|
|
35
|
-
<hudson.model.StringParameterDefinition>
|
|
36
|
-
<name>IMAGE_TAG</name>
|
|
37
|
-
<description>Docker tag of the image with dist folder which we are going to deploy</description>
|
|
38
|
-
<trim>false</trim>
|
|
39
|
-
</hudson.model.StringParameterDefinition>
|
|
40
|
-
<hudson.model.StringParameterDefinition>
|
|
41
|
-
<name>ALIAS_IMAGE_TAGS</name>
|
|
42
|
-
<description>Comma separated list of alias tags for the created docker image. Ex: "master,latest"</description>
|
|
43
|
-
<trim>false</trim>
|
|
44
|
-
</hudson.model.StringParameterDefinition>
|
|
45
|
-
<hudson.model.StringParameterDefinition>
|
|
46
|
-
<name>REPOSITORY_NAME</name>
|
|
47
|
-
<description>Repository name</description>
|
|
48
|
-
<trim>false</trim>
|
|
49
|
-
</hudson.model.StringParameterDefinition>
|
|
50
|
-
</parameterDefinitions>
|
|
51
|
-
</hudson.model.ParametersDefinitionProperty>
|
|
52
|
-
<hudson.plugins.jira.JiraProjectProperty plugin="jira@3.0.7"/>
|
|
53
|
-
<jenkins.model.BuildDiscarderProperty>
|
|
54
|
-
<strategy class="hudson.tasks.LogRotator">
|
|
55
|
-
<daysToKeep>-1</daysToKeep>
|
|
56
|
-
<numToKeep>20</numToKeep>
|
|
57
|
-
<artifactDaysToKeep>-1</artifactDaysToKeep>
|
|
58
|
-
<artifactNumToKeep>-1</artifactNumToKeep>
|
|
59
|
-
</strategy>
|
|
60
|
-
</jenkins.model.BuildDiscarderProperty>
|
|
61
|
-
<com.sonyericsson.jenkins.plugins.bfa.model.ScannerJobProperty plugin="build-failure-analyzer@1.20.0">
|
|
62
|
-
<doNotScan>false</doNotScan>
|
|
63
|
-
</com.sonyericsson.jenkins.plugins.bfa.model.ScannerJobProperty>
|
|
64
|
-
<com.coravy.hudson.plugins.github.GithubProjectProperty plugin="github@1.29.4">
|
|
65
|
-
<projectUrl>$PROJECT_URL</projectUrl>
|
|
66
|
-
<displayName></displayName>
|
|
67
|
-
</com.coravy.hudson.plugins.github.GithubProjectProperty>
|
|
68
|
-
<hudson.plugins.throttleconcurrents.ThrottleJobProperty plugin="throttle-concurrents@2.0.1">
|
|
69
|
-
<maxConcurrentPerNode>0</maxConcurrentPerNode>
|
|
70
|
-
<maxConcurrentTotal>0</maxConcurrentTotal>
|
|
71
|
-
<categories class="java.util.concurrent.CopyOnWriteArrayList"/>
|
|
72
|
-
<throttleEnabled>false</throttleEnabled>
|
|
73
|
-
<throttleOption>project</throttleOption>
|
|
74
|
-
<limitOneJobWithMatchingParams>false</limitOneJobWithMatchingParams>
|
|
75
|
-
<paramsToUseForLimit></paramsToUseForLimit>
|
|
76
|
-
<configVersion>1</configVersion>
|
|
77
|
-
</hudson.plugins.throttleconcurrents.ThrottleJobProperty>
|
|
78
|
-
</properties>
|
|
79
|
-
<definition class="org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition" plugin="workflow-cps@2.74">
|
|
80
|
-
<scm class="hudson.plugins.git.GitSCM" plugin="git@3.10.1">
|
|
81
|
-
<configVersion>2</configVersion>
|
|
82
|
-
<userRemoteConfigs>
|
|
83
|
-
<hudson.plugins.git.UserRemoteConfig>
|
|
84
|
-
<url>git@github.com:toptal/davinci.git</url>
|
|
85
|
-
<credentialsId>$CREDENTIALS_ID</credentialsId>
|
|
86
|
-
</hudson.plugins.git.UserRemoteConfig>
|
|
87
|
-
</userRemoteConfigs>
|
|
88
|
-
<branches>
|
|
89
|
-
<hudson.plugins.git.BranchSpec>
|
|
90
|
-
<name>master</name>
|
|
91
|
-
</hudson.plugins.git.BranchSpec>
|
|
92
|
-
</branches>
|
|
93
|
-
<doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
|
|
94
|
-
<submoduleCfg class="list"/>
|
|
95
|
-
<extensions/>
|
|
96
|
-
</scm>
|
|
97
|
-
<scriptPath>packages/ci/src/configs/jobs/build-release-image/Jenkinsfile</scriptPath>
|
|
98
|
-
<lightweight>false</lightweight>
|
|
99
|
-
</definition>
|
|
100
|
-
<triggers/>
|
|
101
|
-
<disabled>false</disabled>
|
|
102
|
-
</flow-definition>
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
@Library('globalLibrary@master') _
|
|
2
|
-
|
|
3
|
-
githubHelper = new helpers.GithubNotifyHelper()
|
|
4
|
-
jobHelper = new helpers.JobHelper()
|
|
5
|
-
Map configuration = [:]
|
|
6
|
-
|
|
7
|
-
notificationType = params.NOTIFICATION_TYPE
|
|
8
|
-
gitCommitId = params.GIT_COMMIT
|
|
9
|
-
consumer = params.CONSUMER
|
|
10
|
-
brokerURL = params.PACT_BROKER_URL
|
|
11
|
-
branchName = params.GITHUB_BRANCH_NAME
|
|
12
|
-
repositoryUrl = params.GITHUB_REPO_GIT_URL
|
|
13
|
-
|
|
14
|
-
repositoryName = repositoryUrl.tokenize('/').last().split("\\.")[0]
|
|
15
|
-
repositorySSHUrl = "git@github.com:toptal/${repositoryName}.git"
|
|
16
|
-
|
|
17
|
-
pipeline {
|
|
18
|
-
parameters {
|
|
19
|
-
string(name: 'NOTIFICATION_TYPE', description: 'Type of notification this job will send. Possible values: github, slack')
|
|
20
|
-
string(name: 'CONSUMER', description: "Name of the consumer, e.g. 'Staff Portal'")
|
|
21
|
-
string(name: 'PACT_BROKER_URL', defaultValue:'https://pact-broker.toptal.net', description: "Example 'https://pact-broker.toptal.net'")
|
|
22
|
-
string(name: 'GIT_COMMIT', description: 'Git commit which is used as a PACT contract version')
|
|
23
|
-
string(name: 'GITHUB_BRANCH_NAME', description: 'Branch to build')
|
|
24
|
-
string(name: 'GITHUB_REPO_GIT_URL', description: 'Repository URL')
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
agent {
|
|
28
|
-
docker {
|
|
29
|
-
image 'pactfoundation/pact-cli'
|
|
30
|
-
args """
|
|
31
|
-
--entrypoint "" --interactive \
|
|
32
|
-
--tty --user root
|
|
33
|
-
"""
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
options {
|
|
38
|
-
ansiColor('xterm')
|
|
39
|
-
skipDefaultCheckout()
|
|
40
|
-
timestamps()
|
|
41
|
-
timeout(time: 20, unit: 'MINUTES')
|
|
42
|
-
buildDiscarder(logRotator(daysToKeepStr: '3'))
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
environment {
|
|
46
|
-
PACT_BROKER = credentials('pact-broker')
|
|
47
|
-
SLACK_NOTIFICATION_CHANNEL = "${repositoryName}-bullhorn"
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
stages {
|
|
51
|
-
stage('Run can-i-deploy contracts verification') {
|
|
52
|
-
steps {
|
|
53
|
-
script {
|
|
54
|
-
info "Contract version is ${gitCommitId}"
|
|
55
|
-
|
|
56
|
-
if (notificationType == 'github') {
|
|
57
|
-
githubHelper.notifyPR(
|
|
58
|
-
'Consumer contracts: production', 'PENDING', 'Running contracts verification', gitCommitId, env.BUILD_URL, repositoryName
|
|
59
|
-
)
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
sh """
|
|
63
|
-
cd /pact;
|
|
64
|
-
bundle exec bin/pact broker can-i-deploy \
|
|
65
|
-
--broker-base-url ${brokerURL} \
|
|
66
|
-
--broker_username ${env.PACT_BROKER_USR} \
|
|
67
|
-
--broker_password ${env.PACT_BROKER_PSW} \
|
|
68
|
-
--pacticipant ${consumer} \
|
|
69
|
-
--version ${gitCommitId} \
|
|
70
|
-
--to production \
|
|
71
|
-
--retry-while-unknown 90
|
|
72
|
-
"""
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
post {
|
|
79
|
-
always{
|
|
80
|
-
sendBuildData(currentBuild)
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
success {
|
|
84
|
-
script {
|
|
85
|
-
if (notificationType == 'github') {
|
|
86
|
-
githubHelper.notifyPR(
|
|
87
|
-
'Consumer contracts: production', 'SUCCESS', 'Contracts passed verification', gitCommitId, env.BUILD_URL, repositoryName
|
|
88
|
-
)
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
fixed {
|
|
94
|
-
script {
|
|
95
|
-
if (notificationType == 'slack') {
|
|
96
|
-
message = "${env.JOB_NAME} - #${currentBuild.number} back to normal <${env.BUILD_URL}|(Open)>"
|
|
97
|
-
slackSend color: 'good', channel: env.SLACK_NOTIFICATION_CHANNEL, message: message
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
failure {
|
|
103
|
-
script {
|
|
104
|
-
if (notificationType == 'slack') {
|
|
105
|
-
message = "${env.JOB_NAME} - #${currentBuild.number} failed <${env.BUILD_URL}|(Open)>"
|
|
106
|
-
slackSend color: 'danger', channel: env.SLACK_NOTIFICATION_CHANNEL, message: message
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
if (notificationType == 'github') {
|
|
110
|
-
githubHelper.notifyPR(
|
|
111
|
-
'Consumer contracts: production', 'FAILURE', 'Contracts failed or missing verification', gitCommitId, env.BUILD_URL, repositoryName
|
|
112
|
-
)
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|