diff --git a/.github/workflows/build-using-cnb-buildpack.yml b/.github/workflows/build-using-cnb-buildpack.yml index 851f827..ebbbc7f 100644 --- a/.github/workflows/build-using-cnb-buildpack.yml +++ b/.github/workflows/build-using-cnb-buildpack.yml @@ -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" @@ -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}}