Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asterisk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Voice
asterisk
Commits
e5f30eba
Commit
e5f30eba
authored
6 years ago
by
George Joseph
Browse files
Options
Downloads
Patches
Plain Diff
CI: Final version of setting correct gerrit creds
Change-Id: I7729ecceedceb12f52bf18dae259846aa1d993b3
parent
8e1c541a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/CI/gates.jenkinsfile
+5
-4
5 additions, 4 deletions
tests/CI/gates.jenkinsfile
with
5 additions
and
4 deletions
tests/CI/gates.jenkinsfile
+
5
−
4
View file @
e5f30eba
...
...
@@ -68,7 +68,6 @@ pipeline {
stage
(
"Checkout"
)
{
sh
"sudo chown -R jenkins:users ."
env
.
GERRIT_PROJECT_URL
=
env
.
GERRIT_CHANGE_URL
.
replaceAll
(
/\/[0-9]+$/
,
"/${env.GERRIT_PROJECT}"
)
sh
"printenv | sort"
/*
* Jenkins has already automatically checked out the base branch
...
...
@@ -83,8 +82,10 @@ pipeline {
* We need to retrieve the jenkins2 gerrit https credentials
* in case this review is in a restricted project.
*/
withCredentials
([
usernamePassword
(
credentialsId:
env
.
JENKINS_GERRIT_CREDS
,
usernameVariable:
'gerrit_user'
)])
{
withCredentials
([
usernamePassword
(
credentialsId:
"${JENKINS_GERRIT_CREDS}"
,
passwordVariable:
'GERRIT_USER_PW'
,
usernameVariable:
'GERRIT_USER_NAME'
)])
{
sh
"printenv | sort"
checkout
scm:
[
$class
:
'GitSCM'
,
branches:
[[
name:
env
.
GERRIT_BRANCH
]],
...
...
@@ -112,7 +113,7 @@ pipeline {
credentialsId:
env
.
JENKINS_GERRIT_CREDS
,
name:
env
.
GERRIT_NAME
,
refspec:
env
.
GERRIT_REFSPEC
,
url:
env
.
GERRIT_PROJECT_URL
.
replaceAll
(
"http(s)?://"
,
"http\$1://${
gerrit_user
}@"
)
url:
env
.
GERRIT_PROJECT_URL
.
replaceAll
(
"http(s)?://"
,
"http\$1://${
GERRIT_USER_NAME
}@"
)
]
]
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment