Skip to content
Snippets Groups Projects
Commit 581d8640 authored by Cattani Luca's avatar Cattani Luca
Browse files

First release of "dspace tomcat", with new entrypoint and externat persistent storage

parent 40dec747
No related branches found
No related tags found
No related merge requests found
commul-customization/certs/* commul-customization/certs/*
password_mod.sh password_mod.sh
commul-customization/local.properties
...@@ -51,23 +51,21 @@ COPY commul-customization/tomcat-server.xml /opt/tomcat8/conf/server.xml ...@@ -51,23 +51,21 @@ COPY commul-customization/tomcat-server.xml /opt/tomcat8/conf/server.xml
# install Dspace # install Dspace
RUN git clone https://github.com/commul/clarin-dspace.git -b clarin /opt/repository/sources/dspace RUN mkdir /tmp/commul-customization
WORKDIR /opt/repository/sources/dspace/utilities/project_helpers COPY commul-customization/variable.makefile /tmp/commul-customization/
RUN ./setup.sh /opt/repository/workspace
COPY commul-customization/variable.makefile /opt/repository/workspace/config/variable.makefile
# copy over configs and startup scripts # copy over configs and startup scripts
COPY commul-customization/start_stack.sh /opt/repository/workspace/scripts/ COPY commul-customization/start_stack.sh /tmp/commul-customization/
COPY commul-customization/stop_stack.sh /opt/repository/workspace/scripts/ COPY commul-customization/stop_stack.sh /tmp/commul-customization/
COPY commul-customization/local.properties /opt/repository/workspace/sources/ COPY commul-customization/local.properties /tmp/commul-customization/
RUN chmod u+x /opt/repository/workspace/scripts/*_stack.sh
# install libs
WORKDIR /opt/repository/workspace/scripts
RUN make install_libs
# copy over config files # copy over config files
COPY commul-customization/aai_config.js /tmp/ COPY commul-customization/aai_config.js /tmp/commul-customization/
#CMD tail -f /opt/repository/sources/dspace/dspace-api/src/test/data/dspaceFolder/log/dspace.log
COPY dspace-entrypoint.sh /
RUN chmod +x dspace-entrypoint.sh
ENTRYPOINT ["/dspace-entrypoint.sh"]
CMD tail -f /opt/repository/sources/dspace/dspace-api/src/test/data/dspaceFolder/log/dspace.log
Releases
========
gitlab.scientificnet.org:4567/commul/dspace/dspace
0.3
added dspace-entrypoint.sh v0.2
0.2
Removed DSpace's installation from the Dockerfile.
Moved commul-customization into /tmp , so is possible to mount external volumes into /opt/repository/ and then copying files again from /tmp
0.1
Original build from https://github.com/commul/clarin-dspace-docker @ e5ad160
gitlab.scientificnet.org:4567/commul/dspace/postgres
0.3
added env variables
0.2
0.1
Original build from https://github.com/commul/clarin-dspace-docker @ e5ad160
#!/bin/bash
#
# Wiki https://github.com/ufal/clarin-dspace/wiki/Installation
#
#
MAJOR=0
BUILD=2
VERSION="${MAJOR}.${BUILD}"
#set -ex
# let's define some variables
export DSPACE_INSTANCE_NAME=repository
export DSPACE_SOURCE_DIRECTORY=/opt/repository/sources/dspace
export DSPACE_WORKSPACE=/opt/repository/workspace
export DSPACE_INSTALLATION_DIRECTORY=/opt/repository/installations
AAI_CONFIGFILE="/opt/lindat-dspace/installation/webapps/xmlui/themes/UFAL/lib/js/aai_config.js"
DSPACE_CONFIGFILE="$DSPACE_WORKSPACE/sources/local.properties"
#
# functions
#
_logger () {
MSG=$1
if [ ${DEBUG} ]; then
echo -ne "${MSG}"
# else
# echo -ne "${MSG}" >> ${LogFile}
fi
}
_loggerDate() {
_logger "[$(date)] $*"
}
_exit() {
if [ -z $1 ]; then
E_CODE=0
else
E_CODE=$1
fi
rm -rf ${TemporaryPath}
_loggerDate "Script completed\n"
exit ${E_CODE}
}
_printVersion() {
echo "${BASENAME} version ${VERSION}"
}
_printHelp() {
echo "${BASENAME}"
echo "Assembly some stuff, creating things..."
echo
echo "Supported options:"
echo " -d|--debug enable debug"
echo " -V|--version report program version"
echo " -h|--help print this help"
echo
}
_printComment () {
MSG=$1
echo "<"'!'"-- ${MSG} -->"
}
_checkenv () {
set -x
_loggerDate "Checking env variables "
echo $*
tot_args=$#
echo $tot_args
count=0
while [ "$1" ]
do
echo "."
shift
((count++))
done
echo $tot_args $count
if [ "$tot_args" -ne "$count" ];then
exit 1
fi
set +x
}
#
# main script
#
# argument parsing
while [ $1 ]; do
case $1 in
-d|--debug) DEBUG=1
shift
;;
-V|--version) _printVersion
exit 0
;;
-h|--help) _printHelp
exit 0
;;
-t|--test) _notifyByIcingaPassiveCheck
exit 0
;;
*) _printHelp
exit 0
;;
esac
done
_loggerDate "Starting ${BASENAME}\n"
_loggerDate "Cloning lindat-dspace repository..."
if [ ! -d $DSPACE_SOURCE_DIRECTORY ]
then
_logger "in $DSPACE_SOURCE_DIRECTORY \n"
git clone https://github.com/ufal/lindat-dspace.git -b lindat $DSPACE_SOURCE_DIRECTORY
else
_logger "skip! $DSPACE_SOURCE_DIRECTORY already exists \n"
fi
cd $DSPACE_SOURCE_DIRECTORY/utilities/project_helpers
_loggerDate "Creating workspace..."
if [ ! -d $DSPACE_WORKSPACE ]
then
_logger "$DSPACE_WORKSPACE \n"
./setup.sh /opt/repository/workspace
else
_logger "skip! $DSPACE_WORKSPACE already exists \n"
fi
_loggerDate "Copy makefile..."
if [ ! -f $DSPACE_WORKSPACE/config/variable.makefile ]
then
cp /tmp/commul-customization/variable.makefile $DSPACE_WORKSPACE/config/
_logger "$DSPACE_WORKSPACE/config/variable.makefile\n"
else
_logger "skip! $DSPACE_WORKSPACE/config/variable.makefile already exists\n"
fi
_loggerDate "Copy local.properties..."
if [ ! -f $DSPACE_CONFIGFILE ]
then
set -x
cp /tmp/commul-customization/local.properties $DSPACE_CONFIGFILE
set +x
else
_logger "skip! $DSPACE_CONFIGFILE already exists\n"
fi
_loggerDate "Compilation and Deployment of DSpace..."
cd $DSPACE_WORKSPACE/scripts/
if [ ! -f $DSPACE_WORKSPACE/scripts/install_libs.done ]
then
make install_libs
touch $DSPACE_WORKSPACE/scripts/install_libs.done
else
_logger "already done \n"
fi
if [ ! -f $DSPACE_WORKSPACE/scripts/fresh_install.done ]
then
make compile
make fresh_install
touch $DSPACE_WORKSPACE/scripts/fresh_install.done
else
_logger "already done \n"
fi
if [ ! -f $DSPACE_WORKSPACE/scripts/postinstall.done ]
then
make postinstall
touch $DSPACE_WORKSPACE/scripts/postinstall.done
_logger "OK\n"
else
_logger "already done \n"
fi
_loggerDate "Copy aai_config.js..."
if [ ! -f $AAI_CONFIGFILE ]
then
set -x
cp /tmp/commul-customization/aai_config.js $AAI_CONFIGFILE
set +x
else
_logger "skip! $AAI_CONFIGFILE already exists\n"
fi
_loggerDate "Create dspace admin..."
if [ ! -f $DSPACE_WORKSPACE/scripts/tomcatadmin.done ]
then
su tomcat8 -c "/opt/lindat-dspace/installation/bin/dspace create-administrator"
touch $DSPACE_WORKSPACE/scripts/tomcatadmin.done
_logger "OK\n"
else
_logger "already done \n"
fi
_loggerDate "Starting Tomcat..."
/etc/init.d/tomcat8 start
sleep infinity
apiVersion: v1
kind: Pod
metadata:
name: servlet
spec:
containers:
- args:
- --debug
env:
- name: dspaceuser
value: dbuser
- name: dspacepassword
valueFrom:
secretKeyRef:
key: dspace.password
name: dspace-secrets
- name: dspacedbname
value: dbname
- name: dspaceutilsdbname
value: dbnamespace
image: gitlab.scientificnet.org:4567/commul/dspace/dspace:0.3
imagePullPolicy: Always
name: servlet
ports:
- containerPort: 8080
protocol: TCP
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /opt/lindat-dspace
name: cephfs-lindat
- mountPath: /opt/repository
name: cephfs-repository
dnsPolicy: ClusterFirst
imagePullSecrets:
- name: gitlab-scientificnet-org-registry
restartPolicy: Always
volumes:
- cephfs:
monitors:
- 10.8.55.201:6789
- 10.8.55.202:6789
- 10.8.55.203:6789
- 10.7.55.201:6789
- 10.7.55.202:6789
path: /services/kubernetes/eurac/commul/dspace-dev/lindat-common
secretRef:
name: client.fs.services.kubernetes.eurac.commul.dspace-dev
user: fs.services.kubernetes.eurac.commul.dspace-dev
name: cephfs-lindat
- cephfs:
monitors:
- 10.8.55.201:6789
- 10.8.55.202:6789
- 10.8.55.203:6789
- 10.7.55.201:6789
- 10.7.55.202:6789
path: /services/kubernetes/eurac/commul/dspace-dev/repository
secretRef:
name: client.fs.services.kubernetes.eurac.commul.dspace-dev
user: fs.services.kubernetes.eurac.commul.dspace-dev
name: cephfs-repository
- name: default-token-c1pd4
secret:
defaultMode: 420
secretName: default-token-c1pd4
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment