Merge branch 'main' into platform/SPEC-6061

This commit is contained in:
spham
2021-04-16 17:58:49 -07:00
98 changed files with 3251 additions and 1383 deletions
+27 -14
View File
@@ -26,8 +26,7 @@ def pipelineParameters = [
booleanParam(defaultValue: false, description: 'Deletes the contents of the output directory before building. This will cause a \"clean\" build. NOTE: does not imply CLEAN_ASSETS', name: 'CLEAN_OUTPUT_DIRECTORY'),
booleanParam(defaultValue: false, description: 'Deletes the contents of the output directories of the AssetProcessor before building.', name: 'CLEAN_ASSETS'),
booleanParam(defaultValue: false, description: 'Deletes the contents of the workspace and forces a complete pull.', name: 'CLEAN_WORKSPACE'),
booleanParam(defaultValue: false, description: 'Recreates the volume used for the workspace. The volume will be created out of a snapshot taken from main.', name: 'RECREATE_VOLUME'),
string(defaultValue: '', description: 'Filters and overrides the list of jobs to run for each of the below platforms (comma-separated). Can\'t be used during a pull request.', name: 'JOB_LIST_OVERRIDE')
booleanParam(defaultValue: false, description: 'Recreates the volume used for the workspace. The volume will be created out of a snapshot taken from main.', name: 'RECREATE_VOLUME')
]
def palSh(cmd, lbl = '', winSlashReplacement = true) {
@@ -76,18 +75,22 @@ def palRmDir(path) {
}
}
def IsJobEnabled(buildTypeMap, pipelineName, platformName) {
def job_list_override = params.JOB_LIST_OVERRIDE.tokenize(',')
def IsPullRequest(branchName) {
// temporarily using the name to detect if we are in a PR
// In the future we will check with github
return branchName.startsWith('PR-')
}
def IsJobEnabled(branchName, buildTypeMap, pipelineName, platformName) {
if (IsPullRequest(branchName)) {
return buildTypeMap.value.TAGS && buildTypeMap.value.TAGS.contains(pipelineName)
}
def job_list_override = params.JOB_LIST_OVERRIDE ? params.JOB_LIST_OVERRIDE.tokenize(',') : ''
if (!job_list_override.isEmpty()) {
return params[platformName] && job_list_override.contains(buildTypeMap.key);
} else {
if (params[platformName]) {
if(buildTypeMap.value.TAGS) {
return buildTypeMap.value.TAGS.contains(pipelineName)
}
}
return params[platformName] && buildTypeMap.value.TAGS && buildTypeMap.value.TAGS.contains(pipelineName)
}
return false
}
def GetRunningPipelineName(JENKINS_JOB_NAME) {
@@ -448,8 +451,12 @@ try {
pipelineConfig = LoadPipelineConfig(pipelineName, branchName)
// Add each platform as a parameter that the user can disable if needed
pipelineConfig.platforms.each { platform ->
pipelineParameters.add(booleanParam(defaultValue: true, description: '', name: platform.key))
if (!IsPullRequest(branchName)) {
pipelineParameters.add(stringParam(defaultValue: '', description: 'Filters and overrides the list of jobs to run for each of the below platforms (comma-separated). Can\'t be used during a pull request.', name: 'JOB_LIST_OVERRIDE'))
pipelineConfig.platforms.each { platform ->
pipelineParameters.add(booleanParam(defaultValue: true, description: '', name: platform.key))
}
}
pipelineProperties.add(parameters(pipelineParameters))
properties(pipelineProperties)
@@ -462,23 +469,26 @@ try {
}
}
if(env.BUILD_NUMBER == '1' && !branchName.startsWith('PR-')) {
if(env.BUILD_NUMBER == '1' && !IsPullRequest(branchName)) {
// Exit pipeline early on the intial build. This allows Jenkins to load the pipeline for the branch and enables users
// to select build parameters on their first actual build. See https://issues.jenkins.io/browse/JENKINS-41929
currentBuild.result = 'SUCCESS'
return
}
def someBuildHappened = false
// Build and Post-Build Testing Stage
def buildConfigs = [:]
// Platform Builds run on EC2
pipelineConfig.platforms.each { platform ->
platform.value.build_types.each { build_job ->
if (IsJobEnabled(build_job, pipelineName, platform.key)) { // User can filter jobs, jobs are tagged by pipeline
if (IsJobEnabled(branchName, build_job, pipelineName, platform.key)) { // User can filter jobs, jobs are tagged by pipeline
def envVars = GetBuildEnvVars(platform.value.PIPELINE_ENV ?: EMPTY_JSON, build_job.value.PIPELINE_ENV ?: EMPTY_JSON, pipelineName)
envVars['JOB_NAME'] = "${branchName}_${platform.key}_${build_job.key}" // backwards compatibility, some scripts rely on this
def nodeLabel = envVars['NODE_LABEL']
someBuildHappened = true
buildConfigs["${platform.key} [${build_job.key}]"] = {
node("${nodeLabel}") {
@@ -538,6 +548,9 @@ try {
echo 'All builds successful'
}
if (!someBuildHappened) {
currentBuild.result = 'NOT_BUILT'
}
}
catch(Exception e) {
error "Exception: ${e}"
+29 -3
View File
@@ -7,14 +7,14 @@
"CMAKE_LY_PROJECTS": "AutomatedTesting"
}
},
"profile_pipe": {
"profile_nounity_pipe": {
"TAGS": [
"default"
],
"steps": [
"profile_nounity",
"asset_profile",
"test_profile"
"asset_profile_nounity",
"test_profile_nounity"
]
},
"metrics": {
@@ -84,6 +84,18 @@
"CTEST_OPTIONS": "-E (Gem::EMotionFX.Editor.Tests|Gem::AWSClientAuth.Tests|Gem::AWSCore.Editor.Tests) -L FRAMEWORK_googletest"
}
},
"test_profile_nounity": {
"TAGS": [],
"COMMAND": "build_test_linux.sh",
"PARAMETERS": {
"CONFIGURATION": "profile",
"OUTPUT_DIRECTORY": "build/linux",
"CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DCMAKE_C_COMPILER=clang-6.0 -DCMAKE_CXX_COMPILER=clang++-6.0 -DLY_UNITY_BUILD=FALSE -DLY_PARALLEL_LINK_JOBS=4",
"CMAKE_LY_PROJECTS": "AutomatedTesting",
"CMAKE_TARGET": "all",
"CTEST_OPTIONS": "-E (Gem::EMotionFX.Editor.Tests|Gem::AWSClientAuth.Tests|Gem::AWSCore.Editor.Tests) -L FRAMEWORK_googletest"
}
},
"asset_profile": {
"TAGS": [
"weekly-build-metrics"
@@ -100,6 +112,20 @@
"ASSET_PROCESSOR_PLATFORMS": "pc,server"
}
},
"asset_profile_nounity": {
"TAGS": [],
"COMMAND": "build_asset_linux.sh",
"PARAMETERS": {
"CONFIGURATION": "profile",
"OUTPUT_DIRECTORY": "build/linux",
"CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DCMAKE_C_COMPILER=clang-6.0 -DCMAKE_CXX_COMPILER=clang++-6.0 -DLY_UNITY_BUILD=FALSE -DLY_PARALLEL_LINK_JOBS=4",
"CMAKE_LY_PROJECTS": "AutomatedTesting",
"CMAKE_TARGET": "AssetProcessorBatch",
"ASSET_PROCESSOR_BINARY": "bin/profile/AssetProcessorBatch",
"ASSET_PROCESSOR_OPTIONS": "/zeroAnalysisMode",
"ASSET_PROCESSOR_PLATFORMS": "pc,server"
}
},
"asset_clean_profile": {
"TAGS": [
"nightly"