pkg/kamailio/alpine_docker: Allow build docker image from forked repos
authorSergey Safarov <s.safarov@gmail.com>
Sat, 30 Sep 2017 19:14:52 +0000 (15:14 -0400)
committerSergey Safarov <s.safarov@gmail.com>
Sat, 30 Sep 2017 20:41:25 +0000 (16:41 -0400)
pkg/kamailio/alpine_docker/build.sh

index fad1cd1..71cf1e1 100755 (executable)
@@ -22,6 +22,11 @@ apk add --no-cache abuild git gcc build-base bison db-dev flex expat-dev perl-de
 }
 
 build_and_install(){
+    cd /usr/src/kamailio
+    REPO_OWNER=$(git remote get-url origin 2> /dev/null | sed -e 's:^.*github.com/::' -e 's:/.*\.git::')
+    if [ ! -z "$REPO_OWNER" ]; then
+        sed -i -e "s:github.com/kamailio:github.com/$REPO_OWNER:" /usr/src/kamailio/pkg/kamailio/alpine/APKBUILD
+    fi
     if [ ! -z "$GIT_TAG" ]; then
         sed -i -e "s/^_gitcommit=.*/_gitcommit=$GIT_TAG/" /usr/src/kamailio/pkg/kamailio/alpine/APKBUILD
     fi