Only push container on successful build
This commit is contained in:
parent
53d124bd7d
commit
ceb13c5ab6
@ -18,7 +18,16 @@ pipelines:
|
|||||||
|
|
||||||
# build the Docker image (this will use the Dockerfile in the root of the repo)
|
# build the Docker image (this will use the Dockerfile in the root of the repo)
|
||||||
- docker build -t $IMAGE_NAME .
|
- docker build -t $IMAGE_NAME .
|
||||||
# authenticate with the Docker Hub registry
|
branches:
|
||||||
- docker login --username $DOCKER_HUB_USERNAME --password $DOCKER_HUB_PASSWORD
|
master:
|
||||||
# push the new Docker image to the Docker registry
|
- step:
|
||||||
- docker push $IMAGE_NAME
|
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."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user