This repository has been archived by the owner on May 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Docker] Setup deployment of demo docker image (#28)
- Loading branch information
Showing
3 changed files
with
61 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/bin/env sh | ||
|
||
set -e | ||
|
||
# See .travis.yml for example use | ||
|
||
validateEnvironment() | ||
{ | ||
if [ "$DOCKER_EMAIL" = "" ]; then | ||
echo "Environment variable DOCKER_EMAIL is not set. Bailing out !" | ||
exit 1 | ||
fi | ||
if [ "$DOCKER_USERNAME" = "" ]; then | ||
echo "Environment variable DOCKER_USERNAME is not set. Bailing out !" | ||
exit 1 | ||
fi | ||
if [ "$DOCKER_PASSWORD" = "" ]; then | ||
echo "Environment variable DOCKER_PASSWORD is not set. Bailing out !" | ||
exit 1 | ||
fi | ||
} | ||
|
||
validateEnvironment | ||
|
||
if [ "$1" = "" ]; then | ||
echo "Argument 1 variable APP_PROD_IMAGE is not set, format: ezplatform-demo. Bailing out !" | ||
exit 1 | ||
fi | ||
|
||
|
||
if [ "$2" = "" ]; then | ||
echo "Argument 2 variable REMOTE_IMAGE is not set, format: ezsystems/ezplatform-demo. Bailing out !" | ||
exit 1 | ||
fi | ||
|
||
APP_PROD_IMAGE="$1" | ||
REMOTE_IMAGE="$2" | ||
|
||
# Debug | ||
docker images | ||
|
||
# Login | ||
docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" | ||
|
||
## TAG | ||
docker tag "${APP_PROD_IMAGE}" "${REMOTE_IMAGE}:latest" | ||
|
||
echo "Pushing docker image with all tags : ${REMOTE_IMAGE}" | ||
docker push "${REMOTE_IMAGE}" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.