mirror of
https://github.com/wassname/talk.git
synced 2026-08-06 13:41:02 +08:00
Adjusted docker build script
This commit is contained in:
+2
-2
@@ -47,9 +47,9 @@ deployment:
|
||||
release:
|
||||
tag: /v[0-9]+(\.[0-9]+)*/
|
||||
commands:
|
||||
- bash ./scripts/deploy.sh
|
||||
- bash ./scripts/docker.sh deploy
|
||||
|
||||
latest:
|
||||
branch: master
|
||||
commands:
|
||||
- bash ./scripts/deploy.sh
|
||||
- bash ./scripts/docker.sh deploy
|
||||
|
||||
@@ -2,9 +2,7 @@
|
||||
|
||||
set -e
|
||||
|
||||
docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
|
||||
|
||||
# Sourced from https://segment.com/blog/ci-at-segment/
|
||||
# Inspired by https://segment.com/blog/ci-at-segment/
|
||||
|
||||
deploy_tag() {
|
||||
# Find our individual versions from the tags
|
||||
@@ -50,10 +48,21 @@ deploy_latest() {
|
||||
docker build -t coralproject/talk:latest -f Dockerfile .
|
||||
docker build -t coralproject/talk:latest-onbuild -f Dockerfile.onbuild .
|
||||
|
||||
# deploy based on the env
|
||||
if [ -n "$CIRCLE_TAG" ]
|
||||
if [ "$1" -eq "deploy" ]
|
||||
then
|
||||
deploy_tag
|
||||
else
|
||||
deploy_latest
|
||||
fi
|
||||
|
||||
if [[ -n "$DOCKER_EMAIL" && -n "$DOCKER_USER" && -n "$DOCKER_PASS" ]]
|
||||
then
|
||||
|
||||
# Log the Docker Daemon in
|
||||
docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
|
||||
fi
|
||||
|
||||
# deploy based on the env
|
||||
if [ -n "$CIRCLE_TAG" ]
|
||||
then
|
||||
deploy_tag
|
||||
else
|
||||
deploy_latest
|
||||
fi
|
||||
fi
|
||||
Reference in New Issue
Block a user