Skip to content

Commit

Permalink
change leo db name (#233)
Browse files Browse the repository at this point in the history
* change leo db name

* fix db name in build.sh; parameterize

* add missing quote

* Hard code CONTAINER2
  • Loading branch information
ahaessly authored and rtitle committed Apr 9, 2018
1 parent af28e8f commit e2004e1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ set -e

# Set default variables used while parsing command line options.
TARGET="${TARGET:-leonardo}"
DB_CONTAINER="leonardo-mysql"
GIT_BRANCH="${BRANCH:-$(git rev-parse --abbrev-ref HEAD)}"
DOCKER_REGISTRY="dockerhub" # Must be either "dockerhub" or "gcr"
DOCKER_CMD=""
Expand Down Expand Up @@ -118,13 +119,13 @@ function make_jar()
{
echo "building jar..."
# start test db
bash ./docker/run-mysql.sh start ${TARGET}
bash ./docker/run-mysql.sh start ${TARGET} ${DB_CONTAINER}

# Get the last commit hash and set it as an environment variable
GIT_HASH=$(git log -n 1 --pretty=format:%h)

# Make jar & cache sbt dependencies.
JAR_CMD="$(docker run --rm --link mysql:mysql \
JAR_CMD="$(docker run --rm --link $DB_CONTAINER:mysql \
-e GIT_HASH=$GIT_HASH \
-v $PWD:/working \
-v jar-cache:/root/.ivy \
Expand All @@ -134,7 +135,7 @@ function make_jar()
EXIT_CODE=$?

# stop test db
bash ./docker/run-mysql.sh stop ${TARGET}
bash ./docker/run-mysql.sh stop ${TARGET} ${DB_CONTAINER}

if [ $EXIT_CODE != 0 ]; then
echo "Tests/jar build exited with status $EXIT_CODE"
Expand Down
8 changes: 4 additions & 4 deletions docker/run-mysql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ start() {
--link $CONTAINER:mysql \
-v $PWD/docker/sql_validate.sh:/working/sql_validate.sh \
mysql:$MYSQL_VERSION \
/working/sql_validate.sh leonardo
/working/sql_validate.sh $TARGET

if [ 0 -eq $? ]; then
echo "mysql validation succeeded."
Expand All @@ -47,15 +47,15 @@ stop() {
docker rm -v $CONTAINER2 || echo "mysql rm -v failed. container $CONTAINER2 already destroyed."
}

CONTAINER=mysql
CONTAINER2=leonardo-mysql

if [ ${#@} == 0 ]; then
echo "Usage: $0 stop|start <service>"
exit 1
fi

COMMAND=$1
TARGET=${2:-leonardo}
CONTAINER=${3:-leonardo-mysql}
CONTAINER2=mysql

if [ ${#@} == 0 ]; then
echo "Usage: $0 stop|start"
Expand Down

0 comments on commit e2004e1

Please sign in to comment.