From eda3f5941c9ab375fd3832eb351e5ae0b0bf9457 Mon Sep 17 00:00:00 2001 From: Eugene Agafonov Date: Mon, 1 Jun 2020 16:54:25 -0700 Subject: [PATCH] Build NPCs only if specified --- Jenkins/Jenkinsfile | 8 ++++++++ Jenkins/Jenkinsfile-Release | 10 ++++++++++ Jenkins/build-simulator.sh | 6 ++++-- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/Jenkins/Jenkinsfile b/Jenkins/Jenkinsfile index 0b322310d..17a0079d6 100644 --- a/Jenkins/Jenkinsfile +++ b/Jenkins/Jenkinsfile @@ -175,6 +175,14 @@ pipeline { } stage("Checkout NPCs") { + when { + not { + anyOf { + environment name: "SIMULATOR_NPCS_REPOS", value: "" + environment name: "SIMULATOR_NPCS", value: "" + } + } + } steps { script { def npcs = env.SIMULATOR_NPCS_REPOS.split(',') diff --git a/Jenkins/Jenkinsfile-Release b/Jenkins/Jenkinsfile-Release index 718445ee2..3ba14db1a 100644 --- a/Jenkins/Jenkinsfile-Release +++ b/Jenkins/Jenkinsfile-Release @@ -28,6 +28,8 @@ pipeline { FORCE_REBUILD = "${FORCE_REBUILD}" SIMULATOR_ENVIRONMENTS = "${SIMULATOR_ENVIRONMENTS_RELEASE}" SIMULATOR_SENSORS = "${SIMULATOR_SENSORS_RELEASE}" + SIMULATOR_NPCS_REPOS = "${SIMULATOR_NPCS_REPOS_RELEASE}" + SIMULATOR_NPCS = "${SIMULATOR_NPCS_RELEASE}" } stages { @@ -174,6 +176,14 @@ pipeline { } stage("Checkout NPCs") { + when { + not { + anyOf { + environment name: "SIMULATOR_NPCS_REPOS", value: "" + environment name: "SIMULATOR_NPCS", value: "" + } + } + } steps { script { def npcs = env.SIMULATOR_NPCS_REPOS.split(',') diff --git a/Jenkins/build-simulator.sh b/Jenkins/build-simulator.sh index 84919c69d..692beb18c 100755 --- a/Jenkins/build-simulator.sh +++ b/Jenkins/build-simulator.sh @@ -234,8 +234,10 @@ cp /mnt/AssetBundles/Controllables/controllable_* /tmp/${BUILD_OUTPUT}/AssetBund mkdir -p /tmp/${BUILD_OUTPUT}/AssetBundles/Sensors cp /mnt/AssetBundles/Sensors/sensor_* /tmp/${BUILD_OUTPUT}/AssetBundles/Sensors -mkdir -p /tmp/${BUILD_OUTPUT}/AssetBundles/NPCs -cp -R /mnt/AssetBundles/NPCs/* /tmp/${BUILD_OUTPUT}/AssetBundles/NPCs +if [ ! -z ${SIMULATOR_NPCS+x} ]; then + mkdir -p /tmp/${BUILD_OUTPUT}/AssetBundles/NPCs + cp -R /mnt/AssetBundles/NPCs/* /tmp/${BUILD_OUTPUT}/AssetBundles/NPCs +fi cd /tmp zip -r /mnt/${BUILD_OUTPUT}.zip ${BUILD_OUTPUT}