This patch introduces a new structure of the it/dep repo.
[it/dep.git] / infra / 10-Nexus / docker / Dockerfile
1 ARG NEXUS_VERSION=3.15.2
2 ARG NEXUS_BUILD=01
3
4 FROM maven:3-jdk-8-alpine AS aptbuild
5 #ARG NEXUS_VERSION=3.14.0
6 #ARG NEXUS_BUILD=04
7
8 COPY ./nexus-repository-apt /nexus-repository-apt/
9 #RUN cd /nexus-repository-apt/; sed -i "s/3.15.2-01/${NEXUS_VERSION}-${NEXUS_BUILD}/g" pom.xml; \
10 #    mvn;
11 RUN cd /nexus-repository-apt/; mvn;
12
13
14 FROM maven:3-jdk-8-alpine AS helmbuild
15 ARG NEXUS_VERSION=3.15.2
16 ARG NEXUS_BUILD=01
17
18 COPY ./nexus-repository-helm /nexus-repository-helm/
19 RUN cd /nexus-repository-helm/; sed -i "s/3.14.0-04/${NEXUS_VERSION}-${NEXUS_BUILD}/g" pom.xml; \
20     mvn clean package;
21
22
23
24
25 FROM sonatype/nexus3:$NEXUS_VERSION
26 ARG NEXUS_VERSION=3.15.2
27 ARG NEXUS_BUILD=01
28 # Will not seem to work in sed without some magick
29 ARG APT_VERSION=1.0.10
30 ARG COMP_VERSION=1.18
31 #ARG COMP_VERSION=1.16.1
32 ARG XZ_VERSION=1.8
33 ARG APT_TARGET=/opt/sonatype/nexus/system/net/staticsnow/nexus-repository-apt/${APT_VERSION}/
34 ARG HELM_VERSION=0.0.7
35 ARG TARGET_DIR=/opt/sonatype/nexus/system/org/sonatype/nexus/plugins/nexus-repository-helm/${HELM_VERSION}/
36 USER root
37 RUN mkdir -p ${APT_TARGET}; \
38     sed -i "s@nexus-repository-maven</feature>@nexus-repository-maven</feature>\n        <feature version=\"${APT_VERSION}\" prerequisite=\"false\" dependency=\"false\">nexus-repository-apt</feature>@g" /opt/sonatype/nexus/system/org/sonatype/nexus/assemblies/nexus-core-feature/${NEXUS_VERSION}-${NEXUS_BUILD}/nexus-core-feature-${NEXUS_VERSION}-${NEXUS_BUILD}-features.xml; \
39     sed -i "s@<feature name=\"nexus-repository-maven\"@<feature name=\"nexus-repository-apt\" description=\"net.staticsnow:nexus-repository-apt\" version=\"${APT_VERSION}\">\n        <details>net.staticsnow:nexus-repository-apt</details>\n        <bundle>mvn:net.staticsnow/nexus-repository-apt/${APT_VERSION}</bundle>\n        <bundle>mvn:org.apache.commons/commons-compress/${COMP_VERSION}</bundle>\n        <bundle>mvn:org.tukaani/xz/${XZ_VERSION}</bundle>\n    </feature>\n    <feature name=\"nexus-repository-maven\"@g" /opt/sonatype/nexus/system/org/sonatype/nexus/assemblies/nexus-core-feature/${NEXUS_VERSION}-${NEXUS_BUILD}/nexus-core-feature-${NEXUS_VERSION}-${NEXUS_BUILD}-features.xml;
40 COPY --from=aptbuild /nexus-repository-apt/target/nexus-repository-apt-${APT_VERSION}.jar ${APT_TARGET}
41 RUN mkdir -p ${TARGET_DIR}; \
42     sed -i 's@nexus-repository-maven</feature>@nexus-repository-maven</feature>\n        <feature prerequisite="false" dependency="false">nexus-repository-helm</feature>@g' /opt/sonatype/nexus/system/org/sonatype/nexus/assemblies/nexus-core-feature/${NEXUS_VERSION}-${NEXUS_BUILD}/nexus-core-feature-${NEXUS_VERSION}-${NEXUS_BUILD}-features.xml; \
43     sed -i 's@<feature name="nexus-repository-maven"@<feature name="nexus-repository-helm" description="org.sonatype.nexus.plugins:nexus-repository-helm" version="0.0.7">\n        <details>org.sonatype.nexus.plugins:nexus-repository-helm</details>\n        <bundle>mvn:org.sonatype.nexus.plugins/nexus-repository-helm/0.0.7</bundle>\n        <bundle>mvn:org.apache.commons/commons-compress/1.18</bundle>\n   </feature>\n    <feature name="nexus-repository-maven"@g' /opt/sonatype/nexus/system/org/sonatype/nexus/assemblies/nexus-core-feature/${NEXUS_VERSION}-${NEXUS_BUILD}/nexus-core-feature-${NEXUS_VERSION}-${NEXUS_BUILD}-features.xml;
44 COPY --from=helmbuild /nexus-repository-helm/target/nexus-repository-helm-${HELM_VERSION}.jar ${TARGET_DIR}
45 USER nexus