Skip to content
Snippets Groups Projects
Commit bf88af49 authored by Sonia Zorba's avatar Sonia Zorba
Browse files

Added CI

parent f4f6471a
No related branches found
No related tags found
No related merge requests found
Pipeline #737 passed
stages:
- test
- dockerize
test:
stage: test
tags:
- docker
script:
- mvn clean test
- awk -F"," '{ instructions += $4 + $5; covered += $5 } END { print "coverage=" 100*covered/instructions }' target/site/jacoco/jacoco.csv
coverage: '/coverage=\d+\.\d+/'
only:
- master
deploy:
stage: dockerize
tags:
- shell
only:
- master
script:
- docker login -u "${CI_REGISTRY_USER}" -p "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}"
- docker build -t "${CI_REGISTRY_IMAGE}" .
- docker push "${CI_REGISTRY_IMAGE}"
FROM maven:3.6.3-openjdk-14
ADD src /src
ADD pom.xml .
RUN mvn clean package -DskipTests -DfinalName=vospace-file-service
FROM openjdk:14-jdk-alpine
COPY --from=0 /target/vospace-file-service.jar /vospace-file-service.jar
ENTRYPOINT ["java","-jar","/vospace-file-service.jar"]
...@@ -3,3 +3,9 @@ ...@@ -3,3 +3,9 @@
This service queries the same database used by VOSpace (`file_catalog`). This service queries the same database used by VOSpace (`file_catalog`).
It provides functionalities for downloading and uploading files. It provides functionalities for downloading and uploading files.
## Running with Docker
See `docker-env` file for configuration
docker run -it --env-file docker-env -v "/path/to/userspace:/tmp/fsdemo" -p 8080:8080 git.ia2.inaf.it:5050/ia2/vospace-file-service
path_prefix=/tmp/fsdemo
file-catalog.datasource.jdbc-url=jdbc:postgresql://172.19.0.1:5432/vospace_testdb
file-catalog.datasource.username=postgres
file-catalog.datasource.password=
gms_base_url=https://sso.ia2.inaf.it/gms
jwks_uri=https://sso.ia2.inaf.it/rap-ia2/auth/oidc/jwks
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<properties> <properties>
<java.version>14</java.version> <java.version>14</java.version>
<finalName>${project.artifactId}-${project.version}</finalName>
</properties> </properties>
<dependencies> <dependencies>
...@@ -58,11 +59,46 @@ ...@@ -58,11 +59,46 @@
</dependency> </dependency>
</dependencies> </dependencies>
<repositories>
<repository>
<id>ia2-snapshots</id>
<name>your custom repo</name>
<url>http://repo.ia2.inaf.it/maven/repository/snapshots</url>
</repository>
</repositories>
<build> <build>
<finalName>${finalName}</finalName>
<plugins> <plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
</plugin>
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<executable>true</executable>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.6</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment