mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 01:41:22 -06:00
Added scripts/docker-build.sh for building docker images in CI
This commit is contained in:
parent
d045429b51
commit
5afb98ffa7
21
scripts/docker-build.sh
Normal file
21
scripts/docker-build.sh
Normal file
@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "docker login failed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
docker build -t "$DOCKER_REPOSITORY/$DOCKER_IMAGE_NAME:$DOCKER_TAG" .
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "docker build failed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
docker push "$DOCKER_REPOSITORY/$DOCKER_IMAGE_NAME:$DOCKER_TAG"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "docker push failed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exit 0
|
Loading…
Reference in New Issue
Block a user