|
@@ -15,8 +15,7 @@ PROJECT_REPOSITORY_NAME = 'o3de-atom-sampleviewer'
|
|
PROJECT_ORGANIZATION_NAME = 'aws-lumberyard'
|
|
PROJECT_ORGANIZATION_NAME = 'aws-lumberyard'
|
|
ENGINE_REPOSITORY_NAME = 'o3de'
|
|
ENGINE_REPOSITORY_NAME = 'o3de'
|
|
ENGINE_ORGANIZATION_NAME = 'aws-lumberyard'
|
|
ENGINE_ORGANIZATION_NAME = 'aws-lumberyard'
|
|
-ENGINE_BRANCH_DEFAULT = 'stabilization/2106'
|
|
|
|
-ENGINE_REFSPEC_DEFAULT = 'origin/stabilization/2106'
|
|
|
|
|
|
+ENGINE_BRANCH_DEFAULT = "${env.BRANCH_DEFAULT}" ?: 'development'
|
|
|
|
|
|
def pipelineProperties = []
|
|
def pipelineProperties = []
|
|
|
|
|
|
@@ -27,8 +26,7 @@ def pipelineParameters = [
|
|
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 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: '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'),
|
|
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'),
|
|
- stringParam(defaultValue: "${ENGINE_BRANCH_DEFAULT}", description: 'Sets a different branch from o3de engine repo to use or use commit id. Default is mainline', trim: true, name: 'ENGINE_BRANCH'),
|
|
|
|
- stringParam(defaultValue: "${ENGINE_REFSPEC_DEFAULT}", description: 'Sets a refspec for the mainline branch. Default is head of main', trim: true, name: 'ENGINE_REFSPEC')
|
|
|
|
|
|
+ stringParam(defaultValue: "${ENGINE_BRANCH_DEFAULT}", description: 'Sets a different branch from o3de engine repo to use or use commit id. Default is mainline', trim: true, name: 'ENGINE_BRANCH')
|
|
]
|
|
]
|
|
|
|
|
|
def palSh(cmd, lbl = '', winSlashReplacement = true) {
|
|
def palSh(cmd, lbl = '', winSlashReplacement = true) {
|
|
@@ -186,25 +184,12 @@ def GetEnvStringList(Map envVarMap) {
|
|
return strList
|
|
return strList
|
|
}
|
|
}
|
|
|
|
|
|
-def GetLfsConfig(cmd, lbl = '') {
|
|
|
|
- if (env.IS_UNIX) {
|
|
|
|
- sh label: lbl,
|
|
|
|
- script: cmd,
|
|
|
|
- returnStdout: true
|
|
|
|
- } else {
|
|
|
|
- powershell label: lbl, // Powershell is used due to bat output returning the prompt as well
|
|
|
|
- script: cmd,
|
|
|
|
- returnStdout: true
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
def getEngineRemoteConfig(remoteConfigs) {
|
|
def getEngineRemoteConfig(remoteConfigs) {
|
|
def refSpec = "${params.ENGINE_REFSPEC}" ?: "${ENGINE_REFSPEC_DEFAULT}"
|
|
def refSpec = "${params.ENGINE_REFSPEC}" ?: "${ENGINE_REFSPEC_DEFAULT}"
|
|
def engineRemoteConfigs = [name: "${ENGINE_REPOSITORY_NAME}",
|
|
def engineRemoteConfigs = [name: "${ENGINE_REPOSITORY_NAME}",
|
|
url: remoteConfigs.url[0]
|
|
url: remoteConfigs.url[0]
|
|
.replace("${PROJECT_REPOSITORY_NAME}", "${ENGINE_REPOSITORY_NAME}")
|
|
.replace("${PROJECT_REPOSITORY_NAME}", "${ENGINE_REPOSITORY_NAME}")
|
|
.replace("/${PROJECT_ORGANIZATION_NAME}/", "/${ENGINE_ORGANIZATION_NAME}/"),
|
|
.replace("/${PROJECT_ORGANIZATION_NAME}/", "/${ENGINE_ORGANIZATION_NAME}/"),
|
|
- refspec: "+refs/heads/main:refs/remotes/${refSpec}",
|
|
|
|
credentialsId: remoteConfigs.credentialsId[0]
|
|
credentialsId: remoteConfigs.credentialsId[0]
|
|
]
|
|
]
|
|
return engineRemoteConfigs
|
|
return engineRemoteConfigs
|
|
@@ -281,7 +266,7 @@ def CheckoutRepo(boolean disableSubmodules = false) {
|
|
userRemoteConfigs: [projectAndUrl.value]
|
|
userRemoteConfigs: [projectAndUrl.value]
|
|
]
|
|
]
|
|
if(fileExists(".lfsconfig")) {
|
|
if(fileExists(".lfsconfig")) {
|
|
- def localLfsUrl = GetLfsConfig("git config -f .lfsconfig --get lfs.url", "Getting LFS URL").replace("https://","").trim() // Read the lfs file instead of relying on env var
|
|
|
|
|
|
+ def localLfsUrl = sh(script: "git config -f .lfsconfig --get lfs.url", label: "Getting LFS URL", returnStdout: true).replace("https://","").trim() // Read the lfs file instead of relying on env var
|
|
withCredentials([usernamePassword(credentialsId: "${env.GITHUB_USER}", passwordVariable: 'accesstoken', usernameVariable: 'username')]) {
|
|
withCredentials([usernamePassword(credentialsId: "${env.GITHUB_USER}", passwordVariable: 'accesstoken', usernameVariable: 'username')]) {
|
|
palSh("git config -f .lfsconfig lfs.url https://${username}:${accesstoken}@${localLfsUrl}", 'Set credentials', false)
|
|
palSh("git config -f .lfsconfig lfs.url https://${username}:${accesstoken}@${localLfsUrl}", 'Set credentials', false)
|
|
}
|
|
}
|
|
@@ -376,19 +361,22 @@ def Build(Map options, String platform, String type, String workspace) {
|
|
// In both cases, the scripts are in the engine, is just what the current dir is and how we get to the scripts
|
|
// In both cases, the scripts are in the engine, is just what the current dir is and how we get to the scripts
|
|
def currentDir = "${workspace}/${ENGINE_REPOSITORY_NAME}"
|
|
def currentDir = "${workspace}/${ENGINE_REPOSITORY_NAME}"
|
|
def pathToEngine = ""
|
|
def pathToEngine = ""
|
|
|
|
+ def scriptExt = ""
|
|
|
|
+ if (env.IS_UNIX) {
|
|
|
|
+ scriptExt = ".sh"
|
|
|
|
+ }
|
|
if (env.EXECUTE_FROM_PROJECT?.toBoolean()) {
|
|
if (env.EXECUTE_FROM_PROJECT?.toBoolean()) {
|
|
currentDir = "${workspace}/${PROJECT_REPOSITORY_NAME}"
|
|
currentDir = "${workspace}/${PROJECT_REPOSITORY_NAME}"
|
|
pathToEngine = "../${ENGINE_REPOSITORY_NAME}/"
|
|
pathToEngine = "../${ENGINE_REPOSITORY_NAME}/"
|
|
}
|
|
}
|
|
|
|
+ else {
|
|
|
|
+ dir("${currentDir}") {
|
|
|
|
+ palSh("scripts/o3de${scriptExt} register --project-path ${workspace}/${PROJECT_REPOSITORY_NAME}", "Registering project ${PROJECT_REPOSITORY_NAME}") // o3de.sh will work under Windows in a Cygwin environment
|
|
|
|
+ }
|
|
|
|
+ }
|
|
def command = "${pathToEngine}${options.BUILD_ENTRY_POINT} --platform ${platform} --type ${type}"
|
|
def command = "${pathToEngine}${options.BUILD_ENTRY_POINT} --platform ${platform} --type ${type}"
|
|
dir("${currentDir}") {
|
|
dir("${currentDir}") {
|
|
- if (env.IS_UNIX) {
|
|
|
|
- sh label: "Running ${platform} ${type}",
|
|
|
|
- script: "${pathToEngine}${options.PYTHON_DIR}/python.sh -u ${command}"
|
|
|
|
- } else {
|
|
|
|
- bat label: "Running ${platform} ${type}",
|
|
|
|
- script: "${pathToEngine}${options.PYTHON_DIR}/python.cmd -u ${command}".replace('/','\\')
|
|
|
|
- }
|
|
|
|
|
|
+ palSh("${pathToEngine}${options.PYTHON_DIR}/python${scriptExt} -u ${command}", "Running ${platform} ${type}")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|