Commit 14680e76 authored by Arild Trygve Aae's avatar Arild Trygve Aae

Legger til rette for å hente data

parent 39ba4b29
Pipeline #23882 skipped with stages
* text=auto
*.png -text
\ No newline at end of file
*.sw?
.#*
*#
*~
.classpath
.project
.settings
bin
build
target
dependency-reduced-pom.xml
*.sublime-*
/scratch
.gradle
README.html
.idea
*.iml
/target/
!.mvn/wrapper/maven-wrapper.jar
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/build/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
# https://gitlab.com/gitlab-org/gitlab-ci-yml/blob/master/Maven.gitlab-ci.yml
# https://docs.docker.com/config/containers/logging/json-file/
# https://store.docker.com/images/nginx
# NB! latest, betyr at han tar siste versjon av program i git.
image: docker:latest
cache:
paths:
- .m2/repository
variables:
DOCKER_DRIVER: overlay
SPRING_PROFILES_ACTIVE: gitlab-ci
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
stages:
- maven-build
- package
- deploy-test
maven-build:
image: maven:3-jdk-8
stage: maven-build
when: manual
script:
- cp settings.xml /root/.m2/settings.xml
- mvn package -B $MAVEN_CLI_OPTS
artifacts:
expire_in: 1 week
paths:
- target/dbh_api_brsund_register_centre.jar
docker-build:
stage: package
when: manual
script:
- export CI_DEBUG_TRACE=true
- echo "$DOCKER_BUILDER_CERT_PEM" > $HOME/cert.pem
- echo "$DOCKER_BUILDER_KEY_PEM" > $HOME/key.pem
- echo "$DOCKER_BUILDER_CA_PEM" > $HOME/ca.pem
- export DOCKER_TLS_VERIFY="1"
- export DOCKER_HOST="$DOCKER_HOST_BUILDER"
- export DOCKER_CERT_PATH="$HOME"
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN docker.nsd.no
- docker build -t docker.nsd.no/dbh-utvikling/dbh_api_brsund_register_centre:latest .
- docker push docker.nsd.no/dbh-utvikling/dbh_api_brsund_register_centre:latest
docker-deploy-to-test:
stage: deploy-test
when: manual
script:
- echo "Deploy to test"
- echo "$DOCKER_TEST_DBH_KEY_PEM" > $HOME/key.pem
- echo "$DOCKER_TEST_DBH_CERT_PEM" > $HOME/cert.pem
- echo "$DOCKER_TEST_DBH_CA_PEM" > $HOME/ca.pem
- export DOCKER_TLS_VERIFY="1"
- export DOCKER_HOST="$DOCKER_HOST_TEST"
- export DOCKER_CERT_PATH="$HOME"
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN docker.nsd.no
- docker pull docker.nsd.no/dbh-utvikling/dbh_api_brsund_register_centre:latest
- docker stop dbh_api_brsund_register_centre || true
- docker rm -f dbh_api_brsund_register_centre || true
- docker run -d --restart=always -p 8075:8080
--log-driver gelf
--log-opt gelf-address=udp://elk.nsd.no:5001
--log-opt tag="dbh_api_brsund_register_centre"
--name dbh_api_brsund_register_centre -d docker.nsd.no/dbh-utvikling/dbh_api_brsund_register_centre:latest
environment:
name: test
\ No newline at end of file
FROM java:8-jre-alpine
VOLUME /tmp
RUN adduser -D -u 1000 java
ADD target/dbh_api_brsund_register_centre.jar /home/java/
RUN chown -R java:java /home/java
USER java
EXPOSE 8075
ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -Djava.awt.headless=true -Xmx4096m -XX:+UseConcMarkSweepGC -Djava.security.egd=file:/dev/./urandom -jar /home/java/dbh_api_brsund_register_centre.jar" ]
\ No newline at end of file
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>no.nsd.brsund.api.hent</groupId>
<artifactId>dbh_api_brsund_register_centre</artifactId>
<packaging>jar</packaging>
<description>Henter økonomidata fra Brønnøysund.</description>
<version>0.0.1</version>
<url>http://maven.apache.org</url>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.5.RELEASE</version>
<!-- <version>1.5.1.RELEASE</version> -->
<relativePath /> <!-- lookup parent from reposictory -->
</parent>
<repositories>
<repository>
<id>nexus.nsd.no</id>
<url>https://nexus.nsd.no/repository/maven-releases/</url>
</repository>
</repositories>
<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<docker.image.prefix>dbh_api_brsund_register_centre</docker.image.prefix>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-core -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>5.1.4.RELEASE</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>7.4.0.jre8</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.8.1</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>org.everit.json</groupId>
<artifactId>org.everit.json.schema</artifactId>
<version>1.3.0</version>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.json/json -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20180813</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.codehaus.jettison/jettison -->
<dependency>
<groupId>org.codehaus.jettison</groupId>
<artifactId>jettison</artifactId>
<version>1.4.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-validator -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>6.0.15.Final</version>
</dependency>
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<version>3.1.2</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.ws.rs/javax.ws.rs-api -->
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.1.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/ch.qos.logback/logback-core ok -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.2.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/ch.qos.logback/logback-classic -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
<version>5.2</version>
</dependency>
<dependency>
<groupId>io.github.cdimascio</groupId>
<artifactId>java-dotenv</artifactId>
<version>3.1.7</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-kotlin</artifactId>
<version>2.9.8</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<addResources>true</addResources>
<executable>true</executable>
<excludeDevtools>false</excludeDevtools>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<id>build-info</id>
<goals>
<goal>build-info</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<finalName>dbh_api_brsund_register_centre</finalName>
</build>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<servers>
<server>
<id>nexus.nsd.no</id>
<username>${env.NEXUS_USERNAME}</username>
<password>${env.NEXUS_PASSWORD}</password>
</server>
</servers>
</settings>
Markdown is supported
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