Skip to content

Commit 7d002ee

Browse files
silverusermmoqui
silveruser
authored andcommitted
Refine the run script for Silverpeas 6.1.
Add the look Aurora by default in the dockerized Silverpeas. Generate Dockerfile for Silverpeas 6.1 Fix for 6.1 the misname of a migration SQL script
1 parent 1640347 commit 7d002ee

File tree

4 files changed

+64
-7
lines changed

4 files changed

+64
-7
lines changed

Dockerfile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ ENV TERM=xterm
1212
# the dependencies required to run SWFTools and PDF2JSON
1313
RUN apt-get update && apt-get install -y \
1414
wget \
15+
vim \
1516
locales \
1617
procps \
1718
net-tools \
@@ -79,9 +80,9 @@ ENV JAVA_HOME /docker-java-home
7980
ENV SILVERPEAS_HOME /opt/silverpeas
8081
ENV JBOSS_HOME /opt/wildfly
8182

82-
ENV SILVERPEAS_VERSION=6.1-build200607
83+
ENV SILVERPEAS_VERSION=6.1
8384
ENV WILDFLY_VERSION=18.0.1
84-
LABEL name="Silverpeas 6" description="Image to install and to run Silverpeas 6" vendor="Silverpeas" version="6.1-build200607" build=1
85+
LABEL name="Silverpeas 6" description="Image to install and to run Silverpeas 6" vendor="Silverpeas" version="6.1" build=2
8586

8687
# Fetch both Silverpeas and Wildfly and unpack them into /opt
8788
RUN wget -nc https://www.silverpeas.org/files/silverpeas-${SILVERPEAS_VERSION}-wildfly${WILDFLY_VERSION%.?.?}.zip \
@@ -100,15 +101,20 @@ RUN wget -nc https://www.silverpeas.org/files/silverpeas-${SILVERPEAS_VERSION}-w
100101
# the Silverpeas Nexus Repository
101102
COPY src/settings.xml /root/.m2/
102103

104+
# Copy the customized Silverpeas installation settings
105+
COPY src/silverpeas.gradle ${SILVERPEAS_HOME}/bin/
106+
103107
# Set the default working directory
104108
WORKDIR ${SILVERPEAS_HOME}/bin
105109

106110
# Copy this container init script that will be run each time the container is ran
107111
COPY src/run.sh /opt/
108112
COPY src/converter.groovy ${SILVERPEAS_HOME}/configuration/silverpeas/
109113

110-
# Assemble Silverpeas
111-
RUN ./silverpeas assemble \
114+
# Assemble Silverpeas. Rename the script to match what is is expected by the migration descriptor
115+
RUN sed -i -e "s/SILVERPEAS_VERSION/${SILVERPEAS_VERSION}/g" ${SILVERPEAS_HOME}/bin/silverpeas.gradle \
116+
&& ./silverpeas construct \
117+
&& mv ../migrations/db/h2/busCore/up040/alter-table.sql ../migrations/db/h2/busCore/up040/alter_table.sql \
112118
&& rm ../log/build-* \
113119
&& touch .install
114120

Dockerfile.template

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ ENV TERM=xterm
1212
# the dependencies required to run SWFTools and PDF2JSON
1313
RUN apt-get update && apt-get install -y \
1414
wget \
15+
vim \
1516
locales \
1617
procps \
1718
net-tools \
@@ -100,6 +101,9 @@ RUN wget -nc https://www.silverpeas.org/files/silverpeas-${SILVERPEAS_VERSION}-w
100101
# the Silverpeas Nexus Repository
101102
COPY src/settings.xml /root/.m2/
102103

104+
# Copy the customized Silverpeas installation settings
105+
COPY src/silverpeas.gradle ${SILVERPEAS_HOME}/bin/
106+
103107
# Set the default working directory
104108
WORKDIR ${SILVERPEAS_HOME}/bin
105109

@@ -108,7 +112,8 @@ COPY src/run.sh /opt/
108112
COPY src/converter.groovy ${SILVERPEAS_HOME}/configuration/silverpeas/
109113

110114
# Assemble Silverpeas
111-
RUN ./silverpeas assemble \
115+
RUN sed -i -e "s/SILVERPEAS_VERSION/${SILVERPEAS_VERSION}/g" ${SILVERPEAS_HOME}/bin/silverpeas.gradle \
116+
&& ./silverpeas construct \
112117
&& rm ../log/build-* \
113118
&& touch .install
114119

src/run.sh

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,29 @@ if [ -f ${SILVERPEAS_HOME}/bin/.install ]; then
4747
pre_install
4848
if [ -f ${SILVERPEAS_HOME}/configuration/config.properties ]; then
4949
echo "First start: set up Silverpeas ..."
50-
./silverpeas install && rm ${SILVERPEAS_HOME}/bin/.install
50+
set +e
51+
./silverpeas install
52+
if [ $? -eq 0 ]; then
53+
rm ${SILVERPEAS_HOME}/bin/.install
54+
else
55+
echo "Error while setting up Silverpeas"
56+
echo
57+
for f in ${SILVERPEAS_HOME}/log/build-*; do
58+
cat $f
59+
done
60+
exit 1
61+
fi
62+
set -e
63+
else
64+
echo "No ${SILVERPEAS_HOME}/configuration/config.properties found!"
65+
exit 1
5166
fi
5267
fi
5368

5469
if [ -f ${SILVERPEAS_HOME}/configuration/config.properties ] && [ ! -e ${SILVERPEAS_HOME}/bin/.install ]; then
5570
start_silverpeas
5671
else
57-
echo "No ${SILVERPEAS_HOME}/configuration/config.properties found! No start!"
72+
echo "A failure has occurred in the setting up of Silverpeas! No start!"
5873
exit 1
5974
fi
6075

src/silverpeas.gradle

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/* Silverpeas version to install */
2+
version = 'SILVERPEAS_VERSION'
3+
4+
configurations {
5+
all {
6+
transitive = true
7+
/* Only to load SNAPSHOT versions of Silverpeas */
8+
resolutionStrategy {
9+
cacheDynamicVersionsFor 0, 'seconds'
10+
cacheChangingModulesFor 0, 'seconds'
11+
}
12+
}
13+
silverpeas {
14+
/* a Silverpeas module is made up of a war and optionally a configuration archive */
15+
description = 'Silverpeas Modules'
16+
}
17+
library {
18+
description = 'Specific Silverpeas or tiers libraries to include into Silverpeas (jar only)'
19+
}
20+
}
21+
22+
/* Dependencies to fetch for making Silverpeas */
23+
dependencies {
24+
silverpeas "org.silverpeas:silverpeas-assembly:${project.version}"
25+
silverpeas "org.silverpeas.looks.aurora:silverpeas-aurora-configuration:${project.version}"
26+
silverpeas "org.silverpeas.looks.aurora:silverpeas-aurora-war:${project.version}@war"
27+
library fileTree(dir: 'lib', include: ['*.jar'])
28+
}
29+
30+
/* Log level for the Silverpeas installation */
31+
project.ext.logLevel = org.gradle.api.logging.LogLevel.INFO

0 commit comments

Comments
 (0)