-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ buildout: ## Runs setup and buildout | |
copy: ## Runs `copy-data.sh` | ||
@# copy-data is generated by puppet when data_source is found | ||
if [ $(copydata) = 1 ] && [ -f copy-data.sh ]; then ./copy-data.sh; fi | ||
# if [ $(copydata) = 1 ] && [ -f bin/solr-start ]; then ./copy-solr.sh; fi | ||
@$ echo "copy-data finished for instance $(plone), check http://$(hostname):$(instance1_port)/manage_main" | mail -s "copy-data finished" [email protected] | ||
|
||
.PHONY: upgrade | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env bash | ||
|
||
#set -ex | ||
|
||
SOURCE_HOST="$(grep SOURCE_HOST= copy-data.sh|cut -d '=' -f 2 | tr -d '"')" | ||
SOURCE_PATH="$(grep SOURCE_PATH= copy-data.sh|cut -d '=' -f 2 | tr -d '"')" | ||
LOG="copy-solr.log" | ||
|
||
if [ "$(whoami)" != "zope" ]; then | ||
echo "This script must be run as zope" | ||
exit -1 | ||
fi | ||
|
||
if [ -f ${LOG} ]; then | ||
echo "It looks like this script has already been run." | ||
echo "If you want to run it again, please delete the '${LOG}' file." | ||
exit -1 | ||
fi | ||
|
||
if [ ! -f bin/solr-start ]; then | ||
echo "It looks like bin/solr-start is not present in this directory." | ||
exit -1 | ||
fi | ||
|
||
exec > >(tee -i ${LOG}) | ||
exec 2>&1 | ||
|
||
echo `date` | ||
echo | ||
echo "Copying solr files from ${SOURCE_HOST}:${SOURCE_PATH}/var/solr to var/ :" | ||
rsync -e "ssh -o StrictHostKeyChecking=no" -avhP "${SOURCE_HOST}:${SOURCE_PATH}/var/solr" var/ --delete | ||
|
||
echo | ||
echo `date` |