2019-08-15 02:43:09 +08:00
|
|
|
#!/usr/bin/env groovy
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2019 - present Instructure, Inc.
|
|
|
|
*
|
|
|
|
* This file is part of Canvas.
|
|
|
|
*
|
|
|
|
* Canvas is free software: you can redistribute it and/or modify it under
|
|
|
|
* the terms of the GNU Affero General Public License as published by the Free
|
|
|
|
* Software Foundation, version 3 of the License.
|
|
|
|
*
|
|
|
|
* Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
|
|
* A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
|
|
* details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License along
|
|
|
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2020-11-02 23:39:02 +08:00
|
|
|
library "canvas-builds-library@${env.CANVAS_BUILDS_REFSPEC}"
|
2021-05-17 00:01:59 +08:00
|
|
|
loadLocalLibrary('local-lib', 'build/new-jenkins/library')
|
2019-12-21 04:37:59 +08:00
|
|
|
|
2021-02-05 05:17:51 +08:00
|
|
|
def getLoadAllLocales() {
|
|
|
|
return configuration.isChangeMerged() ? 1 : 0
|
|
|
|
}
|
|
|
|
|
2019-08-15 02:43:09 +08:00
|
|
|
pipeline {
|
2020-07-23 04:06:21 +08:00
|
|
|
agent none
|
2021-01-07 01:11:17 +08:00
|
|
|
options {
|
|
|
|
ansiColor('xterm')
|
|
|
|
timeout(time: 20)
|
|
|
|
timestamps()
|
|
|
|
}
|
2019-08-15 02:43:09 +08:00
|
|
|
|
|
|
|
environment {
|
2021-04-21 01:15:44 +08:00
|
|
|
BUILD_REGISTRY_FQDN = configuration.buildRegistryFQDN()
|
2021-05-19 00:33:13 +08:00
|
|
|
COMPOSE_DOCKER_CLI_BUILD = 1
|
2020-11-18 01:08:45 +08:00
|
|
|
COMPOSE_FILE = 'docker-compose.new-jenkins-js.yml'
|
2021-05-19 00:33:13 +08:00
|
|
|
DOCKER_BUILDKIT = 1
|
2020-06-17 02:23:25 +08:00
|
|
|
FORCE_FAILURE = configuration.forceFailureJS()
|
2021-05-19 00:33:13 +08:00
|
|
|
PROGRESS_NO_TRUNC = 1
|
2021-02-05 05:17:51 +08:00
|
|
|
RAILS_LOAD_ALL_LOCALES = getLoadAllLocales()
|
2019-08-15 02:43:09 +08:00
|
|
|
}
|
2020-02-15 06:02:23 +08:00
|
|
|
|
2019-08-15 02:43:09 +08:00
|
|
|
stages {
|
2020-07-23 04:06:21 +08:00
|
|
|
stage('Environment') {
|
2020-01-18 04:22:04 +08:00
|
|
|
steps {
|
2020-07-23 04:06:21 +08:00
|
|
|
script {
|
2021-05-21 23:33:48 +08:00
|
|
|
def runnerStages = [:]
|
2021-04-14 04:56:28 +08:00
|
|
|
|
2021-05-24 22:15:10 +08:00
|
|
|
extendedStage('Runner - Jest').nodeRequirements(label: 'canvas-docker', podTemplate: jsStage.jestNodeRequirementsTemplate()).obeysAllowStages(false).timeout(10).queue(runnerStages) {
|
2021-05-18 02:10:59 +08:00
|
|
|
def tests = [:]
|
2020-07-23 04:06:21 +08:00
|
|
|
|
2021-06-07 23:29:38 +08:00
|
|
|
callableWithDelegate(jsStage.queueJestDistribution())(tests)
|
2021-05-21 23:33:48 +08:00
|
|
|
|
|
|
|
parallel(tests)
|
|
|
|
}
|
|
|
|
|
2021-05-24 22:15:10 +08:00
|
|
|
extendedStage('Runner - Coffee').nodeRequirements(label: 'canvas-docker', podTemplate: jsStage.coffeeNodeRequirementsTemplate()).obeysAllowStages(false).timeout(10).queue(runnerStages) {
|
2021-05-21 23:33:48 +08:00
|
|
|
def tests = [:]
|
|
|
|
|
2021-06-07 23:29:38 +08:00
|
|
|
callableWithDelegate(jsStage.queueCoffeeDistribution())(tests)
|
2021-05-18 02:10:59 +08:00
|
|
|
|
|
|
|
parallel(tests)
|
2020-04-16 23:02:58 +08:00
|
|
|
}
|
2021-05-21 23:33:48 +08:00
|
|
|
|
2021-05-24 22:15:10 +08:00
|
|
|
extendedStage('Runner - Karma').nodeRequirements(label: 'canvas-docker', podTemplate: jsStage.karmaNodeRequirementsTemplate()).obeysAllowStages(false).timeout(10).queue(runnerStages) {
|
2021-05-21 23:33:48 +08:00
|
|
|
def tests = [:]
|
|
|
|
|
2021-06-07 23:29:38 +08:00
|
|
|
callableWithDelegate(jsStage.queueKarmaDistribution())(tests)
|
2021-05-21 23:33:48 +08:00
|
|
|
|
|
|
|
parallel(tests)
|
|
|
|
}
|
|
|
|
|
|
|
|
parallel(runnerStages)
|
2019-08-30 06:03:52 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-08-15 02:43:09 +08:00
|
|
|
}
|
2020-01-16 22:55:14 +08:00
|
|
|
}
|