aboutsummaryrefslogtreecommitdiff
path: root/scripts/auto-build/prep-auto-build-upload
blob: 3757d65c4b9488e96d59c97f0da0e082b0c5d65f (plain)
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
#!/bin/sh

# prepare a directory per date for the auto-builders to upload to

SYSTEM=`uname -s`
DATE=`date +%Y-%m-%d`
TIME=`date +%H.%M.%S`
SCRIPT=`echo $0| sed 's|.*/\(.*\)|\1|g'`
LOGFILE=/tmp/${DATE}_${TIME}_-_${SCRIPT}_-_${SYSTEM}.txt

BUILD_ROOT=/home/apt/www/auto-build
TODAYS_ROOT="${BUILD_ROOT}/${DATE}"

chmod u+w "$BUILD_ROOT"                   >> $LOGFILE 2>&1
mkdir "${TODAYS_ROOT}"                    >> $LOGFILE 2>&1
mkdir "${TODAYS_ROOT}/logs"               >> $LOGFILE 2>&1
chmod -R a+r "${BUILD_ROOT}"              >> $LOGFILE 2>&1
chmod -R a-w "${BUILD_ROOT}"              >> $LOGFILE 2>&1
chmod 0755 "${TODAYS_ROOT}"               >> $LOGFILE 2>&1
chmod 0755 "${TODAYS_ROOT}/logs"          >> $LOGFILE 2>&1
chmod a-w "$BUILD_ROOT"                   >> $LOGFILE 2>&1
chmod u+w "$BUILD_ROOT/latest"            >> $LOGFILE 2>&1

if [ -d $TODAYS_ROOT/logs ]; then
	mv $LOGFILE $TODAYS_ROOT/logs/
fi