-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·45 lines (39 loc) · 1.28 KB
/
deploy.sh
File metadata and controls
executable file
·45 lines (39 loc) · 1.28 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/sh
if [ $# -ne 0 ]; then
echo "Usage: $0 <noargs>"
exit 1
fi
PROGRAM=$(basename $(pwd))
WD=$(pwd)
#echo "delete binaries"
#find . -type f -perm /u=x,g=x,o=x | grep -v ".sh | xargs rm
find . -name "*.sh" | xargs chmod 744
find . -name "*.txt" | xargs chmod 644
find . -name "*.md" | xargs chmod 644
NORMALIZE_MD5_SRC=$(md5sum copy_programs_here.sh | awk '{print $1;}')
RUNALL_MD5_SRC=$(md5sum run_all_master.sh | awk '{print $1;}')
echo ${NORMALIZE_MD5_SRC}
for ELEMENT in $(find . -mindepth 1 -maxdepth 1 -type d -print | sort); do
echo "${ELEMENT}"
NORMALIZE_MD5_DEST=$(md5sum ${ELEMENT}/copy_programs_here.sh | awk '{print $1;}')
RUNALL_MD5_DEST=$(md5sum ${ELEMENT}/run_all.sh | awk '{print $1;}')
if [ "$NORMALIZE_MD5_SRC" = "$NORMALIZE_MD5_DEST" ]; then
echo "no action required for copy_programs_here.sh"
else
echo "copying copy_programs_here.sh ..."
cp copy_programs_here.sh ${ELEMENT}/copy_programs_here.sh
git add ${ELEMENT}/copy_programs_here.sh
fi
if [ "$RUNALL_MD5_SRC" = "$RUNALL_MD5_DEST" ]; then
echo "no action for run_all.sh"
else
echo "copying run_all.sh ..."
cp run_all_master.sh ${ELEMENT}/run_all.sh
git add ${ELEMENT}/run_all.sh
fi
cd "${ELEMENT}"
echo $(pwd)
sh ./copy_programs_here.sh
cd "$WD"
done
exit 0