updating pipeline script

This commit is contained in:
luke 2017-08-04 22:45:12 -07:00
parent ceb13c5ab6
commit b81fce458d

View File

@ -12,22 +12,23 @@ options:
pipelines: pipelines:
default: default:
- step: - 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 # Set $DOCKER_HUB_USERNAME and $DOCKER_HUB_PASSWORD as environment variables in repository settings
- export IMAGE_NAME=ldooks/dragon-bot:latest - 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: branches:
master: master:
- step: - step:
script: 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 # authenticate with the Docker Hub registry
- docker login --username $DOCKER_HUB_USERNAME --password $DOCKER_HUB_PASSWORD - docker login --username $DOCKER_HUB_USERNAME --password $DOCKER_HUB_PASSWORD
# push the new Docker image to the Docker registry # push the new Docker image to the Docker registry
- docker push $IMAGE_NAME - docker push $IMAGE_NAME
feature/*: feature/*:
- step: - step:
image: yourdockerusername/imagename # This step uses its own image image: $IMAGE_NAME
script: script:
- echo "This script runs only on commit to branches with names that match the feature/* pattern." # 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 .