50 lines
997 B
Bash
50 lines
997 B
Bash
#!/bin/bash
|
|
|
|
SDK="spark_sdk"
|
|
STAGE="/tmp/bts_staging"
|
|
SRC=$1
|
|
GH=$2
|
|
TG=$3
|
|
OPP=$4
|
|
|
|
if [ "$#" -lt 3 ]; then
|
|
echo "update_github.sh <source> <https://github.com/your_repo/$SDK.git> <tag> [-push_params]"
|
|
echo "set tag to 'stage' if you don't want to push"
|
|
exit 0
|
|
fi
|
|
|
|
if [ "$TG" == "stage" ]; then echo "STAGE ONLY"; fi
|
|
|
|
git lfs install
|
|
|
|
if [ -d "$STAGE" ]; then
|
|
rm -rf $STAGE
|
|
fi
|
|
mkdir $STAGE
|
|
|
|
git clone --recurse-submodules "$GH" $STAGE/$SDK
|
|
rm -rf $STAGE/$SDK/*
|
|
cp -L -r -f "$SRC"/** $STAGE/$SDK/
|
|
pushd $STAGE/$SDK
|
|
|
|
#clean all the stuff we don't want in github
|
|
rm ./examples/md_publisher_example
|
|
rm ./examples/order_plugin_example.so
|
|
rm ./lib/data_files/cert_secure_logon.txt
|
|
rm -r ./externals/lib/libonixs*
|
|
rm -r ./externals/include/OnixS/
|
|
rm -r ./externals/lib/celoxica/
|
|
rm -r ./externals/include/celoxica/
|
|
|
|
if [ "$TG" != "stage" ]; then
|
|
git status
|
|
git add .
|
|
git commit -m "$SDK update $TG"
|
|
git tag "$TG"
|
|
git push origin master --tags $OPP
|
|
|
|
popd
|
|
rm -rf $STAGE
|
|
fi
|
|
|