From b81fce458d45ea9b1594e2a64583c3c9f5475103 Mon Sep 17 00:00:00 2001 From: luke Date: Fri, 4 Aug 2017 22:45:12 -0700 Subject: [PATCH] updating pipeline script --- bitbucket-pipelines.yml | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index a3710212..a9059567 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -12,22 +12,23 @@ options: pipelines: default: - step: - script: # Modify the commands below to build your repository. + script: # Set $DOCKER_HUB_USERNAME and $DOCKER_HUB_PASSWORD as environment variables in repository settings - export IMAGE_NAME=ldooks/dragon-bot:latest - - # build the Docker image (this will use the Dockerfile in the root of the repo) - - docker build -t $IMAGE_NAME . - branches: - master: - - step: - script: - # authenticate with the Docker Hub registry - - docker login --username $DOCKER_HUB_USERNAME --password $DOCKER_HUB_PASSWORD - # push the new Docker image to the Docker registry - - docker push $IMAGE_NAME - feature/*: - - step: - image: yourdockerusername/imagename # This step uses its own image - script: - - echo "This script runs only on commit to branches with names that match the feature/* pattern." + branches: + master: + - step: + script: + # build the Docker image (this will use the Dockerfile in the root of the repo) + - docker build -t $IMAGE_NAME . + # authenticate with the Docker Hub registry + - docker login --username $DOCKER_HUB_USERNAME --password $DOCKER_HUB_PASSWORD + # push the new Docker image to the Docker registry + - docker push $IMAGE_NAME + feature/*: + - step: + image: $IMAGE_NAME + script: + # Only build iamges, dont push when we're on a feature branch + # build the Docker image (this will use the Dockerfile in the root of the repo) + - docker build -t $IMAGE_NAME . \ No newline at end of file