mirror of
https://github.com/d9pouces/id_configurator.git
synced 2026-11-09 01:47:21 +01:00
feat: enhance build process and Dockerfiles for improved artifact handling and dependency resolution
Signed-off-by: d9pouces <github@19pouces.net>
This commit is contained in:
@@ -4,11 +4,57 @@ COPY --from=target / /src/
|
||||
COPY --from=generated-config Java.yaml /config.yaml
|
||||
RUN id-configurator apply --config /config.yaml --src /src --dst /dst
|
||||
FROM target AS runtime
|
||||
# Warm up the local repository with the maven-dependency-plugin itself (from
|
||||
# the real, network-reachable Maven Central) while the default mirror is
|
||||
# still in place, so the actual test below never needs anything but the
|
||||
# fixture repository configured by id-configurator.
|
||||
# Every build tool the `java` module configures: Maven itself (already part
|
||||
# of this image), Gradle, Ivy and Leiningen (all packaged for this Ubuntu
|
||||
# base), and SBT (no package available, fetched as a plain release tarball).
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends gradle ivy leiningen curl \
|
||||
&& curl -sL https://github.com/sbt/sbt/releases/download/v1.10.1/sbt-1.10.1.tgz -o /tmp/sbt.tgz \
|
||||
&& tar -xzf /tmp/sbt.tgz -C /opt \
|
||||
&& rm /tmp/sbt.tgz
|
||||
ENV PATH="/opt/sbt/bin:${PATH}"
|
||||
|
||||
# Warm up every tool's own bootstrap/plugin dependencies from the real,
|
||||
# network-reachable Maven Central while the default resolvers are still in
|
||||
# place, so the actual tests below never need anything but the fixture
|
||||
# repository configured by id-configurator (plus, for SBT only, the
|
||||
# maven-central-fallback repository also configured below).
|
||||
RUN mvn -q org.apache.maven.plugins:maven-dependency-plugin:3.6.1:get -Dartifact=org.apache.commons:commons-lang3:3.12.0
|
||||
RUN mkdir -p /opt/sbt-warmup/project \
|
||||
&& echo 'scalaVersion := "2.13.14"' > /opt/sbt-warmup/build.sbt \
|
||||
&& echo 'sbt.version=1.10.1' > /opt/sbt-warmup/project/build.properties \
|
||||
&& cd /opt/sbt-warmup && sbt update
|
||||
|
||||
COPY --from=configuration /dst/ /
|
||||
|
||||
RUN mvn org.apache.maven.plugins:maven-dependency-plugin:3.6.1:get -Dartifact=org.interdiode:idconfiguratortestpkg:0.0.1 \
|
||||
&& find /root/.m2/repository/org/interdiode -type f
|
||||
&& test -f /root/.m2/repository/org/interdiode/idconfiguratortestpkg/0.0.1/idconfiguratortestpkg-0.0.1.jar
|
||||
|
||||
RUN mkdir -p /tmp/gradletest && cd /tmp/gradletest \
|
||||
&& cat > build.gradle <<'EOF'
|
||||
configurations { deps }
|
||||
dependencies { deps 'org.interdiode:idconfiguratortestpkg:0.0.1' }
|
||||
task resolveDeps { doLast { configurations.deps.each { println it } } }
|
||||
EOF
|
||||
RUN cd /tmp/gradletest && gradle -q resolveDeps | grep -q idconfiguratortestpkg
|
||||
|
||||
RUN java -jar /usr/share/java/ivy.jar -settings /root/.ivy2/ivysettings.xml \
|
||||
-dependency org.interdiode idconfiguratortestpkg 0.0.1 \
|
||||
-retrieve "/tmp/ivyretrieve/[artifact]-[revision].[ext]" \
|
||||
&& test -f /tmp/ivyretrieve/idconfiguratortestpkg-0.0.1.jar
|
||||
|
||||
RUN mkdir -p /tmp/leintest && cd /tmp/leintest \
|
||||
&& cat > project.clj <<'EOF'
|
||||
(defproject leintest "0.1.0"
|
||||
:dependencies [[org.interdiode/idconfiguratortestpkg "0.0.1"]])
|
||||
EOF
|
||||
RUN cd /tmp/leintest && lein deps :tree | grep -q idconfiguratortestpkg
|
||||
|
||||
RUN mkdir -p /tmp/sbttest/project \
|
||||
&& cat > /tmp/sbttest/build.sbt <<'EOF'
|
||||
scalaVersion := "2.13.14"
|
||||
libraryDependencies += "org.interdiode" % "idconfiguratortestpkg" % "0.0.1"
|
||||
EOF
|
||||
RUN echo 'sbt.version=1.10.1' > /tmp/sbttest/project/build.properties
|
||||
RUN cd /tmp/sbttest \
|
||||
&& sbt -Dsbt.override.build.repos=true "show Compile/dependencyClasspath" | grep -q idconfiguratortestpkg
|
||||
|
||||
Reference in New Issue
Block a user