Skip to content

Commit 5829f0b

Browse files
committed
Allow infinispan setup script to run on ubi minimal
1 parent 73fa868 commit 5829f0b

File tree

4 files changed

+72
-9
lines changed

4 files changed

+72
-9
lines changed

ga/24.0.0.12/kernel/helpers/build/infinispan-client-setup.sh

+10-3
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,20 @@ fi
1818

1919
set -Eeox pipefail
2020

21-
yum update -y
22-
yum install -y maven
21+
pkgcmd=yum
22+
if ! command $pkgcmd
23+
then
24+
pkgcmd=microdnf
25+
fi
26+
27+
$pkgcmd update -y
28+
$pkgcmd install -y maven
2329
mkdir -p /opt/ibm/wlp/usr/shared/resources/infinispan
2430
echo '<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>io.openliberty</groupId> <artifactId>openliberty-infinispan-client</artifactId> <version>1.0</version> <!-- https://mvnrepository.com/artifact/org.infinispan/infinispan-jcache-remote --> <dependencies> <dependency> <groupId>org.infinispan</groupId> <artifactId>infinispan-jcache-remote</artifactId> <version>10.1.3.Final</version> </dependency> </dependencies></project>' > /opt/ibm/wlp/usr/shared/resources/infinispan/pom.xml
2531
mvn -f /opt/ibm/wlp/usr/shared/resources/infinispan/pom.xml versions:use-latest-releases -DallowMajorUpdates=false
2632
mvn -f /opt/ibm/wlp/usr/shared/resources/infinispan/pom.xml dependency:copy-dependencies -DoutputDirectory=/opt/ibm/wlp/usr/shared/resources/infinispan
27-
yum remove -y maven
33+
# This fails with dependency errors using microdnf on ubi-minimal, but it is okay to let it fail
34+
yum remove -y maven || true
2835
rm -f /opt/ibm/wlp/usr/shared/resources/infinispan/pom.xml
2936
rm -f /opt/ibm/wlp/usr/shared/resources/infinispan/jboss-transaction-api*.jar
3037
rm -f /opt/ibm/wlp/usr/shared/resources/infinispan/reactive-streams-*.jar
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash
2+
# (C) Copyright IBM Corporation 2020.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
if [ "$VERBOSE" != "true" ]; then
16+
exec >/dev/null
17+
fi
18+
19+
set -Eeox pipefail
20+
21+
pkgcmd=yum
22+
if ! command $pkgcmd
23+
then
24+
pkgcmd=microdnf
25+
fi
26+
27+
$pkgcmd update -y
28+
$pkgcmd install -y maven
29+
mkdir -p /opt/ibm/wlp/usr/shared/resources/infinispan
30+
echo '<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>io.openliberty</groupId> <artifactId>openliberty-infinispan-client</artifactId> <version>1.0</version> <!-- https://mvnrepository.com/artifact/org.infinispan/infinispan-jcache-remote --> <dependencies> <dependency> <groupId>org.infinispan</groupId> <artifactId>infinispan-jcache-remote</artifactId> <version>10.1.3.Final</version> </dependency> </dependencies></project>' > /opt/ibm/wlp/usr/shared/resources/infinispan/pom.xml
31+
mvn -f /opt/ibm/wlp/usr/shared/resources/infinispan/pom.xml versions:use-latest-releases -DallowMajorUpdates=false
32+
mvn -f /opt/ibm/wlp/usr/shared/resources/infinispan/pom.xml dependency:copy-dependencies -DoutputDirectory=/opt/ibm/wlp/usr/shared/resources/infinispan
33+
# This fails with dependency errors using microdnf on ubi-minimal, but it is okay to let it fail
34+
yum remove -y maven || true
35+
rm -f /opt/ibm/wlp/usr/shared/resources/infinispan/pom.xml
36+
rm -f /opt/ibm/wlp/usr/shared/resources/infinispan/jboss-transaction-api*.jar
37+
rm -f /opt/ibm/wlp/usr/shared/resources/infinispan/reactive-streams-*.jar
38+
rm -f /opt/ibm/wlp/usr/shared/resources/infinispan/rxjava-*.jar
39+
rm -rf ~/.m2
40+
chown -R 1001:0 /opt/ibm/wlp/usr/shared/resources/infinispan
41+
chmod -R g+rw /opt/ibm/wlp/usr/shared/resources/infinispan
42+

