Skip to content
This repository was archived by the owner on Feb 2, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
# tests. More information on cccp.yml file can be found on:
# https://github.com/CentOS/container-index#the-cccpyml-file

job-id: wildfly-swarm
job-id: thorntail
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ MAINTAINER Dharmit Shah
EXPOSE 8080
LABEL che:server:8080:ref=wildfly che:server:8080:protocol=http

ARG SWARM_VERSION=2018.5.0
ARG THORNTAIL_VERSION=2.2.1.Final

COPY install-swarm-dependencies.sh /tmp/
RUN sudo chown user:user /tmp/install-swarm-dependencies.sh && \
chmod a+x /tmp/install-swarm-dependencies.sh && \
scl enable rh-maven33 /tmp/install-swarm-dependencies.sh && \
sudo rm -f /tmp/install-swarm-dependencies.sh && \
COPY install-thorntail-dependencies.sh /tmp/
RUN sudo chown user:user /tmp/install-thorntail-dependencies.sh && \
chmod a+x /tmp/install-thorntail-dependencies.sh && \
scl enable rh-maven33 /tmp/install-thorntail-dependencies.sh && \
sudo rm -f /tmp/install-thorntail-dependencies.sh && \
sudo chgrp -R 0 /home/user && \
sudo chmod -R g+rwX /home/user
Original file line number Diff line number Diff line change
Expand Up @@ -15,49 +15,49 @@ cleanup() {
rm -rf $TMP_DIR
}

if [ -z $SWARM_VERSION ]; then
echo -e "${RED}SWARM_VERSION must be defined! ${NC}"
if [ -z $THORNTAIL_VERSION ]; then
echo -e "${RED}THORNTAIL_VERSION must be defined! ${NC}"
exit 1
fi

BOM_ALL_POM_URL="https://repo1.maven.org/maven2/org/wildfly/swarm/bom-all/${SWARM_VERSION}/bom-all-${SWARM_VERSION}.pom"
TMP_DIR="/tmp/swarm-${SWARM_VERSION}"
LOG_FILE="${TMP_DIR}/maven-swarm-${SWARM_VERSION}.log"
POM_FILE="${TMP_DIR}/pom-bom-all-${SWARM_VERSION}.xml"
SWARM_PLUGIN_SNIPPET="<build><directory>${TMP_DIR}\/target<\/directory><plugins><plugin><groupId>org.wildfly.swarm<\/groupId><artifactId>wildfly-swarm-plugin<\/artifactId><version>${SWARM_VERSION}<\/version><executions><execution><goals><goal>package<\/goal><\/goals><\/execution><\/executions><\/plugin><\/plugins>"
BOM_ALL_POM_URL="https://repo1.maven.org/maven2/io/thorntail/bom-all/${THORNTAIL_VERSION}/bom-all-${THORNTAIL_VERSION}.pom"
TMP_DIR="/tmp/thorntail-${THORNTAIL_VERSION}"
LOG_FILE="${TMP_DIR}/maven-thorntail-${THORNTAIL_VERSION}.log"
POM_FILE="${TMP_DIR}/pom-bom-all-${THORNTAIL_VERSION}.xml"
THORNTAIL_PLUGIN_SNIPPET="<build><directory>${TMP_DIR}\/target<\/directory><plugins><plugin><groupId>io.thorntail<\/groupId><artifactId>thorntail-maven-plugin<\/artifactId><version>${THORNTAIL_VERSION}<\/version><executions><execution><goals><goal>package<\/goal><\/goals><\/execution><\/executions><\/plugin><\/plugins>"

echo -e "${BLUE}================================== \n\n Installing WildFly Swarm ${SWARM_VERSION} dependencies...\n\n BOM_ALL_POM_URL: ${BOM_ALL_POM_URL}\n\n TMP_DIR: ${TMP_DIR} \n\n ================================== \n"
echo -e "${BLUE}================================== \n\n Installing Thorntail ${THORNTAIL_VERSION} dependencies...\n\n BOM_ALL_POM_URL: ${BOM_ALL_POM_URL}\n\n TMP_DIR: ${TMP_DIR} \n\n ================================== \n"
cleanup
mkdir $TMP_DIR

# Get the bom-all pom.xml
wget $BOM_ALL_POM_URL -O $POM_FILE -q

if [ ! -s $POM_FILE ]; then
echo -e "${RED}Unable to obtain bom-all-${SWARM_VERSION}.pom from ${BOM_ALL_POM_URL} ${NC}"
echo -e "${RED}Unable to obtain bom-all-${THORNTAIL_VERSION}.pom from ${BOM_ALL_POM_URL} ${NC}"
cleanup
exit 1
fi

echo -e "${YELLOW} BOM ALL pom.xml downloaded to ${POM_FILE} ${NC}"

# Transform the bom-all pom.xml into a dummy Swarm app
# Transform the bom-all pom.xml into a dummy Thorntail app
# First remove <dependencyManagement> tags - all the fractions are used
sed -i -e '/dependencyManagement/d' $POM_FILE
# Replace <packaging>pom</packaging> with <packaging>war</packaging>
sed -i -e 's/<packaging>pom<\/packaging>/<packaging>war<\/packaging>/' $POM_FILE
# Add Swarm plugin - we need this to obtain WildFly modules
sed -i -e "s|<build>|$SWARM_PLUGIN_SNIPPET|" $POM_FILE
# Add Thorntail plugin - we need this to obtain WildFly modules
sed -i -e "s|<build>|$THORNTAIL_PLUGIN_SNIPPET|" $POM_FILE

echo -e "${YELLOW} BOM ALL pom.xml transformed, resolving dependencies... ${NC}"
echo -e "${YELLOW} Log file: ${LOG_FILE} ${NC}"

# Resolve dependencies - Swarm plugin takes care of additional WildFly module dependencies
# Resolve dependencies - Thorntail plugin takes care of additional WildFly module dependencies
mvn clean package -f $POM_FILE > $LOG_FILE
if [ $? -eq 0 ]; then
echo -e "${BLUE} WildFly Swarm ${SWARM_VERSION} dependencies installed ${NC}"
echo -e "${BLUE} Thorntail ${THORNTAIL_VERSION} dependencies installed ${NC}"
else
echo -e "${RED}Unable to install WildFly Swarm ${SWARM_VERSION} dependencies ${NC}"
echo -e "${RED}Unable to install Thorntail ${THORNTAIL_VERSION} dependencies ${NC}"
cat $LOG_FILE
fi

Expand Down