-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathbuild.sh
executable file
·26 lines (20 loc) · 960 Bytes
/
build.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
#!/bin/bash
docker build -t kamailio-docker:latest .
KAM_TMP=$(docker run --rm --entrypoint="" -it kamailio-docker:latest /usr/sbin/kamailio -V | tr " " "\n")
X=($(echo $KAM_TMP | tr " " "\n"))
KAM_VER=${X[2]}
KAM_A=(${KAM_VER//./ })
docker tag kamailio-docker:latest readytalk/kamailio-docker:${KAM_VER}
docker tag kamailio-docker:latest readytalk/kamailio-docker:${KAM_A[0]}.${KAM_A[1]}
docker tag kamailio-docker:latest readytalk/kamailio-docker:latest
echo "-----------------------"
echo "Saved Tag \"kamailio-docker:${KAM_VER}\""
echo "Saved Tag \"kamailio-docker:${KAM_A[0]}.${KAM_A[1]}\""
echo "Saved Tag \"kamailio-docker:latest\""
echo "-----------------------"
if [[ ${TRAVIS} && "${TRAVIS_BRANCH}" == "master" ]]; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
docker push readytalk/kamailio-docker:${KAM_VER}
docker push readytalk/kamailio-docker:${KAM_A[0]}.${KAM_A[1]}
docker push readytalk/kamailio-docker:latest
fi