aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNuoHan Qiao <qiaonuohan@cn.fujitsu.com>2016-08-05 02:43:56 -0400
committerNuoHan Qiao <qiaonuohan@cn.fujitsu.com>2016-08-10 02:45:01 -0400
commit8ad355d9d540ef1050d40a314b71412f8bcaaad1 (patch)
tree85e9890f26d131e446da2fa9b20635e59f06a797
parentbd0f7d3b95d600d493d67222d2d2ff2b5af980b8 (diff)
Template config.xml
Template config.xml to avoid overwrite config.xml during updating of AGL-JTA. Since config.xml will be overwrite when configuration is changed, try copying the config.xml to userdata/conf/config.xml before updating AGL-JTA, then the previous configuration will be kept. Change-Id: I6c89a6a8b2ca3dce95769eadebe21d4e672d6616 Signed-off-by: NuoHan Qiao <qiaonuohan@cn.fujitsu.com>
-rwxr-xr-xinstall.sh10
-rw-r--r--userdata/conf/config_template.xml (renamed from userdata/conf/config.xml)2
2 files changed, 9 insertions, 3 deletions
diff --git a/install.sh b/install.sh
index c210578..d1e63fc 100755
--- a/install.sh
+++ b/install.sh
@@ -3,13 +3,14 @@ JENKINS_MD5="ff5078b39a4a82d78540bfd72f60b577"
JENKINS_DOWNLOAD_SITE="http://pkg.jenkins-ci.org/debian-stable/binary/$JENKINS_PKG"
RETRY_MAX=3
-# check if jenkins exists
+# 1. get jenkins
+# 1.1 check if jenkins exists
jenkins_md5=0
if [[ -f "frontend-install/$JENKINS_PKG" ]]; then
jenkins_md5=`md5sum "frontend-install/$JENKINS_PKG" | awk '{print $1}'`
fi
-# check if md5 of jenkins matches
+# 1.2 check if md5 of jenkins matches
if [[ "$JENKINS_MD5" == "$jenkins_md5" ]]; then
echo "Jenkins has already been downloaded."
else
@@ -32,4 +33,9 @@ else
done
fi
+# 2. find config.xml of jenkins. if not found, cp config_template.xml to config.xml
+if [[ ! -e "userdata/conf/config.xml" ]]; then
+ cp -f "userdata/conf/config_template.xml" "userdata/conf/config.xml"
+fi
+
sudo jta-host-scripts/docker-build.sh
diff --git a/userdata/conf/config.xml b/userdata/conf/config_template.xml
index 05147f3..b07c958 100644
--- a/userdata/conf/config.xml
+++ b/userdata/conf/config_template.xml
@@ -295,4 +295,4 @@
</envVars>
</hudson.slaves.EnvironmentVariablesNodeProperty>
</globalNodeProperties>
-</hudson> \ No newline at end of file
+</hudson>