-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdspace-rebuild.sh
executable file
·37 lines (30 loc) · 1.19 KB
/
dspace-rebuild.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
WORKDIR=$PWD
CONFIGDIR=$WORKDIR/config
SRCDIR=/tmp/DSpace_build
echo "delete last src dump"
sudo -u dspace rm -rf $SRCDIR && echo "OK"
echo "copy sources from git"
sudo -u dspace cp -r $WORKDIR/DSpace $SRCDIR
cd $SRCDIR
echo "copy predefined configs"
# enable rest
# mail server cfg
# swordv2 cfg
# xmlui cfg
sudo -u dspace sh -c "
cat $CONFIGDIR/rest/web.xml > dspace-rest/src/main/webapp/WEB-INF/web.xml && \
cat $CONFIGDIR/local.cfg > dspace/config/local.cfg && \
cat $CONFIGDIR/xmlui.xconf > dspace/config/xmlui.xconf && \
cat $CONFIGDIR/input-forms.xml > dspace/config/input-forms.xml && \
cat $CONFIGDIR/item-submission.xml > dspace/config/item-submission.xml
"
cd $WORKDIR
cd $SRCDIR && sudo -u dspace mvn -e package -Dmirage2.on=true && \
sudo service tomcat stop && \
cd $SRCDIR/dspace/target/dspace-installer/ && sudo -u dspace ant update && \
sudo cp -R -p /dspace/webapps/* /opt/tomcat/webapps/ && \
sudo -u dspace rm -rf /dspace/*bak* && \
sudo sed -i 's#dspace.baseUrl = http://${dspace.hostname}:8080#dspace.baseUrl = https://${dspace.hostname}#' /dspace/config/local.cfg && \
sudo service tomcat start
echo "OK"