Skip to content
This repository has been archived by the owner on Aug 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #319 from zongzw/build-dist
Browse files Browse the repository at this point in the history
Add build process for the release files.
  • Loading branch information
zongzw authored Nov 21, 2019
2 parents 45a979a + d6d8703 commit 186bf39
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
3 changes: 0 additions & 3 deletions data/.gitignore

This file was deleted.

42 changes: 42 additions & 0 deletions scripts/build_dist.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash

cdir=`cd $(dirname $0); pwd`

target=$cdir/../dist

mkdir -p $target
rm -rf $target/*

for n in scripts deploy data dependencies; do
mkdir -p $target/$n
done

for n in download_do.sh download_as3.sh generate_certs.sh start_all.sh download_asg_dependencies.sh; do
cp $cdir/$n $target/scripts
done

for n in appcluster.rc docker-compose.yml docker-compose-efk.yml kibana.yml fluentd.conf unset-wafaas-environs.rc docker; do
cp -r $cdir/../deploy/$n $target/deploy
done

cp -r $cdir/../data/* $target/data
for n in `ls $cdir/../data`; do
(
cd $target/data/$n
if [ ! -f .gitignore ]; then exit; fi
echo >> .gitignore
cat .gitignore | while read line; do
if [ -z "$line" ]; then continue; fi;
rm -rf $line
done
rm -f .gitignore
)
done

cp -r $cdir/../dependencies/* $target/dependencies

(
cd $target
which tree > /dev/null
if [ $? -eq 0 ]; then tree .; else find .; fi
)
3 changes: 2 additions & 1 deletion scripts/download_as3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ cdir=`cd $(dirname $0); pwd`
(
cd $cdir/../dependencies
if [ ! -f `basename $as3file` ]; then
wget $as3file
wget -nv $as3file # $as3file.sha256
#sha256sum -c $as3file.sha256
fi
)

3 changes: 2 additions & 1 deletion scripts/download_asg_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ mkdir -p $cdir/../dependencies/ASGExtensions
for n in $filelist; do
filebase=`basename $n`
if [ ! -f $filebase ]; then
wget $n
wget -nv $n # $n.sha256
#sha256sum -c $n.sha256
fi
done
)
3 changes: 2 additions & 1 deletion scripts/download_do.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ cdir=`cd $(dirname $0); pwd`
(
cd $cdir/../dependencies
if [ ! -f `basename $dofile` ]; then
wget $dofile
wget -nv $dofile # $dofile.sha256
#sha256sum -c $dofile.sha256
fi
)

22 changes: 22 additions & 0 deletions scripts/start_all.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
#!/bin/bash

function check() {
echo Checking running dependencies...

ready=1
for n in wget docker docker-compose; do
which $n > /dev/null 2>&1
if [ $? -ne 0 ]; then
ready=0
echo $n not installed.
fi
done
if [ $ready -ne 1 ]; then exit 1; fi

docker ps > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "docker damon is not running."
exit 1
fi
}

check

cdir=`cd $(dirname $0); pwd`
(
set -e
Expand Down

0 comments on commit 186bf39

Please sign in to comment.