forked from express42/otus-platform-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
local-run.sh
executable file
·38 lines (28 loc) · 939 Bytes
/
local-run.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
#!/bin/bash
echo "Howdy! I will run [otus-platform-tests] locally for you."
echo
platformdir=""
hwdir=""
if [[ ! -d $1 || "$2" == "" ]]; then
echo "You'll supposed to point me in, I'll need to know where to start."
read -p "Your local platform folder (something like $HOME/src/{gitname}_platform):" platformdir
if [ ! -d "$platformdir" ]; then
echo "Does not look like a valid folder. You can do better!"
exit 1
fi
read -p "Homework dir you want me to check (kubernetes-intro or others):" hwdir
if [ "$hwdir" == "" ]; then
echo "No in - no out! Point me somewhere to do the job."
exit 1
fi
else
platformdir="$1"
hwdir="$2"
fi
printf "\nYou pointed me here [%s] to check [%s]. I will obey! \n" "$platformdir" "$hwdir"
echo
pathtorunsh="$PWD/run.sh"
cd "$platformdir" || exit 1
TRAVIS_BRANCH=$(echo "$hwdir" | tr -d '\r')
export TRAVIS_BRANCH
bash "$pathtorunsh"