Skip to content

Commit

Permalink
chore: fix postgres cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
hongaar committed Aug 13, 2020
1 parent b9b2c45 commit 4194a0c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion postgres/Dockerfile.windows
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ RUN mkdir "C:/pgsql/data"
RUN mkdir "C:/pgsql/log"
RUN pg_ctl -D "C:/pgsql/data" init

CMD ["C:/pgsql/bin/pg_ctl.exe", "-D", "C:/pgsql/data", "-l", "C:/pgsql/log/pgsql.log", "start"]
CMD ["C:/pgsql/bin/postgres.exe", "-D", "C:/pgsql/data"]
12 changes: 6 additions & 6 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function retry {
}

function get_health_status {
docker inspect --format="{{json .State.Health.Status}}" $IMAGE
docker inspect --format="{{json .State.Health.Status}}" test
}

function check_if_healthy {
Expand All @@ -43,16 +43,16 @@ function check_if_healthy {

set -e

echo "Running Docker image $IMAGE:$TAG in a container named $IMAGE"
echo "Running Docker image exivity/$IMAGE:$LATEST_TAG in a container named test"
docker run \
--rm \
--detach \
--name $IMAGE \
--name test \
exivity/$IMAGE:$LATEST_TAG

echo "Running health check"
# retry 6 means we will wait max 1+2+4+8+16 seconds
retry 6 check_if_healthy || (docker inspect $IMAGE && exit 1)
retry 6 check_if_healthy || (docker inspect test && exit 1)

echo "Stop Docker container $IMAGE"
docker stop $IMAGE
echo "Stop Docker container test"
docker stop test

0 comments on commit 4194a0c

Please sign in to comment.