summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2014-09-01 18:40:41 (GMT)
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2014-09-17 10:39:19 (GMT)
commit34872e2636ed058a414ee7c66634accb754e8840 (patch)
tree2640c2da350d4de41df9ef57327f2821439ac620
parent04abe5fab7e2cc3a874f6d70ef92051096517e5f (diff)
downloaddefinitions-34872e2636ed058a414ee7c66634accb754e8840.tar.gz
Move Mason out from /root
- Move the configuration file to /etc/mason.conf - Move the scripts to /usr/lib/mason/ - Mason will store the report in /var/mason/report.html
-rw-r--r--mason.configure9
-rwxr-xr-xmason/mason-report.sh6
-rw-r--r--mason/mason.service2
-rwxr-xr-xmason/mason.sh2
4 files changed, 11 insertions, 8 deletions
diff --git a/mason.configure b/mason.configure
index 9ad6f2c..23ee23c 100644
--- a/mason.configure
+++ b/mason.configure
@@ -37,8 +37,10 @@ ROOT="$1"
# Copy Mason files into root filesystem
##########################################################################
-cp mason/mason.sh "$ROOT"/root/mason.sh
-cp mason/mason-report.sh "$ROOT"/root/mason-report.sh
+
+mkdir -p "$ROOT"/usr/lib/mason
+cp mason/mason.sh "$ROOT"/usr/lib/mason/mason.sh
+cp mason/mason-report.sh "$ROOT"/usr/lib/mason/mason-report.sh
cp mason/mason.timer "$ROOT"/etc/systemd/system/mason.timer
@@ -56,6 +58,7 @@ cat >>"$ROOT"/etc/httpd.conf <<EOF
.log:text/plain
EOF
+mkdir -p "$ROOT"/var/mason
##########################################################################
# Check variables
@@ -89,7 +92,7 @@ shellescape() {
# Generate config variable shell snippet
##########################################################################
-MASON_CONFIG="$ROOT"/root/mason.conf
+MASON_CONFIG="$ROOT"/etc/mason.conf
echo "Creating $MASON_CONFIG"
cat >>"$MASON_CONFIG" <<EOF
diff --git a/mason/mason-report.sh b/mason/mason-report.sh
index 23182cc..9c20b65 100755
--- a/mason/mason-report.sh
+++ b/mason/mason-report.sh
@@ -2,9 +2,9 @@
set -x
-. /root/mason.conf
+. /etc/mason.conf
-REPORT_PATH=/root/report.html
+REPORT_PATH=/var/mason/report.html
SERVER_PATH=/srv/mason
sed_escape() {
@@ -210,7 +210,7 @@ update_report_time "$START_TIME"
cp "$REPORT_PATH" "$SERVER_PATH/index.html"
logfile="$(mktemp)"
-/root/mason.sh 2>&1 | tee "$logfile"
+/usr/lib/mason/mason.sh 2>&1 | tee "$logfile"
case "${PIPESTATUS[0]}" in
0)
RESULT=pass
diff --git a/mason/mason.service b/mason/mason.service
index 16b5dc3..ab2338c 100644
--- a/mason/mason.service
+++ b/mason/mason.service
@@ -3,7 +3,7 @@ Description=Mason: Continuous Delivery Service
[Service]
User=root
-ExecStart=/root/mason-report.sh
+ExecStart=/usr/lib/mason/mason-report.sh
[Install]
WantedBy=multi-user.target
diff --git a/mason/mason.sh b/mason/mason.sh
index 13ea21d..32aab03 100755
--- a/mason/mason.sh
+++ b/mason/mason.sh
@@ -4,7 +4,7 @@ set -e
set -x
# Load our deployment config
-. /root/mason.conf
+. /etc/mason.conf
if [ ! -e ws ]; then
morph init ws