ga/25.0.0.3/kernel/helpers/build/infinispan-client-setup.sh

+10-3
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,20 @@
1616

1717
set -Eeox pipefail
1818

19-
yum update -y
20-
yum install -y maven
19+
pkgcmd=yum
20+
if ! command $pkgcmd
21+
then
22+
pkgcmd=microdnf
23+
fi
24+
25+
$pkgcmd update -y
26+
$pkgcmd install -y maven
2127
mkdir -p /opt/ibm/wlp/usr/shared/resources/infinispan
2228
echo '<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>io.openliberty</groupId> <artifactId>openliberty-infinispan-client</artifactId> <version>1.0</version> <!-- https://mvnrepository.com/artifact/org.infinispan/infinispan-jcache-remote --> <dependencies> <dependency> <groupId>org.infinispan</groupId> <artifactId>infinispan-jcache-remote</artifactId> <version>10.1.3.Final</version> </dependency> </dependencies></project>' > /opt/ibm/wlp/usr/shared/resources/infinispan/pom.xml
2329
mvn -f /opt/ibm/wlp/usr/shared/resources/infinispan/pom.xml versions:use-latest-releases -DallowMajorUpdates=false
2430
mvn -f /opt/ibm/wlp/usr/shared/resources/infinispan/pom.xml dependency:copy-dependencies -DoutputDirectory=/opt/ibm/wlp/usr/shared/resources/infinispan
25-
yum remove -y maven
31+
# This fails with dependency errors using microdnf on ubi-minimal, but it is okay to let it fail
32+
yum remove -y maven || true
2633
rm -f /opt/ibm/wlp/usr/shared/resources/infinispan/pom.xml
2734
rm -f /opt/ibm/wlp/usr/shared/resources/infinispan/jboss-transaction-api*.jar
2835
rm -f /opt/ibm/wlp/usr/shared/resources/infinispan/reactive-streams-*.jar

ga/latest/kernel/helpers/build/infinispan-client-setup.sh

+10-3
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,20 @@
1616

1717
set -Eeox pipefail
1818

19-
yum update -y
20-
yum install -y maven
19+
pkgcmd=yum
20+
if ! command $pkgcmd
21+
then
22+
pkgcmd=microdnf
23+
fi
24+
25+
$pkgcmd update -y
26+
$pkgcmd install -y maven
2127
mkdir -p /opt/ibm/wlp/usr/shared/resources/infinispan
2228
echo '<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>io.openliberty</groupId> <artifactId>openliberty-infinispan-client</artifactId> <version>1.0</version> <!-- https://mvnrepository.com/artifact/org.infinispan/infinispan-jcache-remote --> <dependencies> <dependency> <groupId>org.infinispan</groupId> <artifactId>infinispan-jcache-remote</artifactId> <version>10.1.3.Final</version> </dependency> </dependencies></project>' > /opt/ibm/wlp/usr/shared/resources/infinispan/pom.xml
2329
mvn -f /opt/ibm/wlp/usr/shared/resources/infinispan/pom.xml versions:use-latest-releases -DallowMajorUpdates=false
2430
mvn -f /opt/ibm/wlp/usr/shared/resources/infinispan/pom.xml dependency:copy-dependencies -DoutputDirectory=/opt/ibm/wlp/usr/shared/resources/infinispan
25-
yum remove -y maven
31+
# This fails with dependency errors using microdnf on ubi-minimal, but it is okay to let it fail
32+
yum remove -y maven || true
2633
rm -f /opt/ibm/wlp/usr/shared/resources/infinispan/pom.xml
2734
rm -f /opt/ibm/wlp/usr/shared/resources/infinispan/jboss-transaction-api*.jar
2835
rm -f /opt/ibm/wlp/usr/shared/resources/infinispan/reactive-streams-*.jar

0 commit comments

Comments
 (0)