#!/bin/sh
-container=$(buildah from ubi8/ubi-minimal)
-
+source "$(dirname "$0")/buildah-metadata"
+container=$(buildah from argeo2-java:openjdk-v$VERSION_JAVA)
source "$(dirname "$0")/buildah-common"
buildah config --label version="$VERSION" $container
# Metadata
-buildah config --label name="argeo2-builder-openjdk11-ubi8" $container
-buildah config --label summary="Argeo 2 Builder based on OpenJDK 11 and Red Hat UBI 8" $container
+buildah config --label name="argeo2-builder" $container
+buildah config --label description="Argeo 2 Builder" $container
# Utilities
#buildah run $container -- microdnf -y install git
-
# Java 11
-buildah run $container -- microdnf -y install java-11-openjdk-devel
+#buildah run $container -- microdnf -y install java-11-openjdk-devel
# Maven
-buildah run $container -- microdnf -y install maven
-buildah copy $container maven.conf /etc/java/maven.conf
+#buildah run $container -- microdnf -y install maven
+#buildah copy $container maven.conf /etc/java/maven.conf
+
+buildah run $container -- microdnf -y install tar gzip
+buildah copy $container https://archive.apache.org/dist/maven/maven-3/$VERSION_MAVEN/binaries/apache-maven-$VERSION_MAVEN-bin.tar.gz /opt
+buildah run $container -- tar -C /opt -xzf /opt/apache-maven-$VERSION_MAVEN-bin.tar.gz
+buildah run $container -- rm -f /opt/apache-maven-$VERSION_MAVEN-bin.tar.gz
+buildah run $container -- microdnf -y remove tar gzip
+
+buildah run $container -- ln -s /opt/apache-maven-$VERSION_MAVEN/bin/mvn /usr/local/bin/mvn
+# Maven script requires which
+buildah run $container -- microdnf -y install which
buildah run $container -- mkdir -p /srv/javafactory/
# Working dir
-buildah run $container -- mkdir -p /root/checkout/
-buildah config --workingdir /root/checkout/ $container
+buildah run $container -- mkdir -p /root/build/
+buildah config --workingdir /root/build/ $container
# Perform a build of argeo-commons
-#buildah run $container -- /usr/bin/git clone http://git.argeo.org/apache2/argeo-commons.git .
-buildah copy $container ../.. /root/checkout
-buildah run $container -- /usr/bin/mvn clean install
-buildah run $container -- /usr/bin/mvn dependency:go-offline
+buildah copy $container ../.. /root/build
+buildah run $container -- mvn clean install
+#buildah run $container -- mvn dependency:go-offline
+
# Clean up build directories
-buildah run $container -- /usr/bin/rm -rf /root/.m2/repository/org/argeo/commons
-buildah run $container -- /usr/bin/rm -rf /root/checkout
-buildah run $container -- mkdir -p /root/checkout/
+buildah run $container -- rm -rf /root/.m2/repository/org/argeo/commons
+buildah run $container -- rm -rf /root/build
+buildah run $container -- mkdir -p /root/build/
# Configuration
-#buildah config --workingdir /root/checkout/ $container
-#buildah config --entrypoint '["/usr/bin/mvn","clean","deploy"]' $container
-buildah config --cmd '/usr/bin/mvn clean deploy' $container
+buildah config --entrypoint '["mvn","clean","install"]' $container
-buildah commit $container argeo2-builder:latest
+buildah commit --rm --format docker $container argeo2-builder:maven-v$VERSION_MAVEN
+buildah push argeo2-builder:maven-v$VERSION_MAVEN docker://argeo/argeo2-builder:maven-v$VERSION_MAVEN
+buildah push argeo2-builder:maven-v$VERSION_MAVEN docker://argeo/argeo2-builder:latest
--- /dev/null
+#!/bin/sh
+
+source "$(dirname "$0")/buildah-metadata"
+container=$(buildah from ubi8/ubi-minimal)
+
+source "$(dirname "$0")/buildah-common"
+
+buildah config --label release="1" $container
+buildah config --label version="$VERSION_JAVA" $container
+
+# Metadata
+buildah config --label name="argeo2-java" $container
+buildah config --label description="OpenJDK 11 headless on Red Hat UBI 8" $container
+buildah config --label url=https://hub.docker.com/repository/docker/argeo/argeo2-java $container
+
+# Java 11
+buildah run $container -- microdnf install java-11-openjdk-headless
+
+# Configuration
+buildah config --entrypoint '["java"]' $container
+
+buildah commit --rm --format docker $container argeo2-java:openjdk-v$VERSION_JAVA
+buildah push argeo2-java:openjdk-v$VERSION_JAVA docker://argeo/argeo2-java:openjdk-v$VERSION_JAVA
+buildah push argeo2-java:openjdk-v$VERSION_JAVA docker://argeo/argeo2-java:latest
#!/bin/sh
-container=$(buildah from argeo2-tp)
+source "$(dirname "$0")/buildah-metadata"
+container=$(buildah from argeo2-tp:v$VERSION_ARGEO_TP)
+
+# Override version
+VERSION=2.1.83
source "$(dirname "$0")/buildah-common"
buildah config --label version="$VERSION" $container
# Metadata
-buildah config --label name="argeo2-openjdk11-ubi8" $container
-buildah config --label summary="Argeo 2 Node based on OpenJDK 11 and Red Hat UBI 8" $container
+buildah config --label name="argeo2-node" $container
+buildah config --label description="Argeo 2 Node based on OpenJDK 11 and Red Hat UBI 8" $container
+buildah config --label url=https://hub.docker.com/repository/docker/argeo/argeo2-node $container
# Required as long as we declare an 'argeo' user
buildah run $container -- microdnf install shadow-utils
+# Argeo OSGi Boot
+buildah run $container -- microdnf install osgi-boot
# Argeo Node
buildah run $container -- microdnf install argeo-cms-e4-rap argeo-node
buildah config --entrypoint '["/usr/sbin/argeoctl","start"]' $container
buildah config --port 8080 $container
-buildah commit $container argeo2-node:latest
+buildah commit --rm --format docker $container argeo2-node:v$VERSION
+buildah push argeo2-node:v$VERSION docker://argeo/argeo2-node:v$VERSION
+buildah push argeo2-node:v$VERSION docker://argeo/argeo2-node:latest
#!/bin/sh
-container=$(buildah from ubi8/ubi-minimal)
+source "$(dirname "$0")/buildah-metadata"
+container=$(buildah from argeo2-java:openjdk-v$VERSION_JAVA)
source "$(dirname "$0")/buildah-common"
buildah config --label version="$VERSION_ARGEO_TP" $container
# Metadata
-buildah config --label name="argeo2-tp-openjdk11-ubi8" $container
-buildah config --label summary="Argeo 2 OSGi Third Parties based on OpenJDK 11 and Red Hat UBI 8" $container
-
-# Java 11
-buildah run $container -- microdnf install java-11-openjdk-headless
+buildah config --label name="argeo2-tp" $container
+buildah config --label description="Argeo 2 OSGi Third Parties" $container
+buildah config --label url=https://hub.docker.com/repository/docker/argeo/argeo2-tp $container
# Argeo
buildah run $container -- rpm -Uvh http://repo.argeo.org/rpm/argeo2-release-latest-7.noarch.rpm
# Argeo Third Parties
buildah run $container -- microdnf install argeo-cms-e4-rap-tp osgi-boot-equinox
-# Argeo OSGi Boot
-buildah run $container -- microdnf install osgi-boot
# Configuration
buildah config --entrypoint '["java","-Dosgi.bundles=org.argeo.osgi.boot.jar@start","-Dosgi.configuration=/var/lib/argeo/state","-Dosgi.data=/var/lib/argeo/data","-jar","/usr/share/osgi/boot/org.eclipse.osgi.jar","-console","2323"]' $container
buildah config --workingdir /var/lib/argeo $container
buildah config --volume /var/lib/argeo $container
-buildah commit $container argeo2-tp:latest
+buildah commit --rm --format docker $container argeo2-tp:v$VERSION_ARGEO_TP
+buildah push argeo2-tp:v$VERSION_ARGEO_TP docker://argeo/argeo2-tp:v$VERSION_ARGEO_TP
+buildah push argeo2-tp:v$VERSION_ARGEO_TP docker://argeo/argeo2-tp:latest
## Log-in to Red Hat registry first
# podman login registry.redhat.io
-source ./buildah-metadata
-
# Metadata
buildah config --label maintainer="Mathieu Baudier, mbaudier at argeo.org" $container
buildah config --created-by "Mathieu Baudier, mbaudier at argeo.org" $container
buildah config --author "Argeo GmbH, http://www.argeo.org, contact at argeo.org" $container
buildah config --label vendor="Argeo GmbH" $container
+
+# Remove Red Hat labels
+buildah config --label authoritative-source-url= $container
+buildah config --label com.redhat.build-host= $container
+buildah config --label com.redhat.component= $container
+buildah config --label com.redhat.license_terms= $container
+buildah config --label io.k8s.description= $container
+buildah config --label io.k8s.display-name= $container
+buildah config --label io.openshift.expose-services= $container
+buildah config --label io.openshift.tags= $container
+buildah config --label vcs-ref= $container
+buildah config --label vcs-type= $container
+buildah config --label summary= $container
VERSION=${project.version}
VERSION_ARGEO_TP=${version.argeo-tp}
+
+VERSION_MAVEN=3.5.4
+VERSION_JAVA=11.0.5