Skip to content

Commit

Permalink
fixup!test: setup mongodb server - debug check mongosh
Browse files Browse the repository at this point in the history
  • Loading branch information
o-orand committed Sep 25, 2024
1 parent f1aae34 commit 44aa805
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/build-using-cnb-buildpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,15 @@ jobs:
cat vcap-services-template.sh|envsubst >vcap-service.env
cat vcap-service.env
echo "Starting sample app"
docker run -d -e PORT=80 --env-file vcap-service.env -p 8080:80 --name "cnb-app" ${{env.CNB_IMAGE_NAME}}
docker logs -f cnb-app &> cnb-app.log &
#docker run -d -e PORT=80 --env-file vcap-service.env -p 8080:80 --name "cnb-app-container" ${{env.CNB_IMAGE_NAME}}
docker run -e PORT=80 --env-file vcap-service.env -p 8080:80 --name "cnb-app-container" ${{env.CNB_IMAGE_NAME}}
docker logs -f cnb-app-container &> cnb-app-container.log &
docker ps -a
export APP="http://127.0.0.1:8080"
exit_status=0
if nc -vz 127.0.0.1 8080;then echo "port 8080 available";else echo "port 8080 UNAVAILABLE";exit_status=1;fi
if nc -vz 127.0.0.1 ${SERVICE_PORT};then echo "port ${SERVICE_PORT} available";else echo "port ${SERVICE_PORT} UNAVAILABLE";exit_status=1;fi
if mongosh --version;then echo "mongosh available";else echo "mongosh UNAVAILABLE";fi
echo "Create using 'curl -X POST $APP/myCollection'"
if ! curl -vvv -X POST $APP/myCollection;then
echo "Create failed"
Expand All @@ -89,9 +90,9 @@ jobs:
else
echo "Delete successful"
fi
cat cnb-app.log
echo "Dumping logs using docker logs cnb-app"
docker logs cnb-app
cat cnb-app-container.log
echo "Dumping logs using docker logs cnb-app-container"
docker logs cnb-app-container
exit $exit_status
-
name: Tag version ${{github.ref_name}}
Expand Down

0 comments on commit 44aa805

Please sign in to comment.