build all ready to be used in a pipeline later

This commit is contained in:
shockrah 2019-09-13 21:58:46 -07:00
parent 29aa8a72bb
commit 99f2489dee

30
make
View File

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
rootDir='./site/' rootDir='./tmp/'
targetDir='post/' targetDir='post/'
if [ -f .creds ] if [ -f .creds ]
then then
@ -9,6 +9,7 @@ fi
# auto tools should be able to fix this # auto tools should be able to fix this
post() { post() {
echo Building: $1
tmp=".swap" tmp=".swap"
full=".fullswap" full=".fullswap"
base=`basename $1` base=`basename $1`
@ -24,11 +25,21 @@ post() {
rm -f $tmp rm -f $tmp
} }
upload() { build_all() {
cd $rootDir mkdir -p $rootDir/post/ $rootDir/fonts/
name=''
# first the root pages cp style.css "$rootDir"
find -type f | xargs 'name=basename %';curl -f "$name=@%" $url cp style.css "$rootDir/$targetDir"
cp fonts/* $rootDir/fonts/
# Try to get xargs to deal with this ugliness
for r in prebuild/*md;do
post $r
done
for p in prebuild/post/*md;do
post $p
done
} }
_help() { _help() {
@ -39,23 +50,22 @@ _help() {
-s copy stylesheets -s copy stylesheets
-l run live server' -l run live server'
} }
server() { server() {
cd $rootDir cd $rootDir
echo 'Address: 0.0.0.0:8080' echo 'Address: 0.0.0.0:8080'
python -m SimpleHTTPServer 8080 python -m SimpleHTTPServer 8080
} }
mkdir -p "$rootDir/post"
if [ -z $1 ] if [ -z $1 ]
then then
_help _help
exit 0 exit 0
fi fi
while getopts ":slrhup:" opt;do while getopts ":aslrhup:" opt;do
case "$opt" in case "$opt" in
a)
build_all;;
s) s)
cp style.css "$rootDir" # root stylesheet cp style.css "$rootDir" # root stylesheet
cp style.css "$rootDir/$targetDir" # post stylesheet cp style.css "$rootDir/$targetDir" # post stylesheet