-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Shallow clone in jenkinsfile and fix readme
- Loading branch information
Showing
4 changed files
with
56 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,22 +2,34 @@ | |
|
||
@Library('[email protected]') _ | ||
|
||
def checkout_shallow() | ||
{ | ||
checkout scm: [ | ||
$class: 'GitSCM', | ||
branches: scm.branches, | ||
userRemoteConfigs: scm.userRemoteConfigs, | ||
extensions: [[$class: 'CloneOption', depth: 1, shallow: true, noTags: false]] | ||
] | ||
} | ||
|
||
def clone_test_deps() { | ||
dir("${WORKSPACE}") { | ||
sh "git clone [email protected]:xmos/test_support" | ||
sh "git -C test_support checkout c820ebe67bea0596dabcdaf71a590c671385ac35" | ||
} | ||
} | ||
|
||
def archiveLib(String repoName) { | ||
sh "git -C ${repoName} clean -xdf" | ||
zip zipFile: "${repoName}_sw.zip", dir: "${repoName}", archive: true, defaultExcludes: false | ||
} | ||
|
||
getApproval() | ||
|
||
pipeline { | ||
agent { | ||
label 'x86_64 && linux' | ||
} | ||
environment { | ||
REPO = 'lib_xud' | ||
} | ||
options { | ||
buildDiscarder(xmosDiscardBuildSettings()) | ||
skipDefaultCheckout() | ||
|
@@ -45,8 +57,14 @@ pipeline { | |
stage('Build examples') { | ||
steps { | ||
println "Stage running on ${env.NODE_NAME}" | ||
|
||
script { | ||
def (server, user, repo) = extractFromScmUrl() | ||
env.REPO = repo | ||
} | ||
|
||
dir("${REPO}") { | ||
checkout scm | ||
checkout_shallow() | ||
|
||
dir("examples") { | ||
withTools(params.TOOLS_VERSION) { | ||
|
@@ -59,14 +77,17 @@ pipeline { | |
} // Build examples | ||
|
||
stage('Library checks') { | ||
steps { | ||
runLibraryChecks("${WORKSPACE}/${REPO}", "${params.INFR_APPS_VERSION}") | ||
} | ||
steps { | ||
warnError("Library checks failed") | ||
{ | ||
runLibraryChecks("${WORKSPACE}/${REPO}", "${params.INFR_APPS_VERSION}") | ||
} | ||
} | ||
} | ||
|
||
stage('Documentation') { | ||
steps { | ||
dir("${REPO}") { | ||
dir(REPO) { | ||
buildDocs() | ||
} | ||
} | ||
|
@@ -75,7 +96,6 @@ pipeline { | |
stage('Tests') | ||
{ | ||
steps { | ||
// Note, moves to WORKSPACE | ||
clone_test_deps() | ||
|
||
withTools(params.TOOLS_VERSION) { | ||
|
@@ -95,6 +115,13 @@ pipeline { | |
} | ||
} | ||
} | ||
|
||
stage("Archive lib") { | ||
steps | ||
{ | ||
archiveLib(REPO) | ||
} | ||
} | ||
} | ||
post { | ||
cleanup { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters