-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakeCodeDoc.sh
More file actions
68 lines (67 loc) · 2.24 KB
/
Copy pathmakeCodeDoc.sh
File metadata and controls
68 lines (67 loc) · 2.24 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
if [ -e config.conf ]; then
# Convert the file into an array of strings
lines=(`cat "config_sample.conf"`)
# Assign lines via array index to userdefine veriables
username=${lines[0]}
password=${lines[1]}
jsdocContainerName=${lines[3]}$(date "+%Y.%m.%d-%H.%M.%S")
directoryToCloneRepo=${lines[5]}
sourceRepoBranch=${lines[6]}
sourceRepo=${lines[7]}
repoUrl=${lines[8]}
echo $directoryToCloneRepo
else
echo "config_sample.conf file doesn't exit.."
fi
#Prepare file structure
rm -rf $directoryToCloneRepo
mkdir $directoryToCloneRepo
cd $directoryToCloneRepo || { printf "cd failed, exiting\n" >&2; return 1; }
#Pull source code to document
echo "Starting to clone.."
git clone -b $sourceRepoBranch https://$username:$password@$repoUrl/$sourceRepo
echo "Sucessfully clone.."
sleep 2.0
#Begin PHP Docs
echo "Generating documention.."
docker run --rm -v ${PWD}:/data phpdoc/phpdoc:3 run --force -i ./$sourceRepo/vendor -t phpout --sourcecode
echo "Sucessfully generated the php document"
sleep 1.5
#Begin JS Docs
docker run -it -d --name=$jsdocContainerName -v ${PWD}/:/data cm0x4d/jsdoc
docker exec -it $jsdocContainerName sh data/$sourceRepo/makejs.sh
echo "Sucessfully generated the js document"
#Begin Documentation repo updates
git clone -b master https://$repoUrl/phpdocs
cp -r phpout/* phpdocs/
sleep 1.5
cd phpdocs
git add .
git commit -m "phpdoc project$(date "+%Y.%m.%d-%H.%M.%S")"
sleep 1.5
git pull --rebase origin master
sleep 1.5
git push -f origin master
sleep 1.5
echo "Pushed php web pages documention to phpdocs repo.."
cd ../
git clone -b master https://$repoUrl/jsdocs
cp out/*.* jsdocs/
cd jsdocs
git add .
git commit -m "jsdocs project$(date "+%Y.%m.%d-%H.%M.%S")"
sleep 1.5
git pull --rebase origin master
sleep 1.5
git push -f origin master
sleep 1.5
echo "Pushed php web pages documention to jsdocs repo.."
sleep 1.5
docker stop $jsdocContainerName
sleep 1.5
docker rm -v $jsdocContainerName
echo "End of execution"
echo ${PWD}
cd ../
cd phpout
docker run -d -p 591:80 -v ${PWD}:/var/www/html bitbull/webserver