Commit 1d1cfc66 authored by Evan Lojewski's avatar Evan Lojewski

jenkins: Fix merge requests to pull submodules from destination repository.

parent adf45fa7
......@@ -44,7 +44,13 @@
def notify(status, description)
{
updateGitlabCommitStatus name: 'build', state: status
try {
updateGitlabCommitStatus name: 'build', state: status
}
catch (exc)
{
print "Unable to update commit status"
}
}
def build(nodeName, archive = false, archive_cab = false, analyze = true, test_archive = false)
......@@ -55,26 +61,29 @@ def build(nodeName, archive = false, archive_cab = false, analyze = true, test_a
def URL = ''
def REFSPEC = env['gitlabBranch']
try {
URL = env['gitlabSourceRepoHttpUrl']
URL = env['gitlabTargetRepoHttpUrl']
}
catch (exc)
{
URL = 'http://gitlab.raptorengineering.com/kestrel-collaboration/firmware.git'
try {
URL = env['gitlabSourceRepoHttpUrl']
}
catch (exc2)
{
URL = 'http://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-firmware/bare-metal-firmware.git'
}
}
def HASH = ''
try {
HASH = env['gitlabMergeRequestLastCommit']
// Merge request
HASH = 'merge-requests/' + env['gitlabMergeRequestIid']
REFSPEC = '+refs/heads/*:refs/remotes/origin/* +refs/merge-requests/*/head:refs/remotes/origin/merge-requests/*'
}
catch (exc)
{
try {
HASH = GITHUB_PR_HEAD_SHA
REFSPEC = '+refs/pull/*:refs/remotes/origin/pr/*'
}
catch (exc2)
{
HASH = '**'
}
// Push to repo
HASH = 'origin/' + env['gitlabSourceBranch}']
REFSPEC = env['gitlabBranch']
}
stage('checkout')
......@@ -86,7 +95,7 @@ def build(nodeName, archive = false, archive_cab = false, analyze = true, test_a
refspec: REFSPEC,
url: URL
]],
browser: [$class: 'GitLab', repoUrl: 'http://gitlab.raptorengineering.com/kestrel-collaboration/firmware'],
browser: [$class: 'GitLab', repoUrl: 'http://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-firmware/bare-metal-firmware'],
doGenerateSubmoduleConfigurations: false,
extensions: [
[$class: 'SubmoduleOption',
......@@ -95,7 +104,7 @@ def build(nodeName, archive = false, archive_cab = false, analyze = true, test_a
recursiveSubmodules: false,
reference: '',
trackingSubmodules: false
]
],
],
submoduleCfg: []
])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment