forked from budtmo/docker-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release_geny.sh
executable file
·48 lines (41 loc) · 959 Bytes
/
release_geny.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
if [ -z "$1" ]; then
read -p "Task (build|push|all) : " TASK
else
TASK=$1
fi
if [ -z "$2" ]; then
read -p "Release version: " RELEASE
else
RELEASE=$2
fi
IMAGE="budtmo/docker-android"
FILE_NAME=docker/Genymotion
image_version="$IMAGE-genymotion:$RELEASE"
image_latest="$IMAGE-genymotion:latest"
function build() {
echo "[BUILD] Image name: $image_version and $image_latest"
echo "[BUILD] Dockerfile: $FILE_NAME"
docker build -t $image_version --build-arg TOKEN=$TOKEN --build-arg APP_RELEASE_VERSION=$RELEASE -f $FILE_NAME .
docker tag $image_version $image_latest
}
function push() {
echo "[PUSH] Image name: $image_version and $image_latest"
docker push $image_version
docker push $image_latest
}
case $TASK in
build)
build
;;
push)
push
;;
all)
build
push
;;
*)
echo "Invalid environment! Valid options: test, build, push, all"
;;
esac