From 198fc3115e7eaba53eff61e78c2c2cd54f3e0706 Mon Sep 17 00:00:00 2001 From: Su Shi <1684739+metacpp@users.noreply.github.com> Date: Tue, 17 Jul 2018 18:01:37 -0700 Subject: [PATCH] Add different stages for different events. (#67) * add different stages for different events. * Simplify the image build parameters for build stage. * add master branch as condition for full stage. --- .travis.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ce97360..dc81171 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,14 @@ env: jobs: include: - - stage: rake full + - stage: build + if: type = pull_request + install: true + script: + - docker build --build-arg BUILD_TERRAFORM_VERSION=${TERRAFORM_VERSION} -t ${IMAGE_NAME} . + - docker run ${IMAGE_NAME} rake build + - stage: full + if: type = push AND branch = master install: true script: - docker build --build-arg BUILD_TERRAFORM_VERSION=${TERRAFORM_VERSION} --build-arg BUILD_ARM_SUBSCRIPTION_ID=$ARM_SUBSCRIPTION_ID --build-arg BUILD_ARM_CLIENT_ID=$ARM_CLIENT_ID --build-arg BUILD_ARM_CLIENT_SECRET=$ARM_CLIENT_SECRET --build-arg BUILD_ARM_TENANT_ID=$ARM_TENANT_ID -t ${IMAGE_NAME} .