Last active
February 8, 2018 08:06
-
-
Save dan82840/140a042454936cb8094f13da4f2649a9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
REPO_URL=$1 | |
CNAME=$2 | |
PNAME=$3 | |
LATES_TAG= | |
[ "REPO_URL" == "" ] && { | |
echo "Need repository URL in 1st parameter !!!" | |
exit 1 | |
} | |
[ "CNAME" == "" ] && { | |
echo "Need container name in 2nd parameter !!!" | |
exit 1 | |
} | |
[ "PNAME" == "" ] && { | |
echo "Need project name in 3rd parameter !!!" | |
exit 1 | |
} | |
docker_exec_cmd() { | |
local ret | |
docker exec $CNAME su - builder -c "$1" | |
ret=$? | |
if [ $ret -ne 0 ]; then | |
exit $ret | |
fi | |
} | |
main() { | |
rm -rf release/ | |
git clone $REPO_URL _sdk | |
cd _sdk | |
LATES_TAG=$(git for-each-ref --sort=taggerdate --format '%(tag)' refs/tags | tail -n 1) | |
git checkout $LATES_TAG | |
cd .. | |
mkdir -p release/$LATES_TAG | |
mv _sdk release/$LATES_TAG/sdk | |
docker_exec_cmd "cd /opt/src/release/$LATES_TAG/sdk && ./odk/release/$PNAME/AutoBuildSystem/abs-full-compile-upload-release.sh" | |
} | |
main | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment