Evaluation of Groovy script never used to turn task off
When using "Dynamic Task De-Activation" the result of the Groovy execution is never actually used to de-activate the tasks. As seen here. The result
variable is never used until the next section that's used for "Dynamic Tasks Switcher". The effect of this is that ANY task matching the regexp will be disabled, no matter the result of the Groovy script.
Comments (9)
-
repo owner -
repo owner You are right, I got mixed up !
-
Account Deleted Yes, I ended up using "Dynamic Tasks Switcher" as an alternative, which currently works fine.
-
repo owner Commited a fix and published release. I am also using the task switcher actually.
-
Account Deleted Thanks! But according to your own description of the functionality: "Groovy that will return String True or False if job should be skipped or not" I read as "if true it will skip", but in your commit you do
if(value.equalsIgnoreCase("false")) td.setEnabled(false);
, which will disable the task if it returns false.If I understood it right.
-
repo owner Hmm if True the task should be set to false, if false ... nothing.
-
repo owner check now the commit :) maybe I wake up
-
Account Deleted Looks good now. :) Thanks.
-
Account Deleted Hey!
Seems that "Dynamic Task De-activation" is not working as expected.
I currently have 3 tasks setup: - Task for specific branch - Task for dev2 branch - Task that always runs
This is my current config:
When I'm running a branch build on 'dev2' branch and this is bamboo output:
simple 14-Apr-2016 11:19:32 GroovyShell bindings: simple 14-Apr-2016 11:19:32 groovyVariableName=Condition simple 14-Apr-2016 11:19:32 deploy_webhook=https://hooks.slack.com/services/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 simple 14-Apr-2016 11:19:32 bambooDelimiterParsingDisabled_0=true simple 14-Apr-2016 11:19:32 filter_pattern_option_0=none simple 14-Apr-2016 11:19:32 filter_pattern_regex_0= simple 14-Apr-2016 11:19:32 changeset_filter_pattern_regex_0= simple 14-Apr-2016 11:19:32 repository_common_quietPeriod_enabled_0=false simple 14-Apr-2016 11:19:32 repository_common_quietPeriod_period_0=10 simple 14-Apr-2016 11:19:32 repository_common_quietPeriod_maxRetries_0=5 simple 14-Apr-2016 11:19:32 repository_bitbucket_username_0=xxxxxxxxxxxxxxxxx simple 14-Apr-2016 11:19:32 repository_bitbucket_repository_0=xxxx/xxxxxxxx simple 14-Apr-2016 11:19:32 repository_bitbucket_scm_0=GIT simple 14-Apr-2016 11:19:32 repository_bitbucket_branch_0=dev2 simple 14-Apr-2016 11:19:32 repository_bitbucket_showAdvancedOptions_0=false simple 14-Apr-2016 11:19:32 repository_bitbucket_commandTimeout_0=180 simple 14-Apr-2016 11:19:32 repository_bitbucket_verbose_logs_0=false simple 14-Apr-2016 11:19:32 repository_bitbucket_fetch_whole_repository_0=false simple 14-Apr-2016 11:19:32 repository_bitbucket_git_useShallowClones_0=false simple 14-Apr-2016 11:19:32 repository_bitbucket_git_useSubmodules_0=false simple 14-Apr-2016 11:19:32 repository_bitbucket_git_useRemoteAgentCache_0=false simple 14-Apr-2016 11:19:32 selectedWebRepositoryViewer_0=bamboo.webrepositoryviewer.provided:noRepositoryViewer simple 14-Apr-2016 11:19:32 Groovy Shell starting simple 14-Apr-2016 11:19:32 Groovy script if (repository_bitbucket_branch_0.equalsIgnoreCase("dev2")) return true; evaluated to [true] simple 14-Apr-2016 11:19:32 GroovyShell bindings: simple 14-Apr-2016 11:19:32 groovyVariableName=Condition simple 14-Apr-2016 11:19:32 deploy_webhook=https://hooks.slack.com/services/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 simple 14-Apr-2016 11:19:32 bambooDelimiterParsingDisabled_0=true simple 14-Apr-2016 11:19:32 filter_pattern_option_0=none simple 14-Apr-2016 11:19:32 filter_pattern_regex_0= simple 14-Apr-2016 11:19:32 changeset_filter_pattern_regex_0= simple 14-Apr-2016 11:19:32 repository_common_quietPeriod_enabled_0=false simple 14-Apr-2016 11:19:32 repository_common_quietPeriod_period_0=10 simple 14-Apr-2016 11:19:32 repository_common_quietPeriod_maxRetries_0=5 simple 14-Apr-2016 11:19:32 repository_bitbucket_username_0=xxxxxxxxxxxxxxxxx simple 14-Apr-2016 11:19:32 repository_bitbucket_repository_0=xxxx/xxxxxxxx simple 14-Apr-2016 11:19:32 repository_bitbucket_scm_0=GIT simple 14-Apr-2016 11:19:32 repository_bitbucket_branch_0=dev2 simple 14-Apr-2016 11:19:32 repository_bitbucket_showAdvancedOptions_0=false simple 14-Apr-2016 11:19:32 repository_bitbucket_commandTimeout_0=180 simple 14-Apr-2016 11:19:32 repository_bitbucket_verbose_logs_0=false simple 14-Apr-2016 11:19:32 repository_bitbucket_fetch_whole_repository_0=false simple 14-Apr-2016 11:19:32 repository_bitbucket_git_useShallowClones_0=false simple 14-Apr-2016 11:19:32 repository_bitbucket_git_useSubmodules_0=false simple 14-Apr-2016 11:19:32 repository_bitbucket_git_useRemoteAgentCache_0=false simple 14-Apr-2016 11:19:32 selectedWebRepositoryViewer_0=bamboo.webrepositoryviewer.provided:noRepositoryViewer simple 14-Apr-2016 11:19:32 Groovy Shell starting simple 14-Apr-2016 11:19:32 Groovy script /(.*)${repository_bitbucket_branch_0} branch/ evaluated to [(.*)dev2 branch] simple 14-Apr-2016 11:19:32 Task [specific branch] is not matching [(.*)dev2 branch] simple 14-Apr-2016 11:19:32 Task [Run Tests - NO TESTS AVAIL] is not matching [(.*)dev2 branch] simple 14-Apr-2016 11:19:32 Setting state [true] for task [Task for dev2 branch] simple 14-Apr-2016 11:19:32 Task [This script has run] is not matching [(.*)dev2 branch] simple 14-Apr-2016 11:19:32 Build Components - xxxxxxxx - dev2 - Testing #68 (PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9-DATABASETESTING-68) started building on agent xxxxxxxx simple 14-Apr-2016 11:19:32 simple 14-Apr-2016 11:19:32 Build working directory is /mnt/bamboo/bamboo-home/xml-data/build-dir/PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9-DATABASETESTING simple 14-Apr-2016 11:19:32 Executing build Components - xxxxxxxx - dev2 - Testing #68 (PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9-DATABASETESTING-68) simple 14-Apr-2016 11:19:32 Preparing artifact 'xxxxxxxxxxxxxxxxxxxxxArtifact' for use at . simple 14-Apr-2016 11:19:32 Artifact 'xxxxxxxxxxxxxxxxxxxxxArtifact' prepared in 00:00:00.036 at /mnt/bamboo/bamboo-home/xml-data/build-dir/PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9-DATABASETESTING/. simple 14-Apr-2016 11:19:32 Running pre-build action: VCS Version Collector simple 14-Apr-2016 11:19:32 Starting task 'specific branch' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script' command 14-Apr-2016 11:19:32 Beginning to execute external process for build 'Components - xxxxxxxx - dev2 - Testing #68 (PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9-DATABASETESTING-68)'\n ... running command line: \n/bin/sh /mnt/bamboo/atlassian-bamboo-5.10.0/temp/PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9-DATABASETESTING-68-ScriptBuildTask-3553406931731478385.sh\n ... in: /mnt/bamboo/bamboo-home/xml-data/build-dir/PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9-DATABASETESTING\n ... using extra environment variables: \nbamboo_planRepository_1_branch=dev2\nbamboo_repository_revision_number=b2ba3d547b881be37ce65d296d4413edc2995b47\nbamboo_artifacts_path_xxxxxxxxxxxxxxxxxxxxxArtifact=.\nbamboo_resultsUrl=https://bamboo.xxxxxxxxxxxxx.com/browse/PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9-DATABASETESTING-68\nbamboo_capability_system_builder_sbt_SBT=/usr/share/sbt-launcher-packaging\nbamboo_planRepository_1_name=xxxx/xxxxxxxx MASTER\nbamboo_build_working_directory=/mnt/bamboo/bamboo-home/xml-data/build-dir/PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9-DATABASETESTING\nbamboo_buildKey=PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9-DATABASETESTING\nbamboo_shortPlanName=dev2\nbamboo_planRepository_name=xxxx/xxxxxxxx MASTER\nbamboo_buildNumber=68\nbamboo_deploy_webhook=https://hooks.slack.com/services/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\nbamboo_shortJobName=Testing\nbamboo_buildResultsUrl=https://bamboo.xxxxxxxxxxxxx.com/browse/PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9-DATABASETESTING-68\nbamboo_planRepository_repositoryUrl=https://bitbucket.org/xxxx/xxxxxxxx\nbamboo_capability_system_builder_command_cp=/bin/cp\nbamboo_capability_system_builder_command_Run_SBT=/usr/bin/sbt\nbamboo_agentId=26836993\nbamboo_planName=Components - xxxxxxxx - dev2\nbamboo_shortPlanKey=xxxxxxxxxxxxxxxxxxxxx9\nbamboo_capability_system_builder_command_git=/usr/bin/git\nbamboo_shortJobKey=DATABASETESTING\nbamboo_planRepository_revision=b2ba3d547b881be37ce65d296d4413edc2995b47\nbamboo_repository_26312902_branch_name=dev2\nbamboo_repository_previous_revision_number=b2ba3d547b881be37ce65d296d4413edc2995b47\nbamboo_buildTimeStamp=2016-04-14T11:19:32.661Z\nbamboo_planRepository_previousRevision=b2ba3d547b881be37ce65d296d4413edc2995b47\nbamboo_repository_26312902_name=xxxx/xxxxxxxx MASTER\nbamboo_buildResultKey=PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9-DATABASETESTING-68\nbamboo_repository_git_branch=dev2\nbamboo_repository_branch_name=dev2\nbamboo_buildPlanName=Components - xxxxxxxx - dev2 - Testing\nbamboo_capability_system_builder_command_docker=/usr/bin/docker\nbamboo_planRepository_1_revision=b2ba3d547b881be37ce65d296d4413edc2995b47\nbamboo_repository_name=xxxx/xxxxxxxx MASTER\nbamboo_dependenciesDisabled=false\nbamboo_capability_system_docker_executable=/usr/bin/docker\nbamboo_planRepository_branch=dev2\nbamboo_capability_system_builder_command_echo=/usr/bin/echo\nbamboo_capability_system_builder_command_sbt=/usr/bin/sbt\nbamboo_agentWorkingDirectory=/mnt/bamboo/bamboo-home/xml-data/build-dir\nbamboo_capability_system_git_executable=/usr/bin/git\nbamboo_planRepository_1_previousRevision=b2ba3d547b881be37ce65d296d4413edc2995b47\nbamboo_repository_git_username=xxxxxxxxxxxxxxxxx\nbamboo_repository_26312902_git_username=xxxxxxxxxxxxxxxxx\nbamboo_planRepository_1_type=bb\nbamboo_planRepository_branchName=dev2\nbamboo_repository_26312902_previous_revision_number=b2ba3d547b881be37ce65d296d4413edc2995b47\nbamboo_capability_system_jdk_JDK=/usr/lib/jvm/java-8-oracle\nbamboo_capability_system_builder_command_mv=/bin/mv\nbamboo_planRepository_type=bb\nbamboo_planRepository_1_username=xxxxxxxxxxxxxxxxx\nbamboo_capability_system_jdk_JDK_1_8_0_66=/usr/lib/jvm/java-8-oracle\nbamboo_ManualBuildTriggerReason_userName=ricardo\nbamboo_repository_git_repositoryUrl=https://bitbucket.org/xxxx/xxxxxxxx\nbamboo_capability_system_builder_node_Node_js=/usr/bin/nodejs\nbamboo_working_directory=/mnt/bamboo/bamboo-home/xml-data/build-dir/PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9-DATABASETESTING\nbamboo_planKey=PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9\nbamboo_capability_system_builder_sbt_SBT_Exec=/usr/\nbamboo_repository_26312902_git_repositoryUrl=https://bitbucket.org/xxxx/xxxxxxxx\nbamboo_planRepository_1_repositoryUrl=https://bitbucket.org/xxxx/xxxxxxxx\nbamboo_planRepository_username=xxxxxxxxxxxxxxxxx\nbamboo_capability_system_jdk_JDK_1_8=/usr/lib/jvm/java-8-oracle\nbamboo_repository_26312902_revision_number=b2ba3d547b881be37ce65d296d4413edc2995b47\nbamboo_capability_system_builder_command_zip=/usr/bin/zip\nbamboo_repository_26312902_git_branch=dev2\nbamboo_planRepository_1_branchName=dev2\n build 14-Apr-2016 11:19:32 SPECIFIC BRANCH WAS RAN simple 14-Apr-2016 11:19:33 Finished task 'specific branch' with result: Success simple 14-Apr-2016 11:19:33 Skipping execution of task 'Run Tests - NO TESTS AVAIL' as it is disabled simple 14-Apr-2016 11:19:33 Starting task 'Task for dev2 branch' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script' command 14-Apr-2016 11:19:33 Beginning to execute external process for build 'Components - xxxxxxxx - dev2 - Testing #68 (PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9-DATABASETESTING-68)'\n ... running command line: \n/bin/sh /mnt/bamboo/atlassian-bamboo-5.10.0/temp/PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9-DATABASETESTING-68-ScriptBuildTask-1888517797471006840.sh\n ... in: /mnt/bamboo/bamboo-home/xml-data/build-dir/PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9-DATABASETESTING\n ... using extra environment variables: \nbamboo_planRepository_1_branch=dev2\nbamboo_repository_revision_number=b2ba3d547b881be37ce65d296d4413edc2995b47\nbamboo_artifacts_path_xxxxxxxxxxxxxxxxxxxxxArtifact=.\nbamboo_resultsUrl=https://bamboo.xxxxxxxxxxxxx.com/browse/PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9-DATABASETESTING-68\nbamboo_capability_system_builder_sbt_SBT=/usr/share/sbt-launcher-packaging\nbamboo_planRepository_1_name=xxxx/xxxxxxxx MASTER\nbamboo_build_working_directory=/mnt/bamboo/bamboo-home/xml-data/build-dir/PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9-DATABASETESTING\nbamboo_buildKey=PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9-DATABASETESTING\nbamboo_shortPlanName=dev2\nbamboo_planRepository_name=xxxx/xxxxxxxx MASTER\nbamboo_buildNumber=68\nbamboo_deploy_webhook=https://hooks.slack.com/services/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\nbamboo_shortJobName=Testing\nbamboo_buildResultsUrl=https://bamboo.xxxxxxxxxxxxx.com/browse/PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9-DATABASETESTING-68\nbamboo_planRepository_repositoryUrl=https://bitbucket.org/xxxx/xxxxxxxx\nbamboo_capability_system_builder_command_cp=/bin/cp\nbamboo_capability_system_builder_command_Run_SBT=/usr/bin/sbt\nbamboo_agentId=26836993\nbamboo_planName=Components - xxxxxxxx - dev2\nbamboo_shortPlanKey=xxxxxxxxxxxxxxxxxxxxx9\nbamboo_capability_system_builder_command_git=/usr/bin/git\nbamboo_shortJobKey=DATABASETESTING\nbamboo_planRepository_revision=b2ba3d547b881be37ce65d296d4413edc2995b47\nbamboo_repository_26312902_branch_name=dev2\nbamboo_repository_previous_revision_number=b2ba3d547b881be37ce65d296d4413edc2995b47\nbamboo_buildTimeStamp=2016-04-14T11:19:32.661Z\nbamboo_planRepository_previousRevision=b2ba3d547b881be37ce65d296d4413edc2995b47\nbamboo_repository_26312902_name=xxxx/xxxxxxxx MASTER\nbamboo_build_commandline_com_atlassian_bamboo_plugins_scripttask_task_builder_script_5=/bin/sh /mnt/bamboo/atlassian-bamboo-5.10.0/temp/PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9-DATABASETESTING-68-ScriptBuildTask-3553406931731478385.sh\nbamboo_buildResultKey=PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9-DATABASETESTING-68\nbamboo_repository_git_branch=dev2\nbamboo_repository_branch_name=dev2\nbamboo_buildPlanName=Components - xxxxxxxx - dev2 - Testing\nbamboo_capability_system_builder_command_docker=/usr/bin/docker\nbamboo_planRepository_1_revision=b2ba3d547b881be37ce65d296d4413edc2995b47\nbamboo_repository_name=xxxx/xxxxxxxx MASTER\nbamboo_dependenciesDisabled=false\nbamboo_capability_system_docker_executable=/usr/bin/docker\nbamboo_planRepository_branch=dev2\nbamboo_capability_system_builder_command_echo=/usr/bin/echo\nbamboo_capability_system_builder_command_sbt=/usr/bin/sbt\nbamboo_agentWorkingDirectory=/mnt/bamboo/bamboo-home/xml-data/build-dir\nbamboo_capability_system_git_executable=/usr/bin/git\nbamboo_planRepository_1_previousRevision=b2ba3d547b881be37ce65d296d4413edc2995b47\nbamboo_repository_git_username=xxxxxxxxxxxxxxxxx\nbamboo_repository_26312902_git_username=xxxxxxxxxxxxxxxxx\nbamboo_planRepository_1_type=bb\nbamboo_planRepository_branchName=dev2\nbamboo_repository_26312902_previous_revision_number=b2ba3d547b881be37ce65d296d4413edc2995b47\nbamboo_capability_system_jdk_JDK=/usr/lib/jvm/java-8-oracle\nbamboo_capability_system_builder_command_mv=/bin/mv\nbamboo_planRepository_type=bb\nbamboo_planRepository_1_username=xxxxxxxxxxxxxxxxx\nbamboo_capability_system_jdk_JDK_1_8_0_66=/usr/lib/jvm/java-8-oracle\nbamboo_ManualBuildTriggerReason_userName=ricardo\nbamboo_repository_git_repositoryUrl=https://bitbucket.org/xxxx/xxxxxxxx\nbamboo_capability_system_builder_node_Node_js=/usr/bin/nodejs\nbamboo_working_directory=/mnt/bamboo/bamboo-home/xml-data/build-dir/PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9-DATABASETESTING\nbamboo_planKey=PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9\nbamboo_capability_system_builder_sbt_SBT_Exec=/usr/\nbamboo_repository_26312902_git_repositoryUrl=https://bitbucket.org/xxxx/xxxxxxxx\nbamboo_planRepository_1_repositoryUrl=https://bitbucket.org/xxxx/xxxxxxxx\nbamboo_planRepository_username=xxxxxxxxxxxxxxxxx\nbamboo_capability_system_jdk_JDK_1_8=/usr/lib/jvm/java-8-oracle\nbamboo_repository_26312902_revision_number=b2ba3d547b881be37ce65d296d4413edc2995b47\nbamboo_capability_system_builder_command_zip=/usr/bin/zip\nbamboo_repository_26312902_git_branch=dev2\nbamboo_planRepository_1_branchName=dev2\n build 14-Apr-2016 11:19:33 DEV2 BRANCH WAS RAN simple 14-Apr-2016 11:19:33 Finished task 'Task for dev2 branch' with result: Success simple 14-Apr-2016 11:19:33 Starting task 'This script has run' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script' command 14-Apr-2016 11:19:33 Beginning to execute external process for build 'Components - xxxxxxxx - dev2 - Testing #68 (PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9-DATABASETESTING-68)'\n ... running command line: \n/bin/sh /mnt/bamboo/atlassian-bamboo-5.10.0/temp/PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9-DATABASETESTING-68-ScriptBuildTask-4449637057485774137.sh\n ... in: /mnt/bamboo/bamboo-home/xml-data/build-dir/PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9-DATABASETESTING\n ... using extra environment variables: \nbamboo_planRepository_1_branch=dev2\nbamboo_repository_revision_number=b2ba3d547b881be37ce65d296d4413edc2995b47\nbamboo_artifacts_path_xxxxxxxxxxxxxxxxxxxxxArtifact=.\nbamboo_resultsUrl=https://bamboo.xxxxxxxxxxxxx.com/browse/PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9-DATABASETESTING-68\nbamboo_capability_system_builder_sbt_SBT=/usr/share/sbt-launcher-packaging\nbamboo_planRepository_1_name=xxxx/xxxxxxxx MASTER\nbamboo_build_working_directory=/mnt/bamboo/bamboo-home/xml-data/build-dir/PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9-DATABASETESTING\nbamboo_buildKey=PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9-DATABASETESTING\nbamboo_shortPlanName=dev2\nbamboo_planRepository_name=xxxx/xxxxxxxx MASTER\nbamboo_buildNumber=68\nbamboo_deploy_webhook=https://hooks.slack.com/services/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\nbamboo_shortJobName=Testing\nbamboo_buildResultsUrl=https://bamboo.xxxxxxxxxxxxx.com/browse/PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9-DATABASETESTING-68\nbamboo_planRepository_repositoryUrl=https://bitbucket.org/xxxx/xxxxxxxx\nbamboo_capability_system_builder_command_cp=/bin/cp\nbamboo_capability_system_builder_command_Run_SBT=/usr/bin/sbt\nbamboo_agentId=26836993\nbamboo_planName=Components - xxxxxxxx - dev2\nbamboo_shortPlanKey=xxxxxxxxxxxxxxxxxxxxx9\nbamboo_capability_system_builder_command_git=/usr/bin/git\nbamboo_shortJobKey=DATABASETESTING\nbamboo_planRepository_revision=b2ba3d547b881be37ce65d296d4413edc2995b47\nbamboo_repository_26312902_branch_name=dev2\nbamboo_repository_previous_revision_number=b2ba3d547b881be37ce65d296d4413edc2995b47\nbamboo_buildTimeStamp=2016-04-14T11:19:32.661Z\nbamboo_planRepository_previousRevision=b2ba3d547b881be37ce65d296d4413edc2995b47\nbamboo_repository_26312902_name=xxxx/xxxxxxxx MASTER\nbamboo_build_commandline_com_atlassian_bamboo_plugins_scripttask_task_builder_script_3=/bin/sh /mnt/bamboo/atlassian-bamboo-5.10.0/temp/PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9-DATABASETESTING-68-ScriptBuildTask-1888517797471006840.sh\nbamboo_build_commandline_com_atlassian_bamboo_plugins_scripttask_task_builder_script_5=/bin/sh /mnt/bamboo/atlassian-bamboo-5.10.0/temp/PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9-DATABASETESTING-68-ScriptBuildTask-3553406931731478385.sh\nbamboo_buildResultKey=PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9-DATABASETESTING-68\nbamboo_repository_git_branch=dev2\nbamboo_repository_branch_name=dev2\nbamboo_buildPlanName=Components - xxxxxxxx - dev2 - Testing\nbamboo_capability_system_builder_command_docker=/usr/bin/docker\nbamboo_planRepository_1_revision=b2ba3d547b881be37ce65d296d4413edc2995b47\nbamboo_repository_name=xxxx/xxxxxxxx MASTER\nbamboo_dependenciesDisabled=false\nbamboo_capability_system_docker_executable=/usr/bin/docker\nbamboo_planRepository_branch=dev2\nbamboo_capability_system_builder_command_echo=/usr/bin/echo\nbamboo_capability_system_builder_command_sbt=/usr/bin/sbt\nbamboo_agentWorkingDirectory=/mnt/bamboo/bamboo-home/xml-data/build-dir\nbamboo_capability_system_git_executable=/usr/bin/git\nbamboo_planRepository_1_previousRevision=b2ba3d547b881be37ce65d296d4413edc2995b47\nbamboo_repository_git_username=xxxxxxxxxxxxxxxxx\nbamboo_repository_26312902_git_username=xxxxxxxxxxxxxxxxx\nbamboo_planRepository_1_type=bb\nbamboo_planRepository_branchName=dev2\nbamboo_repository_26312902_previous_revision_number=b2ba3d547b881be37ce65d296d4413edc2995b47\nbamboo_capability_system_jdk_JDK=/usr/lib/jvm/java-8-oracle\nbamboo_capability_system_builder_command_mv=/bin/mv\nbamboo_planRepository_type=bb\nbamboo_planRepository_1_username=xxxxxxxxxxxxxxxxx\nbamboo_capability_system_jdk_JDK_1_8_0_66=/usr/lib/jvm/java-8-oracle\nbamboo_ManualBuildTriggerReason_userName=ricardo\nbamboo_repository_git_repositoryUrl=https://bitbucket.org/xxxx/xxxxxxxx\nbamboo_capability_system_builder_node_Node_js=/usr/bin/nodejs\nbamboo_working_directory=/mnt/bamboo/bamboo-home/xml-data/build-dir/PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9-DATABASETESTING\nbamboo_planKey=PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9\nbamboo_capability_system_builder_sbt_SBT_Exec=/usr/\nbamboo_repository_26312902_git_repositoryUrl=https://bitbucket.org/xxxx/xxxxxxxx\nbamboo_planRepository_1_repositoryUrl=https://bitbucket.org/xxxx/xxxxxxxx\nbamboo_planRepository_username=xxxxxxxxxxxxxxxxx\nbamboo_capability_system_jdk_JDK_1_8=/usr/lib/jvm/java-8-oracle\nbamboo_repository_26312902_revision_number=b2ba3d547b881be37ce65d296d4413edc2995b47\nbamboo_capability_system_builder_command_zip=/usr/bin/zip\nbamboo_repository_26312902_git_branch=dev2\nbamboo_planRepository_1_branchName=dev2\n build 14-Apr-2016 11:19:33 TEST TASK THAT ALWAYS RUNS simple 14-Apr-2016 11:19:34 Finished task 'This script has run' with result: Success simple 14-Apr-2016 11:19:34 Running post build plugin 'NCover Results Collector' simple 14-Apr-2016 11:19:34 Running post build plugin 'Artifact Copier' simple 14-Apr-2016 11:19:34 Running post build plugin 'npm Cache Cleanup' simple 14-Apr-2016 11:19:34 Running post build plugin 'Clover Results Collector' simple 14-Apr-2016 11:19:34 Running post build plugin 'Docker Container Cleanup' simple 14-Apr-2016 11:19:34 Successfully removed working directory at '/mnt/bamboo/bamboo-home/xml-data/build-dir/PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9-DATABASETESTING' simple 14-Apr-2016 11:19:34 Finalising the build... simple 14-Apr-2016 11:19:34 Stopping timer. simple 14-Apr-2016 11:19:34 Build PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9-DATABASETESTING-68 completed. simple 14-Apr-2016 11:19:34 Running on server: post build plugin 'NCover Results Collector' simple 14-Apr-2016 11:19:34 Running on server: post build plugin 'Build Hanging Detection Configuration' simple 14-Apr-2016 11:19:34 Running on server: post build plugin 'Clover Delta Calculator' simple 14-Apr-2016 11:19:34 Running on server: post build plugin 'Maven Dependencies Postprocessor' simple 14-Apr-2016 11:19:34 All post build plugins have finished simple 14-Apr-2016 11:19:34 Generating build results summary... simple 14-Apr-2016 11:19:34 Saving build results to disk... simple 14-Apr-2016 11:19:34 Logging substituted variables... simple 14-Apr-2016 11:19:34 Indexing build results... simple 14-Apr-2016 11:19:34 Finished building PRODUCTION-xxxxxxxxxxxxxxxxxxxxx9-DATABASETESTING-68.
Seems that even tho "Dynamic Task De-Activation" evaluates my condition to true it does not skip the specific branch task:
simple 14-Apr-2016 11:19:32 Groovy Shell starting simple 14-Apr-2016 11:19:32 Groovy script if (repository_bitbucket_branch_0.equalsIgnoreCase("dev2")) return true; evaluated to [true]
Seems to be some sort of bug. I'm using the latest version downloaded from atlassian marketplace.
- Log in to comment
That is what I use it for, I use the groovy to calculate a regexp that will be used to enable or disable a list of tasks dynamically.
For example on branch "develop" I want to disable all tasks named "task only for master branch".
If you got any other idea on how to use the plugin we can include it.