-
Notifications
You must be signed in to change notification settings - Fork 2
/
runner.sh
executable file
·41 lines (38 loc) · 1.18 KB
/
runner.sh
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
#!/bin/bash
if [ -z "${2}" ]; then
MESSAGE="Update by $(git config --get user.name)"
else
MESSAGE=${2}
fi
while getopts "cuh" options; do
case ${options} in
h )
echo "Usage: [-h] [-c|-u] value]"
echo "c Start a development environment for writing documentation"
echo "u Update and push new code to github in dev branch. Please create a PR to upstream to main branch"
exit
;;
c )
echo " Creating the docker container for development"
git pull origin dev
git checkout dev
if [ "$(docker ps -aq -f 'name=ksl-docs')" != "" ]; then
docker stop ksl-docs
docker rm ksl-docs
fi
docker pull krccl/ksl-docs:latest
docker run --rm -ti --name ksl-docs -v ${PWD}:/workdir -w /workdir/docs krccl/ksl-docs:latest
;;
u )
echo "commiting and pushing codebase to GitHub in dev branch. Once done, please create a pull request on GitHub to upstream your changes to main branch"
git checkout dev
git add docs/source/*
git commit -m "${MESSAGE}"
git push -u origin dev
;;
\? ) echo "Usage: cmd [-h] [-v] [-b] [-p] [-m] [-t]"
exit
;;
esac
done
shift $((OPTIND -1))