add sonar dockerfile & update notification service build profile
This commit is contained in:
parent
1e2eb7545d
commit
f2af35a9aa
|
@ -0,0 +1,56 @@
|
|||
####################################### Build stage #######################################
|
||||
FROM maven:3.9-eclipse-temurin-21-alpine
|
||||
|
||||
ARG MAVEN_ACCOUNT_USR
|
||||
ARG MAVEN_ACCOUNT_PSW
|
||||
ARG REVISION
|
||||
ARG PROFILE
|
||||
ENV server_username=$MAVEN_ACCOUNT_USR
|
||||
ENV server_password=$MAVEN_ACCOUNT_PSW
|
||||
ARG CITE_MAVEN_REPO_URL
|
||||
|
||||
COPY /dmp-backend/pom.xml /build/
|
||||
COPY /dmp-backend/core /build/core/
|
||||
COPY /dmp-backend/web /build/web/
|
||||
COPY /dmp-backend/settings.xml /root/.m2/settings.xml
|
||||
RUN rm -f /build/web/src/main/resources/config/*-devel.yml
|
||||
RUN rm -f /build/web/src/main/resources/logging/*.xml
|
||||
|
||||
COPY /notification-service/pom.xml /build-notification/
|
||||
COPY /notification-service/core /build-notification/core/
|
||||
COPY /notification-service/web /build-notification/web/
|
||||
COPY /notification-service/settings.xml /root/.m2/settings.xml
|
||||
RUN rm -f /build/notification-web/src/main/resources/config/app.env
|
||||
RUN rm -f /build/notification-web/src/main/resources/config/*-devel.yml
|
||||
RUN rm -f /build/notification-web/src/main/resources/logging/*.xml
|
||||
RUN rm -f /build/notification-web/src/main/resources/certificates/*.crt
|
||||
|
||||
COPY /annotation-service/pom.xml /build-annotation/
|
||||
COPY /annotation-service/annotation /build-notification/annotation/
|
||||
COPY /annotation-service/annotation-web /build-notification/annotation-web/
|
||||
COPY /annotation-service/settings.xml /root/.m2/settings.xml
|
||||
RUN rm -f /build/annotation-web/src/main/resources/config/app.env
|
||||
RUN rm -f /build/annotation-web/src/main/resources/config/*-devel.yml
|
||||
RUN rm -f /build/annotation-web/src/main/resources/logging/*.xml
|
||||
RUN rm -f /build/annotation-web/src/main/resources/certificates/*.crt
|
||||
|
||||
COPY oracle.local.cite.gr.crt $JAVA_HOME/conf/security
|
||||
RUN cd "$JAVA_HOME"/conf/security && keytool -cacerts -storepass changeit -noprompt -trustcacerts -importcert -alias oraclecert -file oracle.local.cite.gr.crt
|
||||
|
||||
WORKDIR /build/
|
||||
RUN mvn -Dserver.username=${CITE_MAVEN_ACCOUNT_USR} -Dserver.password=${CITE_MAVEN_ACCOUNT_PSW} clean
|
||||
RUN mvn -Dserver.username=${CITE_MAVEN_ACCOUNT_USR} -Dserver.password=${CITE_MAVEN_ACCOUNT_PSW} install
|
||||
RUN mvn -Dserver.username=${CITE_MAVEN_ACCOUNT_USR} -Dserver.password=${CITE_MAVEN_ACCOUNT_PSW} package
|
||||
RUN mvn sonar:sonar -Dsonar.projectKey=OpenDMP:backend-api -Dsonar.login=${ORACLE_TOKEN} -Dsonar.host.url=${ORACLE_URL} -Dsonar.projectName='OpenDMP API'
|
||||
|
||||
WORKDIR /build-notification/
|
||||
RUN mvn -Dserver.username=${CITE_MAVEN_ACCOUNT_USR} -Dserver.password=${CITE_MAVEN_ACCOUNT_PSW} clean
|
||||
RUN mvn -Dserver.username=${CITE_MAVEN_ACCOUNT_USR} -Dserver.password=${CITE_MAVEN_ACCOUNT_PSW} install
|
||||
RUN mvn -Dserver.username=${CITE_MAVEN_ACCOUNT_USR} -Dserver.password=${CITE_MAVEN_ACCOUNT_PSW} package
|
||||
RUN mvn sonar:sonar -Dsonar.projectKey=OpenDMP:notification-api -Dsonar.login=${ORACLE_TOKEN} -Dsonar.host.url=${ORACLE_URL} -Dsonar.projectName='OpenDMP Notification API'
|
||||
|
||||
WORKDIR /build-annotation/
|
||||
RUN mvn -Dserver.username=${CITE_MAVEN_ACCOUNT_USR} -Dserver.password=${CITE_MAVEN_ACCOUNT_PSW} clean
|
||||
RUN mvn -Dserver.username=${CITE_MAVEN_ACCOUNT_USR} -Dserver.password=${CITE_MAVEN_ACCOUNT_PSW} install
|
||||
RUN mvn -Dserver.username=${CITE_MAVEN_ACCOUNT_USR} -Dserver.password=${CITE_MAVEN_ACCOUNT_PSW} package
|
||||
RUN mvn sonar:sonar -Dsonar.projectKey=OpenDMP:annotation-api -Dsonar.login=${ORACLE_TOKEN} -Dsonar.host.url=${ORACLE_URL} -Dsonar.projectName='OpenDMP Annotation API'
|
|
@ -5,9 +5,9 @@ ARG MAVEN_ACCOUNT_USR
|
|||
ARG MAVEN_ACCOUNT_PSW
|
||||
ARG REVISION
|
||||
ARG PROFILE
|
||||
ARG DEV_PROFILE_URL
|
||||
ENV server_username=$MAVEN_ACCOUNT_USR
|
||||
ENV server_password=$MAVEN_ACCOUNT_PSW
|
||||
ARG CITE_MAVEN_REPO_URL
|
||||
|
||||
COPY pom.xml /build/
|
||||
COPY notification /build/notification/
|
||||
|
@ -20,9 +20,10 @@ RUN rm -f /build/notification-web/src/main/resources/certificates/*.crt
|
|||
|
||||
WORKDIR /build/
|
||||
|
||||
RUN mvn -Drevision=${REVISION} -DdevProfileUrl=${DEV_PROFILE_URL} -P${PROFILE} dependency:go-offline
|
||||
RUN mvn -Drevision=${REVISION} -DciteMavenRepoUrl=${CITE_MAVEN_REPO_URL} -P${PROFILE} clean
|
||||
RUN mvn -Drevision=${REVISION} -DciteMavenRepoUrl=${CITE_MAVEN_REPO_URL} -P${PROFILE} install
|
||||
# Build project
|
||||
RUN mvn -Drevision=${REVISION} -DdevProfileUrl=${DEV_PROFILE_URL} -P${PROFILE} clean package
|
||||
RUN mvn -Drevision=${REVISION} -DciteMavenRepoUrl=${CITE_MAVEN_REPO_URL} -P${PROFILE} package
|
||||
|
||||
######################################## Run Stage ########################################
|
||||
FROM eclipse-temurin:21-jre-ubi9-minimal
|
||||
|
|
|
@ -11,15 +11,21 @@
|
|||
</servers>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>dev</id>
|
||||
<id>release</id>
|
||||
<repositories>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<repository>
|
||||
<id>dev</id>
|
||||
<name>Dev Profile</name>
|
||||
<url>${devProfileUrl}</url>
|
||||
<id>central</id>
|
||||
<name>Central Repository</name>
|
||||
<url>https://repo.maven.apache.org/maven2</url>
|
||||
<layout>default</layout>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>cite-repo</id>
|
||||
<name>CITE Maven Repo</name>
|
||||
<url>${citeMavenRepoUrl}</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
</profile>
|
||||
|
|
Loading…
Reference in New Issue