Skip to content
Snippets Groups Projects
Commit 62ceae14 authored by Mirco Nasuti's avatar Mirco Nasuti
Browse files

add captain tests

parent 71d57146
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@
This is the MIP backend.
## Usage
## Usage in development environment
* Build and run the project (including clean target): `./go.sh`
* Build the project (including clean target): `./build.sh`
......@@ -11,6 +11,15 @@ This is the MIP backend.
* Stop and remove the running container: `./halt.sh`
* Clean Maven cache, etc: `./clean.sh`
## Usage for deployments
* Build a versioned image: `./captain_build.sh` or `captain build`
* Build and test an image: `./captain_test.sh` or `captain test`
## Deployment
* See here: https://hub.docker.com/r/hbpmip/portal-backend/
## Generate PDF API documentation on build
Uncomment the following line in src/docker/build/build-in-docker.sh :
......
......@@ -7,7 +7,7 @@ portal-backend-build:
- docker run --rm -v $(pwd):/opt/portal/ -v $(pwd)/.m2:/root/.m2/ hbpmip/portal-backend-build
- echo 'Finished building portal-backend-build'
test:
- ./tests.sh
- ./tests/test-build.sh
portal-backend:
build: ./src/docker/run/Dockerfile
......@@ -21,4 +21,6 @@ portal-backend:
- rm -rf $(pwd)/src/docker/run/config/
- echo 'Finished building portal-backend'
test:
- ./tests.sh
\ No newline at end of file
- ./tests/pre-test-run.sh
- ./tests/test-run.sh
- ./tests/post-test-run.sh
\ No newline at end of file
#!/usr/bin/env bash
captain build
#!/usr/bin/env bash
exit 0;
\ No newline at end of file
captain test
\ No newline at end of file
#!/usr/bin/env bash
docker kill portal-db-test
docker rm -f portal-db-test
docker kill portal-backend-test
docker rm -f portal-backend-test
#!/usr/bin/env bash
if [ $(docker ps | grep portal-db-test | wc -l) -gt 0 ]; then
docker kill portal-db-test
fi
if [ $(docker ps -a | grep portal-db-test | wc -l) -gt 0 ]; then
docker rm -f portal-db-test
fi
if [ $(docker ps | grep portal-backend-test | wc -l) -gt 0 ]; then
docker kill portal-backend-test
fi
if [ $(docker ps -a | grep portal-backend-test | wc -l) -gt 0 ]; then
docker rm -f portal-backend-test
fi
docker run --name portal-db-test -e POSTGRES_USER=postgres -d postgres
docker run --name portal-backend-test -p 8000:8000 \
-e "DB_URL=jdbc:postgresql://172.22.0.1:5432/postgres" \
-e "DB_USER=postgres" \
-e "CONTEXT_PATH=/services" \
-e "PORT=8080" \
-d hbpmip/portal-backend
#!/usr/bin/env bash
if [ ! -f ./target/backend-services-DOCKER_BUILD.jar ]; then
exit 1
fi
exit 0
This diff is collapsed.
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment