From 8f2c650baca9090fb4f4abbe42123a4d9f0ad7ae Mon Sep 17 00:00:00 2001 From: Jonathan Cobb Date: Fri, 13 Nov 2020 22:29:53 -0500 Subject: [PATCH] build image before checking version, fix test --- bin/jenkins/push_docker | 12 +++++++----- .../bubble/test/promo/MultiplePromotionsTest.java | 4 ++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/bin/jenkins/push_docker b/bin/jenkins/push_docker index 67324e1d..5282e883 100755 --- a/bin/jenkins/push_docker +++ b/bin/jenkins/push_docker @@ -42,16 +42,18 @@ if [[ -z "${VERSION}" ]] ; then fi echo "Found Bubble version ${VERSION}" -echo "Checking to see if this version already exists on dockerhub..." +echo "Building docker bubble version ${VERSION} ..." +BUBBLE_DOCKER="${BUBBLE_DIR}/docker/bubble.sh" +${BUBBLE_DOCKER} build || die "Error building docker image" + +echo "Checking to see if version ${VERSION} already exists on dockerhub..." if docker manifest inspect "getbubble/launcher:${VERSION}" > /dev/null 2> /dev/null ; then - echo "Version already exists on dockerhub, not re-publishing: ${VERSION}" + echo "Version ${VERSION} already exists on dockerhub, not re-publishing" exit 0 fi -echo "Version does not exist on dockerhub, building and pushing it..." +echo "Version does not exist on dockerhub, pushing it..." -BUBBLE_DOCKER="${BUBBLE_DIR}/docker/bubble.sh" -${BUBBLE_DOCKER} build || die "Error building docker image" ${BUBBLE_DOCKER} push || die "Error pushing docker image" echo "Successfully pushed to dockerhub: ${VERSION}" diff --git a/bubble-server/src/test/java/bubble/test/promo/MultiplePromotionsTest.java b/bubble-server/src/test/java/bubble/test/promo/MultiplePromotionsTest.java index bf6e87f2..6050dc0f 100644 --- a/bubble-server/src/test/java/bubble/test/promo/MultiplePromotionsTest.java +++ b/bubble-server/src/test/java/bubble/test/promo/MultiplePromotionsTest.java @@ -4,8 +4,10 @@ */ package bubble.test.promo; +import bubble.auth.PromoCodePolicy; import bubble.test.payment.PaymentTestBase; import lombok.extern.slf4j.Slf4j; +import org.junit.Before; import org.junit.Test; @Slf4j @@ -13,6 +15,8 @@ public class MultiplePromotionsTest extends PaymentTestBase { @Override protected String getManifest() { return "promo/multi/manifest_multi"; } + @Before public void ensurePromoCodeOptional() { getConfiguration().setPromoCodePolicy(PromoCodePolicy.optional); } + @Test public void testMultiplePromotions() throws Exception { modelTest("promo/multi_promo"); } }