Skip to content

Commit

Permalink
added/fixed missing integrity-test else-case during deploy in case th…
Browse files Browse the repository at this point in the history
…at we update with a tar file

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4700 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
orbiter committed Apr 15, 2008
1 parent 6155f0e commit 04c1226
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions source/de/anomic/yacy/yacyVersion.java
Expand Up @@ -413,21 +413,28 @@ public static void deployRelease(File releaseFile) {
"#!/bin/sh" + serverCore.LF_STRING +
"cd " + sb.getRootPath() + "/DATA/RELEASE/" + serverCore.LF_STRING +
((releaseFile.getName().endsWith(".gz")) ?
// test gz-file for integrity and tar xfz then
("if gunzip -t " + releaseFile.getAbsolutePath() + serverCore.LF_STRING +
"then" + serverCore.LF_STRING +
"gunzip -c " + releaseFile.getAbsolutePath() + " | tar xf -" + serverCore.LF_STRING) :
// just tar xf the file, no integrity test possible?
("tar xf " + releaseFile.getAbsolutePath() + serverCore.LF_STRING)
) +
"while [ -f ../yacy.running ]; do" + serverCore.LF_STRING +
"sleep 1" + serverCore.LF_STRING +
"done" + serverCore.LF_STRING +
"cp -Rf yacy/* " + apphome + serverCore.LF_STRING +
"rm -Rf yacy" + serverCore.LF_STRING +
"else" + serverCore.LF_STRING +
"while [ -f ../yacy.running ]; do" + serverCore.LF_STRING +
"sleep 1" + serverCore.LF_STRING +
"done" + serverCore.LF_STRING +
"fi" + serverCore.LF_STRING +
((releaseFile.getName().endsWith(".gz")) ?
// else-case of gunzip -t test: if failed, just restart
("else" + serverCore.LF_STRING +
"while [ -f ../yacy.running ]; do" + serverCore.LF_STRING +
"sleep 1" + serverCore.LF_STRING +
"done" + serverCore.LF_STRING +
"fi" + serverCore.LF_STRING) :
// in case that we did not made the integrity test, there is no else case
""
) +
"cd " + apphome + serverCore.LF_STRING +
"nohup ./startYACY.sh > /dev/null" + serverCore.LF_STRING;
File scriptFile = new File(sb.getRootPath(), "DATA/RELEASE/update.sh");
Expand Down

0 comments on commit 04c1226

Please sign in to comment.