2024-04-23 13:02:06 +02:00
|
|
|
####################################### Build stage #######################################
|
|
|
|
FROM maven:3.9-eclipse-temurin-21-alpine
|
|
|
|
|
|
|
|
ARG MAVEN_ACCOUNT_USR
|
|
|
|
ARG MAVEN_ACCOUNT_PSW
|
|
|
|
ARG REVISION
|
|
|
|
ARG PROFILE
|
|
|
|
ARG ORACLE_URL
|
|
|
|
ARG ORACLE_TOKEN
|
|
|
|
ENV server_username=$MAVEN_ACCOUNT_USR
|
|
|
|
ENV server_password=$MAVEN_ACCOUNT_PSW
|
|
|
|
ARG CITE_MAVEN_REPO_URL
|
|
|
|
|
2024-04-23 13:20:17 +02:00
|
|
|
COPY pom.xml /build/
|
|
|
|
COPY core /build/core/
|
|
|
|
COPY web /build/web/
|
|
|
|
COPY settings.xml /root/.m2/settings.xml
|
2024-04-23 13:02:06 +02:00
|
|
|
RUN rm -f /build/web/src/main/resources/config/*-devel.yml
|
|
|
|
RUN rm -f /build/web/src/main/resources/logging/*.xml
|
|
|
|
|
|
|
|
|
|
|
|
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 -Drevision=${REVISION} -DciteMavenRepoUrl=${CITE_MAVEN_REPO_URL} -P${PROFILE} clean
|
|
|
|
RUN mvn -Drevision=${REVISION} -DciteMavenRepoUrl=${CITE_MAVEN_REPO_URL} -P${PROFILE} install
|
|
|
|
RUN mvn -Drevision=${REVISION} -DciteMavenRepoUrl=${CITE_MAVEN_REPO_URL} -P${PROFILE} package
|
2024-04-23 13:40:37 +02:00
|
|
|
RUN mvn sonar:sonar -Drevision=${REVISION} -DciteMavenRepoUrl=${CITE_MAVEN_REPO_URL} -P${PROFILE} -Dsonar.projectKey=OpenDMP:backend-api -Dsonar.login=${ORACLE_TOKEN} -Dsonar.host.url=${ORACLE_URL} -Dsonar.projectName='OpenDMP API'
|