@toptal/davinci-ci 6.0.1-alpha-fx-4497-storybook-13e9f909.10 → 7.0.0

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.
@@ -1,189 +0,0 @@
1
- @Library('globalLibrary@master') _
2
-
3
- ghHelper = new helpers.GithubNotifyHelper()
4
-
5
- repositoryUrl = params.GITHUB_REPO_GIT_URL
6
- pullRequestId = params.GITHUB_PR_NUMBER
7
- commitId = params.GITHUB_PR_HEAD_SHA
8
- sourceBranch = params.GITHUB_PR_SOURCE_BRANCH
9
- targetBranch = params.GITHUB_PR_TARGET_BRANCH
10
-
11
- repositoryName = repositoryUrl.tokenize('/').last().split("\\.")[0]
12
- repositorySSHUrl = "git@github.com:toptal/${repositoryName}.git"
13
-
14
- buildImageJobName = "${repositoryName}-build-image"
15
-
16
- pipeline {
17
- agent { label 'slave_aws' }
18
-
19
- options {
20
- ansiColor('xterm')
21
- timestamps()
22
- timeout(time: 35, unit: 'MINUTES')
23
- buildDiscarder(logRotator(numToKeepStr: '20'))
24
- skipDefaultCheckout()
25
- }
26
-
27
- parameters {
28
- string(name: 'GITHUB_PR_SOURCE_BRANCH', defaultValue: '', description: 'Source branch')
29
- string(name: 'GITHUB_PR_TARGET_BRANCH', defaultValue: '', description: 'Target branch')
30
- string(name: 'GITHUB_REPO_GIT_URL', defaultValue: '', description: 'Repository url')
31
- string(name: 'GITHUB_PR_NUMBER', defaultValue: '', description: 'Pull request Id')
32
- string(name: 'GITHUB_PR_HEAD_SHA', defaultValue: '', description: 'Commit Id')
33
- string(name: 'BUILD_PACKAGE_SCRIPT_NAME', defaultValue: 'build:package', description: 'Yarn script name to build the package')
34
- }
35
-
36
- environment {
37
- GCE_ACCOUNT_KEY = credentials('jenkins-storage-administrator')
38
- NPM_TOKEN = credentials('npm-token-for-toptal-private-registry')
39
- GITHUB_TOKEN = credentials('toptal-devbot-personal-token')
40
- PUBLISH_NPM_TOKEN = credentials('npm-token-for-toptal-private-registry-publish')
41
- GIT_COMMITTER_NAME = 'toptal-bot'
42
- GIT_COMMITTER_EMAIL = 'bot@toptal.com'
43
- }
44
-
45
- stages {
46
- stage('Git checkout PR') {
47
- steps {
48
- script {
49
- ghHelper.notifyPR('Package alpha release', 'PENDING', 'running', "${commitId}", "${BUILD_URL}", repositoryName)
50
- }
51
-
52
- info "== Checking out Git revision ${commitId}"
53
-
54
- gitCheckout(
55
- branches: "${commitId}",
56
- credentials: [username: 'toptal-build', description: "toptal-build-ssh-key"],
57
- url: repositorySSHUrl,
58
- refspec: "+refs/heads/${targetBranch}:refs/remotes/origin/${targetBranch} +refs/pull/${pullRequestId}/*:refs/remotes/origin/pr/${pullRequestId}/*",
59
- additionalBehaviours: [
60
- advancedCheckoutBehaviour: [timeout: 120],
61
- advancedCloneBehaviour : [depth: 0, noTags: true, reference: '', shallow: false, timeout: 340],
62
- cleanBeforeCheckout : false,
63
- calculateChangelog : [compareRemote: 'origin', compareTarget: "${targetBranch}"]
64
- ]
65
- )
66
-
67
- info "Git commit: ${gitCommit()}"
68
- info "Git branch: ${gitBranch()}"
69
- success 'Checkout finished'
70
- }
71
- } //stage
72
-
73
- stage('Build image') {
74
- steps {
75
- script {
76
- buildWithParameters(
77
- jobName: buildImageJobName,
78
- propagate: true,
79
- wait: true,
80
- parameters: [
81
- BRANCH: sourceBranch,
82
- VERSION: commitId,
83
- IMAGE_NAME: repositoryName,
84
- REPOSITORY_NAME: repositoryName
85
- ]
86
- )
87
- }
88
- } //steps
89
- } //stage
90
-
91
- stage('Publish as alpha package') {
92
- steps {
93
- script {
94
- PWD = sh(returnStdout: true, script: 'pwd').trim()
95
- }
96
-
97
- sshagent(credentials: ['toptal-build-ssh-key']) {
98
- // $SSH_AUTH_SOCK - is the ssh key passed from ssh agent
99
- //
100
- // -u 469:469 \
101
- // - all those need to be passed to reuse jenkins user from Jenkins
102
- // and it's .ssh folder, keys and passwords
103
- //
104
- // -v ${PWD}:/artifacts - needs to pass .versions file
105
- //
106
- // -e JENKINS_URL=${JENKINS_URL} \
107
- // -e GIT_BRANCH=${branch} \
108
- // - need to make semantic-release to think
109
- // that we are running it inside CI environment
110
- //
111
- // -e GITHUB_TOKEN needed for semantic-release to authenticated with GitHub
112
- //
113
- sh """
114
- docker run \
115
- --rm \
116
- -e GIT_COMMITTER_EMAIL=${GIT_COMMITTER_EMAIL} \
117
- -e GIT_COMMITTER_NAME=${GIT_COMMITTER_NAME} \
118
- -e GITHUB_TOKEN=${GITHUB_TOKEN} \
119
- -e NPM_TOKEN=${PUBLISH_NPM_TOKEN} \
120
- -e JENKINS_URL=${JENKINS_URL} \
121
- -e GIT_BRANCH=${sourceBranch} \
122
- -v ${PWD}:/artifacts \
123
- -u 469:469 \
124
- -v $SSH_AUTH_SOCK:/ssh-agent \
125
- -e SSH_AUTH_SOCK=/ssh-agent \
126
- -v ${PWD}/.git:/app/.git \
127
- us-central1-docker.pkg.dev/toptal-hub/containers/${repositoryName}:${commitId} \
128
- /bin/bash -c "yarn ${params.BUILD_PACKAGE_SCRIPT_NAME} && \
129
- yarn davinci-engine publish-package \
130
- --alpha \
131
- --outputVersion /artifacts/.version \
132
- --branch ${sourceBranch}"
133
- """
134
- }
135
-
136
- script {
137
- NEW_VERSION = sh(returnStdout: true, script: 'cat .version').trim()
138
- }
139
- } //steps
140
-
141
- post {
142
- success {
143
- success "Alpha package released"
144
- script {
145
- def notes
146
-
147
- isLikelyMonorepo = [
148
- '@toptal/picasso',
149
- '@topkit',
150
- '@toptal/davinci',
151
- '@toptal/staff-portal'
152
- ].any { NEW_VERSION.contains(it) }
153
-
154
- if (isLikelyMonorepo) {
155
- notes = ""
156
- NEW_VERSION.split(' ').each{name -> notes += "`yarn add $name`<br/>"}
157
- } else {
158
- releasedPackageName = "@toptal/${repositoryName}@${NEW_VERSION}"
159
- notes = "Alpha package release: `yarn add ${releasedPackageName}`"
160
- }
161
-
162
- comment = "Your alpha package is ready :tada:<br/>" + notes
163
- gitHubPostComment("${repositoryName}", "${pullRequestId}", comment, GITHUB_TOKEN)
164
-
165
- ghHelper.notifyPR('Package alpha release', 'SUCCESS', 'Done!', "${commitId}", "${BUILD_URL}", repositoryName)
166
- }
167
- }
168
- }
169
- } //stage
170
- }
171
-
172
- post {
173
- failure {
174
- err "Alpha package was not released"
175
- script {
176
- notes = "It looks like publish-alpha-package job failed by some reason."
177
- comment = "Your alpha package was not released :x:<br/>" + notes
178
- gitHubPostComment("${repositoryName}", "${pullRequestId}", comment, GITHUB_TOKEN)
179
- ghHelper.notifyPR('Package alpha release', 'FAILURE', notes, "${commitId}", "${BUILD_URL}", repositoryName)
180
- }
181
- }
182
-
183
- always {
184
- script {
185
- sendBuildData(currentBuild)
186
- }
187
- }
188
- }
189
- }
@@ -1,136 +0,0 @@
1
- <flow-definition plugin="workflow-job@2.39">
2
- <actions>
3
- <org.jenkinsci.plugins.pipeline.modeldefinition.actions.DeclarativeJobAction plugin="pipeline-model-definition@1.7.1"/>
4
- <org.jenkinsci.plugins.pipeline.modeldefinition.actions.DeclarativeJobPropertyTrackerAction plugin="pipeline-model-definition@1.7.1">
5
- <jobProperties>
6
- <string>jenkins.model.BuildDiscarderProperty</string>
7
- </jobProperties>
8
- <triggers/>
9
- <parameters>
10
- <string>GITHUB_PR_SOURCE_BRANCH</string>
11
- <string>GITHUB_PR_HEAD_SHA</string>
12
- <string>GITHUB_REPO_GIT_URL</string>
13
- <string>GITHUB_PR_NUMBER</string>
14
- <string>BUILD_PACKAGE_SCRIPT_NAME</string>
15
- </parameters>
16
- <options>
17
- <string>skipDefaultCheckout</string>
18
- </options>
19
- </org.jenkinsci.plugins.pipeline.modeldefinition.actions.DeclarativeJobPropertyTrackerAction>
20
- </actions>
21
- <description></description>
22
- <keepDependencies>false</keepDependencies>
23
- <properties>
24
- <hudson.plugins.jira.JiraProjectProperty plugin="jira@3.0.15"/>
25
- <jenkins.model.BuildDiscarderProperty>
26
- <strategy class="hudson.tasks.LogRotator">
27
- <daysToKeep>-1</daysToKeep>
28
- <numToKeep>20</numToKeep>
29
- <artifactDaysToKeep>-1</artifactDaysToKeep>
30
- <artifactNumToKeep>-1</artifactNumToKeep>
31
- </strategy>
32
- </jenkins.model.BuildDiscarderProperty>
33
- <com.sonyericsson.jenkins.plugins.bfa.model.ScannerJobProperty plugin="build-failure-analyzer@1.26.0">
34
- <doNotScan>false</doNotScan>
35
- </com.sonyericsson.jenkins.plugins.bfa.model.ScannerJobProperty>
36
- <com.coravy.hudson.plugins.github.GithubProjectProperty plugin="github@1.30.0">
37
- <projectUrl>$PROJECT_URL</projectUrl>
38
- <displayName></displayName>
39
- </com.coravy.hudson.plugins.github.GithubProjectProperty>
40
- <com.sonyericsson.rebuild.RebuildSettings plugin="rebuild@1.31">
41
- <autoRebuild>false</autoRebuild>
42
- <rebuildDisabled>false</rebuildDisabled>
43
- </com.sonyericsson.rebuild.RebuildSettings>
44
- <org.jenkinsci.plugins.workflow.job.properties.PipelineTriggersJobProperty>
45
- <triggers>
46
- <org.jenkinsci.plugins.github.pullrequest.GitHubPRTrigger plugin="github-pullrequest@0.2.8">
47
- <spec></spec>
48
- <triggerMode>HEAVY_HOOKS</triggerMode>
49
- <cancelQueued>true</cancelQueued>
50
- <abortRunning>true</abortRunning>
51
- <skipFirstRun>false</skipFirstRun>
52
- <repoProviders>
53
- <com.github.kostyasha.github.integration.generic.repoprovider.GitHubPluginRepoProvider>
54
- <cacheConnection>true</cacheConnection>
55
- <manageHooks>true</manageHooks>
56
- <repoPermission>ADMIN</repoPermission>
57
- </com.github.kostyasha.github.integration.generic.repoprovider.GitHubPluginRepoProvider>
58
- </repoProviders>
59
- <errorsAction>
60
- <description>GitHub Pull Requests Trigger Errors</description>
61
- <errors class="java.util.Collections$SynchronizedSet" serialization="custom">
62
- <java.util.Collections_-SynchronizedCollection>
63
- <default>
64
- <c class="set"/>
65
- <mutex class="java.util.Collections$SynchronizedSet" reference="../../.."/>
66
- </default>
67
- </java.util.Collections_-SynchronizedCollection>
68
- </errors>
69
- </errorsAction>
70
- <events>
71
- <org.jenkinsci.plugins.github.pullrequest.events.impl.GitHubPRCommentEvent>
72
- <comment>@toptal-bot run package:alpha-release</comment>
73
- </org.jenkinsci.plugins.github.pullrequest.events.impl.GitHubPRCommentEvent>
74
- </events>
75
- <preStatus>false</preStatus>
76
- </org.jenkinsci.plugins.github.pullrequest.GitHubPRTrigger>
77
- </triggers>
78
- </org.jenkinsci.plugins.workflow.job.properties.PipelineTriggersJobProperty>
79
- <hudson.model.ParametersDefinitionProperty>
80
- <parameterDefinitions>
81
- <hudson.model.StringParameterDefinition>
82
- <name>GITHUB_PR_SOURCE_BRANCH</name>
83
- <description>Source branch</description>
84
- <defaultValue></defaultValue>
85
- <trim>false</trim>
86
- </hudson.model.StringParameterDefinition>
87
- <hudson.model.StringParameterDefinition>
88
- <name>GITHUB_REPO_GIT_URL</name>
89
- <description>Repository url</description>
90
- <trim>false</trim>
91
- </hudson.model.StringParameterDefinition>
92
- <hudson.model.StringParameterDefinition>
93
- <name>GITHUB_PR_NUMBER</name>
94
- <description>Pull request Id</description>
95
- <defaultValue></defaultValue>
96
- <trim>false</trim>
97
- </hudson.model.StringParameterDefinition>
98
- <hudson.model.StringParameterDefinition>
99
- <name>GITHUB_PR_HEAD_SHA</name>
100
- <description>Commit Id</description>
101
- <defaultValue></defaultValue>
102
- <trim>false</trim>
103
- </hudson.model.StringParameterDefinition>
104
- <hudson.model.StringParameterDefinition>
105
- <name>BUILD_PACKAGE_SCRIPT_NAME</name>
106
- <description>Yarn script name to build the package</description>
107
- <defaultValue>build:package</defaultValue>
108
- <trim>false</trim>
109
- </hudson.model.StringParameterDefinition>
110
- </parameterDefinitions>
111
- </hudson.model.ParametersDefinitionProperty>
112
- </properties>
113
- <definition class="org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition" plugin="workflow-cps@2.82">
114
- <scm class="hudson.plugins.git.GitSCM" plugin="git@4.3.0">
115
- <configVersion>2</configVersion>
116
- <userRemoteConfigs>
117
- <hudson.plugins.git.UserRemoteConfig>
118
- <url>git@github.com:toptal/davinci.git</url>
119
- <credentialsId>$CREDENTIALS_ID</credentialsId>
120
- </hudson.plugins.git.UserRemoteConfig>
121
- </userRemoteConfigs>
122
- <branches>
123
- <hudson.plugins.git.BranchSpec>
124
- <name>master</name>
125
- </hudson.plugins.git.BranchSpec>
126
- </branches>
127
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
128
- <submoduleCfg class="list"/>
129
- <extensions/>
130
- </scm>
131
- <scriptPath>packages/ci/src/configs/jobs/publish-alpha-package/Jenkinsfile</scriptPath>
132
- <lightweight>false</lightweight>
133
- </definition>
134
- <triggers/>
135
- <disabled>false</disabled>
136
- </flow-definition>