Skip to content

Commit

Permalink
add the ability to load local shared library
Browse files Browse the repository at this point in the history
move rspec and distribution into a library folder that
can be loaded as local shared lib to avoid the load code
in the jenkins files.

refs DE-555
flag = none

[canvas-builds-refspec=d4cf97caed1edf2c9c91c48460e94f99e58a4d0a]

Change-Id: Id947a389d22f04126a8654bd5e4957433cddd330
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261289
Tested-by: Service Cloud Jenkins <[email protected]>
Reviewed-by: Aaron Ogata <[email protected]>
QA-Review: Andrea Cirulli <[email protected]>
Product-Review: Andrea Cirulli <[email protected]>
  • Loading branch information
kerby82 committed Mar 24, 2021
1 parent 2b51973 commit b4a90a4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ def rebaseHelper(branch, commitHistory = 100) {
}

library "canvas-builds-library@${getCanvasBuildsRefspec()}"
loadLocalLibrary("local-lib", "build/new-jenkins/library")

configuration.setUseCommitMessageFlags(env.GERRIT_EVENT_TYPE != 'change-merged')
extendedStage.setAlwaysAllowStages([
Expand Down Expand Up @@ -765,7 +766,6 @@ pipeline {
}
}

def distribution = load 'build/new-jenkins/groovy/distribution.groovy'
distribution.stashBuildScripts()

distribution.addRSpecSuites(stages)
Expand Down
3 changes: 1 addition & 2 deletions Jenkinsfile.parallel_logs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import org.jenkinsci.plugins.workflow.support.steps.build.DownstreamFailureCause
import org.jenkinsci.plugins.workflow.steps.FlowInterruptedException

library "canvas-builds-library"
loadLocalLibrary("local-lib", "build/new-jenkins/library")

// if the build never starts or gets into a node block, then we
// can never load a file. and a very noisy/confusing error is thrown.
Expand Down Expand Up @@ -85,7 +86,6 @@ pipeline {
steps {
script {
def stages = [:]
def distribution = load 'build/new-jenkins/groovy/distribution.groovy'

distribution.stashBuildScripts()

Expand All @@ -100,7 +100,6 @@ pipeline {
stage('Copy Files') {
steps {
script {
def rspec = load 'build/new-jenkins/groovy/rspec.groovy'
rspec.uploadParallelLog()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,21 @@ def stashBuildScripts() {
* common helper for adding rspec tests to be ran
*/
def addRSpecSuites(stages) {
def rspec_node_total = load('build/new-jenkins/groovy/rspec.groovy').rspecConfig().node_total
def rspec_node_total = rspec.rspecConfig().node_total
echo 'adding RSpec Test Sets'
appendStagesAsBuildNodes(stages, rspec_node_total, 'RSpec Test Set', 'rspec') { index ->
load('build/new-jenkins/groovy/rspec.groovy').runRSpecSuite(rspec_node_total, index)
rspec.runRSpecSuite(rspec_node_total, index)
}
}

/**
* common helper for adding selenium tests to be ran
*/
def addSeleniumSuites(stages) {
def selenium_node_total = load('build/new-jenkins/groovy/rspec.groovy').seleniumConfig().node_total
def selenium_node_total = rspec.seleniumConfig().node_total
echo 'adding Selenium Test Sets'
appendStagesAsBuildNodes(stages, selenium_node_total, 'Selenium Test Set', 'selenium') { index ->
load('build/new-jenkins/groovy/rspec.groovy').runSeleniumSuite(selenium_node_total, index)
rspec.runSeleniumSuite(selenium_node_total, index)
}
}

Expand Down
File renamed without changes.

0 comments on commit b4a90a4

Please sign in to comment.