add Dockerfile for build and push on cite-maven
This commit is contained in:
parent
f6d1538464
commit
6bd76b92f1
|
@ -0,0 +1,27 @@
|
|||
FROM maven:3.8.6-eclipse-temurin-17-focal
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install gpg -y
|
||||
|
||||
ARG MAVEN_ACCOUNT_USR
|
||||
ARG MAVEN_ACCOUNT_PSW
|
||||
ARG REVISION
|
||||
ARG MAVEN_GPG_PASSPHRASE
|
||||
ARG MAVEN_GPG_KEYNAME
|
||||
ARG PROFILE
|
||||
ENV gpg_keyname=$MAVEN_GPG_KEYNAME
|
||||
ENV gpg_passphrase=$MAVEN_GPG_PASSPHRASE
|
||||
ENV server_username=$MAVEN_ACCOUNT_USR
|
||||
ENV server_password=$MAVEN_ACCOUNT_PSW
|
||||
|
||||
COPY settings.xml /root/.m2/settings.xml
|
||||
COPY keypair.asc /tmp/keypair.asc
|
||||
RUN if [ "$PROFILE" = "ossrh" ]; then \
|
||||
gpg --batch --import /tmp/keypair.asc; \
|
||||
fi
|
||||
|
||||
WORKDIR /build/
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN mvn -Drevision=${REVISION} -P${PROFILE} clean deploy
|
20
pom.xml
20
pom.xml
|
@ -56,8 +56,26 @@
|
|||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.12.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>dev</id>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>dev</id>
|
||||
<name>Dev Profile</name>
|
||||
<url>${devProfileUrl}</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>dev</id>
|
||||
<name>Dev Profile</name>
|
||||
<url>${devProfileUrlDeposit}</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,18 @@
|
|||
<settings>
|
||||
<servers>
|
||||
<server>
|
||||
<id>ossrh</id>
|
||||
<username>${server_username}</username>
|
||||
<password>${server_password}</password>
|
||||
</server>
|
||||
</servers>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>ossrh</id>
|
||||
<properties>
|
||||
<gpg.passphrase>${gpg_passphrase}</gpg.passphrase>
|
||||
<gpg.keyname>${gpg_keyname}</gpg.keyname>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
</settings>
|
Loading…
Reference in New Issue