]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
correctly detect merge triggers
authorHolger Levsen <holger@layer-acht.org>
Wed, 24 Jul 2013 16:22:57 +0000 (18:22 +0200)
committerHolger Levsen <holger@layer-acht.org>
Wed, 24 Jul 2013 16:22:57 +0000 (18:22 +0200)
maven_pre_build_debian_wrapper.sh

index b8cf1707c4f9be42870c9d629f823252f6d5e0a8..6192b9674db133ae3275704a1251df59b61d3762 100755 (executable)
@@ -1,15 +1,9 @@
 #!/bin/bash
 
-function containsElement () {
-  local e
-  for e in "${@:2}"; do [[ "$e" = "$1" ]] && return 0; done
-  return 1
-}
-
 set -e
 
 if [ ${GIT_BRANCH_NAME:0:8} = "feature/" ] ; then
-       if containsElement "merge" "${BUILD_TRIGGERS[@]}" ; then
+       if [[ "$BUILD_TRIGGERS" == *"merge"* ]]; then
                echo "Switching to integration branch..."
                git checkout integration
                echo "Trying to fast-forward merge $GIT_BRANCH_NAME..."