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

Merge branch 'enable_sonar' into 'master'

Enable sonar



See merge request !28
parents 8cd1eb8f 231e8e2f
No related branches found
No related tags found
No related merge requests found
...@@ -2,10 +2,10 @@ portal-backend-build: ...@@ -2,10 +2,10 @@ portal-backend-build:
build: ./src/docker/build/Dockerfile build: ./src/docker/build/Dockerfile
image: hbpmip/portal-backend-build image: hbpmip/portal-backend-build
pre: pre:
- echo 'Building portal-backend-build' - echo "Building portal-backend-build"
post: post:
- docker run --rm -v $WORKSPACE:/opt/portal/ -v $WORKSPACE/.m2:/root/.m2/ hbpmip/portal-backend-build - docker run --rm -v $WORKSPACE:/opt/portal/ -v $WORKSPACE/.m2:/root/.m2/ hbpmip/portal-backend-build
- echo 'Finished building portal-backend-build' - echo "Finished building portal-backend-build"
test: test:
- ./tests/test-build.sh - ./tests/test-build.sh
...@@ -13,13 +13,13 @@ portal-backend: ...@@ -13,13 +13,13 @@ portal-backend:
build: ./src/docker/run/Dockerfile build: ./src/docker/run/Dockerfile
image: hbpmip/portal-backend image: hbpmip/portal-backend
pre: pre:
- echo 'Building portal-backend' - echo "Building portal-backend"
- cp -r $(pwd)/config/ $(pwd)/src/docker/run/config/ - cp -r $(pwd)/config/ $(pwd)/src/docker/run/config/
- cp -r $(pwd)/target/ $(pwd)/src/docker/run/target/ - cp -r $(pwd)/target/ $(pwd)/src/docker/run/target/
post: post:
- rm -rf $WORKSPACE/src/docker/run/target/ - rm -rf $WORKSPACE/src/docker/run/target/
- rm -rf $WORKSPACE/src/docker/run/config/ - rm -rf $WORKSPACE/src/docker/run/config/
- echo 'Finished building portal-backend' - echo "Finished building portal-backend"
test: test:
- ./tests/pre-test-run.sh - ./tests/pre-test-run.sh
- ./tests/test-run.sh - ./tests/test-run.sh
......
...@@ -16,7 +16,7 @@ fi ...@@ -16,7 +16,7 @@ fi
docker run --name portal-db -p 5432:5432 -e POSTGRES_USER=postgres -d postgres docker run --name portal-db -p 5432:5432 -e POSTGRES_USER=postgres -d postgres
echo 'Waiting for DB to start...' echo "Waiting for DB to start..."
until [ $(docker exec portal-db psql -U postgres -c "\q" 2>&1 | wc -l) -eq 0 ]; do until [ $(docker exec portal-db psql -U postgres -c "\q" 2>&1 | wc -l) -eq 0 ]; do
printf '.' printf '.'
sleep 1 sleep 1
...@@ -28,7 +28,7 @@ docker run --name portal-backend -p 8080:8080 \ ...@@ -28,7 +28,7 @@ docker run --name portal-backend -p 8080:8080 \
-e "FRONTEND_REDIRECT_URL=http://localhost/home" \ -e "FRONTEND_REDIRECT_URL=http://localhost/home" \
-d hbpmip/portal-backend -d hbpmip/portal-backend
echo 'Waiting for backend to start...' echo "Waiting for backend to start..."
until [ $(docker logs portal-backend | grep "Started MIPApplication" | wc -l) -eq 1 ]; do until [ $(docker logs portal-backend | grep "Started MIPApplication" | wc -l) -eq 1 ]; do
printf '.' printf '.'
sleep 1 sleep 1
......
# ONLY FOR DEVELOPMENT - Configuration for the portal running inside a Docker container # Configuration template for the portal running inside a Docker container
spring: spring:
datasource: datasource:
......
...@@ -28,25 +28,25 @@ ...@@ -28,25 +28,25 @@
<asciidoctorj.pdf.version>1.5.0-alpha.11</asciidoctorj.pdf.version> <asciidoctorj.pdf.version>1.5.0-alpha.11</asciidoctorj.pdf.version>
<asciidoctorj.version>1.5.4</asciidoctorj.version> <asciidoctorj.version>1.5.4</asciidoctorj.version>
<spring-data-commons.version>1.12.2.RELEASE</spring-data-commons.version> <spring-data-commons.version>1.12.2.RELEASE</spring-data-commons.version>
<angularjs.version>1.4.3</angularjs.version> <angularjs.version>1.5.7</angularjs.version>
<jquery.version>2.1.1</jquery.version> <jquery.version>3.0.0</jquery.version>
<bootstrap.version>3.2.0</bootstrap.version> <bootstrap.version>3.3.7</bootstrap.version>
<h2.version>1.4.192</h2.version>
<postgresql.version>9.4-1206-jdbc42</postgresql.version>
<springfox-swagger2.version>2.5.0</springfox-swagger2.version>
<springfox-swagger-ui.version>2.5.0</springfox-swagger-ui.version>
<gson.version>2.7</gson.version>
<slugify.version>2.1.5</slugify.version>
<maven-resources-plugin.version>3.0.1</maven-resources-plugin.version>
<sonar-maven-plugin.version>3.0.2</sonar-maven-plugin.version>
<swagger2markup-maven-plugin.version>1.0.0</swagger2markup-maven-plugin.version>
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version>
<hibernate4-maven-plugin.version>1.1.0</hibernate4-maven-plugin.version>
<flyway-core.version>4.0.3</flyway-core.version>
<hibernate-jpa-2.1-api.version>1.0.0.Final</hibernate-jpa-2.1-api.version> <hibernate-jpa-2.1-api.version>1.0.0.Final</hibernate-jpa-2.1-api.version>
<hibernate-core.version>4.3.8.Final</hibernate-core.version> <hibernate-core.version>4.3.8.Final</hibernate-core.version>
<hibernate-entitymanager.version>4.3.8.Final</hibernate-entitymanager.version> <hibernate-entitymanager.version>4.3.8.Final</hibernate-entitymanager.version>
<h2.version>1.4.187</h2.version>
<postgresql.version>9.4-1205-jdbc42</postgresql.version>
<springfox-swagger2.version>2.3.1</springfox-swagger2.version>
<springfox-swagger-ui.version>2.3.1</springfox-swagger-ui.version>
<gson.version>2.5</gson.version>
<slugify.version>2.1.4</slugify.version>
<spring-data-jpa.version>1.10.2.RELEASE</spring-data-jpa.version> <spring-data-jpa.version>1.10.2.RELEASE</spring-data-jpa.version>
<maven-resources-plugin.version>2.3</maven-resources-plugin.version>
<sonar-maven-plugin.version>3.0.1</sonar-maven-plugin.version>
<swagger2markup-maven-plugin.version>1.0.0</swagger2markup-maven-plugin.version>
<maven-compiler-plugin.version>3.1</maven-compiler-plugin.version>
<hibernate4-maven-plugin.version>1.1.0</hibernate4-maven-plugin.version>
<flyway-core.version>4.0.3</flyway-core.version>
</properties> </properties>
<dependencies> <dependencies>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
docker-compose build docker-compose build
docker-compose up -d portal-db docker-compose up -d portal-db
echo 'Waiting for database to be ready...' echo "Waiting for database to be ready..."
until [ $(docker-compose exec portal-db psql -U postgres -c "\q" 2>&1 | wc -l) -eq 0 ]; do until [ $(docker-compose exec portal-db psql -U postgres -c "\q" 2>&1 | wc -l) -eq 0 ]; do
printf '.' printf '.'
sleep 1 sleep 1
......
...@@ -3,6 +3,7 @@ FROM maven:3-jdk-8 ...@@ -3,6 +3,7 @@ FROM maven:3-jdk-8
MAINTAINER mirco.nasuti@chuv.ch MAINTAINER mirco.nasuti@chuv.ch
COPY ./build-in-docker.sh /build-in-docker.sh COPY ./build-in-docker.sh /build-in-docker.sh
COPY ./certs/hbps1.crt /hbps1.crt
VOLUME /opt/portal/ VOLUME /opt/portal/
WORKDIR /opt/portal/ WORKDIR /opt/portal/
......
#!/usr/bin/env bash #!/usr/bin/env bash
echo 'Removing old target folder...' echo "Removing old target folder..."
rm -rf target/ rm -rf target/
echo 'Packaging...' echo "Packaging..."
mvn package mvn package
echo "Adding HBPS1 certificate to key store..."
yes | keytool -import -trustcacerts -alias hbps1.chuv.ch -file /hbps1.crt -storepass 'changeit' -keystore $JAVA_HOME/jre/lib/security/cacerts
echo "Running Sonar analysis"
mvn sonar:sonar
-----BEGIN CERTIFICATE-----
MIIF/jCCBOagAwIBAgISAzjqbL0qFPB6BUHz3/iTCtRdMA0GCSqGSIb3DQEBCwUA
MEoxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MSMwIQYDVQQD
ExpMZXQncyBFbmNyeXB0IEF1dGhvcml0eSBYMzAeFw0xNjA0MDEwMTMwMDBaFw0x
NjA2MzAwMTMwMDBaMBgxFjAUBgNVBAMTDWhicHMxLmNodXYuY2gwggIiMA0GCSqG
SIb3DQEBAQUAA4ICDwAwggIKAoICAQDQq+s6f0XeGqIg1AZwtI2dk04YmeOTafDq
+29CdzuRzNII3OrelQ50T3ngmhFiTUK1KIh3DrMCEIyzno2ECUs86av864P8fh6S
2OxqV1vH3iptlmorRgF4llO1MBIvvp3TsSianbcpt6iv9XwXFe67en/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b25seSBiZSByZWxpZWQgdXBvbiBieSBS
ZWx5aW5nIFBhcnRpZXMgYW5kIG9ubHkgaW4gYWNjb3JkYW5jZSB3aXRoIHRoZSBD
ZXJ0aWZpY2F0ZSBQb2xpY3kgZm91bmQgYXQgaHR0cHM6Ly9sZXRzZW5jcnlwdC5v
cmcvcmVwb3NpdG9yeS8wDQYJKoZIhvcNAQELBQADggEBAAQe8VbUW0Riwt1/vTUD
EKL3bYY1ZoYdt4uXaX+tPD+QRyxttABw911sWSyimCOFVFke0iELbM2pMod1T/TD
Bz8FDLvM+lWI8SIl2I1DeBySJ9UzgE4kMf+RvbC8F4/KNw9O935JlxcAJFB7hW6y
klyWOUHdNCqMDP09fxTQV1e6xQmpO9t4NxC+DHxxDCHAVmjnkhcX76ckdMmecz+Q
UNPSuhthewTxCuaP2O1m5oZWkT5+OLUMLUAEcWXBDfWIXxPNyVtia1tqfhCslUGI
BgNE/HmSoNhJ7q6x+pJyODYJMEVUViY/U4IdWih8j+JIrAVMk55Wpd2PCB1lsepl
NfY=
-----END CERTIFICATE-----
...@@ -16,7 +16,7 @@ fi ...@@ -16,7 +16,7 @@ fi
docker run --name portal-db-test -p 5432:5432 -e POSTGRES_USER=postgres -d postgres docker run --name portal-db-test -p 5432:5432 -e POSTGRES_USER=postgres -d postgres
echo 'Waiting for DB to start...' echo "Waiting for DB to start..."
until [ $(docker exec portal-db-test psql -U postgres -c "\q" 2>&1 | wc -l) -eq 0 ]; do until [ $(docker exec portal-db-test psql -U postgres -c "\q" 2>&1 | wc -l) -eq 0 ]; do
printf '.' printf '.'
sleep 1 sleep 1
...@@ -29,7 +29,7 @@ docker run --name portal-backend-test -p 8080:8080 \ ...@@ -29,7 +29,7 @@ docker run --name portal-backend-test -p 8080:8080 \
-e "DB_URL=jdbc:postgresql://$GATEWAY_IP:5432/postgres" \ -e "DB_URL=jdbc:postgresql://$GATEWAY_IP:5432/postgres" \
-d hbpmip/portal-backend -d hbpmip/portal-backend
echo 'Waiting for backend to start...' echo "Waiting for backend to start..."
until [ $(docker logs portal-backend-test | grep "Started MIPApplication" | wc -l) -eq 1 ]; do until [ $(docker logs portal-backend-test | grep "Started MIPApplication" | wc -l) -eq 1 ]; do
printf '.' printf '.'
sleep 1 sleep 1
......
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