]> git.argeo.org Git - lgpl/argeo-commons.git/blob - dist/containers/argeo2-builder
Ignore target directory.
[lgpl/argeo-commons.git] / dist / containers / argeo2-builder
1 #!/bin/sh
2
3 source "$(dirname "$0")/buildah-metadata"
4 container=$(buildah from argeo2-java:openjdk-v$VERSION_JAVA)
5
6 source "$(dirname "$0")/buildah-common"
7
8 buildah config --label release="1" $container
9 buildah config --label version="$VERSION" $container
10
11 # Metadata
12 buildah config --label name="argeo2-builder" $container
13 buildah config --label description="Argeo 2 Builder" $container
14
15 # Utilities
16 #buildah run $container -- microdnf -y install git
17 # Java 11
18 #buildah run $container -- microdnf -y install java-11-openjdk-devel
19 # Maven
20 #buildah run $container -- microdnf -y install maven
21 #buildah copy $container maven.conf /etc/java/maven.conf
22
23 buildah run $container -- microdnf -y install tar gzip
24 buildah copy $container https://archive.apache.org/dist/maven/maven-3/$VERSION_MAVEN/binaries/apache-maven-$VERSION_MAVEN-bin.tar.gz /opt
25 buildah run $container -- tar -C /opt -xzf /opt/apache-maven-$VERSION_MAVEN-bin.tar.gz
26 buildah run $container -- rm -f /opt/apache-maven-$VERSION_MAVEN-bin.tar.gz
27 buildah run $container -- microdnf -y remove tar gzip
28
29 buildah run $container -- ln -s /opt/apache-maven-$VERSION_MAVEN/bin/mvn /usr/local/bin/mvn
30 # Maven script requires which
31 buildah run $container -- microdnf -y install which
32
33 buildah run $container -- mkdir -p /srv/javafactory/
34
35 # Working dir
36 buildah run $container -- mkdir -p /root/build/
37 buildah config --workingdir /root/build/ $container
38
39 # Perform a build of argeo-commons
40 buildah copy $container ../.. /root/build
41 buildah run $container -- mvn clean install
42 #buildah run $container -- mvn dependency:go-offline
43
44 # Clean up build directories
45 buildah run $container -- rm -rf /root/.m2/repository/org/argeo/commons
46 buildah run $container -- rm -rf /root/build
47 buildah run $container -- mkdir -p /root/build/
48
49 # Configuration
50 buildah config --entrypoint '["mvn","clean","install"]' $container
51
52 buildah commit --rm --format docker $container argeo2-builder:maven-v$VERSION_MAVEN
53 buildah push argeo2-builder:maven-v$VERSION_MAVEN docker://argeo/argeo2-builder:maven-v$VERSION_MAVEN
54 buildah push argeo2-builder:maven-v$VERSION_MAVEN docker://argeo/argeo2-builder:latest