-
-
Notifications
You must be signed in to change notification settings - Fork 228
/
app.sh
executable file
·48 lines (41 loc) · 864 Bytes
/
app.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
42
43
44
45
46
47
48
#!/bin/bash
IMAGE="appium/appium"
if [ -z "$1" ]; then
read -p "Task (test|build|push) : " TASK
else
TASK=$1
fi
if [ -z "$2" ]; then
read -p "Version : " VER
else
VER=$2
fi
function build() {
echo "Build docker image with version \"${VER}\""
docker build --no-cache -t ${IMAGE}:${VER} -f Appium/Dockerfile Appium
docker images
}
function test() {
echo "Test docker image with version \"${VER}\""
docker run --rm -v $PWD/Appium/tests:/home/androidusr/appium-docker-android/tests ${IMAGE}:${VER} ./appium-docker-android/tests/run-bats.sh
}
function push() {
echo "Push docker image with version \"${VER}\""
docker push ${IMAGE}:${VER}
docker tag ${IMAGE}:${VER} ${IMAGE}:latest
docker push ${IMAGE}:latest
}
case $TASK in
build)
build
;;
test)
test
;;
push)
push
;;
*)
echo "Invalid environment! Valid options: test, build, push"
;;
esac