diff --git a/evt-tools.py b/evt-tools.py index 2f5b002..7087c65 100644 --- a/evt-tools.py +++ b/evt-tools.py @@ -5,6 +5,8 @@ from scripts.Link import Link import subprocess import os +SH = "ev-tools.sh" + class EvtTools: def __init__(self): @@ -59,81 +61,81 @@ class EvtTools: def clean(self): if self.check_for_link(): - subprocess.run(["ev-tools.sh clean"], shell=True) + subprocess.run([SH + " clean"], shell=True) def build_tools(self): if self.check_for_link(): - subprocess.run(["ev-tools.sh deps"], shell=True) + subprocess.run([SH + " deps"], shell=True) def pull_src(self): if self.check_for_link(): - subprocess.run(["ev-tools.sh src"], shell=True) + subprocess.run([SH + " src"], shell=True) def tincan(self): if self.check_for_link(): - subprocess.run(["ev-tools.sh tincan"], shell=True) + subprocess.run([SH + " tincan"], shell=True) def debpak(self): if self.check_for_link(): - subprocess.run(["ev-tools.sh debpak"], shell=True) + subprocess.run([SH + " debpak"], shell=True) def testbed(self): if self.check_for_link(): - subprocess.run(["ev-tools.sh testbed"], shell=True) + subprocess.run([SH + " testbed"], shell=True) def venv(self): if self.check_for_link(): - subprocess.run(["ev-tools.sh venv"], shell=True) + subprocess.run([SH + " venv"], shell=True) def xmpp(self): if self.check_for_link(): - subprocess.run(["ev-tools.sh xmpp"], shell=True) + subprocess.run([SH + " xmpp"], shell=True) def build_docker(self): if self.check_for_link(): - subprocess.run(["ev-tools.sh dkrimg"], shell=True) + subprocess.run([SH + " dkrimg"], shell=True) def build_webrtc(self): if self.check_for_link(): - subprocess.run(["ev-tools.sh build_webrtc"], shell=True) + subprocess.run([(SH + " build_webrtc")], shell=True) def build_webrtc_release_ubuntu(self): if self.check_for_link(): - subprocess.run(["ev-tools.sh build_webrtc_with_release_ubuntu"], shell=True) + subprocess.run([SH + " build_webrtc_with_release_ubuntu"], shell=True) def build_webrtc_debug_raspberry(self): if self.check_for_link(): - subprocess.run(["ev-tools.sh build_webrtc_with_debug_raspberry_pi"], shell=True) + subprocess.run([SH + " build_webrtc_with_debug_raspberry_pi"], shell=True) def build_webrtc_release_raspberry(self): if self.check_for_link(): - subprocess.run(["ev-tools.sh build_webrtc_with_release_raspberry_pi"], shell=True) + subprocess.run([SH + " build_webrtc_with_release_raspberry_pi"], shell=True) def build_tincan(self): if self.check_for_link(): - subprocess.run(["ev-tools.sh build_tincan"], shell=True) + subprocess.run([SH + " build_tincan"], shell=True) def build_tincan_release_ubuntu(self): if self.check_for_link(): - subprocess.run(["ev-tools.sh build_tincan_release_ubuntu"], shell=True) + subprocess.run([SH + " build_tincan_release_ubuntu"], shell=True) def build_tincan_debug_raspberry(self): if self.check_for_link(): - subprocess.run(["ev-tools.sh build_tincan_debug_raspberry"], shell=True) + subprocess.run([SH + " build_tincan_debug_raspberry"], shell=True) def build_tincan_release_raspberry(self): if self.check_for_link(): - subprocess.run(["ev-tools.sh build_tincan_release_raspberry"], shell=True) + subprocess.run([SH + " build_tincan_release_raspberry"], shell=True) def check_for_link(self): - if os.path.isfile("ev-tools.sh"): + if os.path.isfile(SH): return True else: print("Please run evt --sync and then retry the command.") def all(self): if self.check_for_link(): - subprocess.run(["ev-tools.sh all"], shell=True) + subprocess.run([SH + " all"], shell=True) def main(): tools = EvtTools() @@ -147,7 +149,7 @@ def main(): return if tools.args.tincan: - tools.tincan() + tools.build_tincan() return if tools.args.debpak: @@ -186,10 +188,6 @@ def main(): tools.build_webrtc_release_raspberry() return - if tools.args.tincan: - tools.build_tincan() - return - if tools.args.tincan_r: tools.build_tincan_release_ubuntu() return diff --git a/scripts/Link.py b/scripts/Link.py index d93ab6b..d0b96eb 100644 --- a/scripts/Link.py +++ b/scripts/Link.py @@ -53,25 +53,30 @@ class Link: """ Get the active branch name of the Evio and Tools repo. """ - present_dir = os.getcwd()[0:3] - for root, subdirs, files in os.walk(present_dir): - for d in subdirs: - if d == "evio": - self.dir_path = os.path.join(root, d) + # present_dir = os.getcwd()[0:3] + # for root, subdirs, files in os.walk(present_dir): + # for d in subdirs: + # if d == "evio": + # self.dir_path = os.path.join(root, d) + pwd = os.getcwd()[0:] + os.chdir(os.getenv("HOME") + "/workspace/EdgeVPNio") + if path.exists("evio"): + self.dir_path = os.getcwd()[0:] + else: + self.dir_path = os.getcwd()[0:] + git.Git(self.dir_path).clone("https://github.com/EdgeVPNio/evio.git") - self.evio_repo = git.Repo(self.dir_path) + self.evio_repo = git.Repo(str(self.dir_path) + "/evio") #print("Evio Branch name:" + str(self.evio_repo.active_branch)) - for root, subdirs, files in os.walk(present_dir): - for d in subdirs: - if d == "tools": - self.dir_path_tools = os.path.join(root, d) + self.dir_path_tools = "~/workspace/EdgeVPNio/tools" self.tools_repo = git.Repo(self.dir_path_tools) #print("Tools Branch name:" + str(self.tools_repo.active_branch)) + os.chdir(str(pwd)) def main(self): self.sync("20.7.2") - if __name__ == "__main__": link = Link() link.main() + diff --git a/scripts/evtool-v20.7.2 b/scripts/evtool-v20.7.2 index 9b9abc6..f65cf26 100755 --- a/scripts/evtool-v20.7.2 +++ b/scripts/evtool-v20.7.2 @@ -3,6 +3,12 @@ EVIO=https://github.com/EdgeVPNio/evio.git EXLIBS=https://github.com/ipop-project/3rd-Party-Libs.git PY=python3.8 +WorkspaceRoot=~/workspace +EdgeVPNIO=EdgeVPNio +Build_WRTC=./$EdgeVPNIO/tools/scripts/build_webrtc.sh +Get_Archives=./$EdgeVPNIO/tools/scripts/get_archives.sh +Get_Include=./$EdgeVPNIO/tools/scripts/get_include.sh +Build_Tincan=./$EdgeVPNIO/tools/scripts/build_tincan.sh function install_build_tools { @@ -27,23 +33,23 @@ function pull_src function make_debpak { wd=$(pwd) - cd ../../.. + cd ~/workspace mkdir -p out - cd $wd - cp ../debian-package ../../../out - cp ../evio/controller/Controller.py ../../../out/debian-package/edge-vpnio/opt/edge-vpnio/ && \ - mkdir -p ../../../out/debian-package/edge-vpnio/etc/opt/edge-vpnio/ - cp ../evio/controller/template-config.json ../../../out/debian-package/edge-vpnio/etc/opt/edge-vpnio/config.json && \ - cp -r ../evio/controller/modules/ ../evio/controller/framework/ ../../../out/debian-package/edge-vpnio/opt/edge-vpnio/ && \ - chmod 0775 ../../../out/debian-package/edge-vpnio/opt/edge-vpnio/framework/ && \ - chmod 0664 ../../../out/debian-package/edge-vpnio/opt/edge-vpnio/framework/* && \ - chmod 0775 ../../../out/debian-package/edge-vpnio/opt/edge-vpnio/modules/ && \ - chmod 0664 ../../../out/debian-package/edge-vpnio/opt/edge-vpnio/modules/* && \ - chmod 0664 ../../../out/debian-package/edge-vpnio/opt/edge-vpnio/Controller.py && \ - chmod 0664 ../../../out/debian-package/edge-vpnio/etc/opt/edge-vpnio/config.json && \ - cp ../evio/tincan/trunk/out/release/x86_64/tincan ../../../out/debian-package/edge-vpnio/opt/edge-vpnio/ && \ - chmod 0775 ../../../out/debian-package/edge-vpnio/opt/edge-vpnio/tincan && \ - cd ../../../out/debian-package/ && \ + cd ~/workspace/$EdgeVPNIO/tools + cp ./debian-package ../../out + cp ../evio/controller/Controller.py ../../out/debian-package/edge-vpnio/opt/edge-vpnio/ && \ + mkdir -p ../../out/debian-package/edge-vpnio/etc/opt/edge-vpnio/ + cp ../evio/controller/template-config.json ../../out/debian-package/edge-vpnio/etc/opt/edge-vpnio/config.json && \ + cp -r ../evio/controller/modules/ ../evio/controller/framework/ ../../out/debian-package/edge-vpnio/opt/edge-vpnio/ && \ + chmod 0775 ../../out/debian-package/edge-vpnio/opt/edge-vpnio/framework/ && \ + chmod 0664 ../../out/debian-package/edge-vpnio/opt/edge-vpnio/framework/* && \ + chmod 0775 ../../out/debian-package/edge-vpnio/opt/edge-vpnio/modules/ && \ + chmod 0664 ../../out/debian-package/edge-vpnio/opt/edge-vpnio/modules/* && \ + chmod 0664 ../../out/debian-package/edge-vpnio/opt/edge-vpnio/Controller.py && \ + chmod 0664 ../../out/debian-package/edge-vpnio/etc/opt/edge-vpnio/config.json && \ + cp ../evio/tincan/trunk/out/release/x86_64/tincan ../../out/debian-package/edge-vpnio/opt/edge-vpnio/ && \ + chmod 0775 ../../out/debian-package/edge-vpnio/opt/edge-vpnio/tincan && \ + cd ../../out/debian-package/ && \ ./deb-gen && \ rm -rf edge-vpnio/opt/edge-vpnio/framework \ edge-vpnio/opt/edge-vpnio/modules \ @@ -89,9 +95,11 @@ function make_venv function make_dkrimg { - mv debian-package/edge-vpnio_20.7_amd64.deb docker-image/ && \ - docker build -f ./../docker-image/evio-base.Dockerfile -t edgevpnio/evio-base:1.0 ./docker-image && \ - docker build -f ./../docker-image/evio-node.Dockerfile -t edgevpnio/evio-node:20.7.3 ./docker-image + mkdir -p ~/workspace/out/docker-image + cd ~/workspace/$EdgeVPNIO/tools + mv ../../out/debian-package/edge-vpnio_20.7_amd64.deb docker-image/ && \ + docker build -f ./docker-image/evio-base.Dockerfile -t edgevpnio/evio-base:1.0 ../../out/docker-image && \ + docker build -f ./docker-image/evio-node.Dockerfile -t edgevpnio/evio-node:20.7.3 ../../out/docker-image } @@ -120,100 +128,50 @@ function do_clean # tincan wd=$(pwd) - cd ../../evio/tincan/trunk/build + cd ~/workspace/$EdgeVPNIO/evio/tincan/trunk/build make clean; - cd $wd + cd ~/workspace/out/ #debian pak - cd ../debian-package/ && \ + cd ./debian-package/ && \ rm -ri ./edge-vpnio_20.7_amd64.deb \ edge-vpnio/opt/edge-vpnio/framework \ edge-vpnio/opt/edge-vpnio/modules \ edge-vpnio/opt/edge-vpnio/tincan \ edge-vpnio/opt/edge-vpnio/template-config.json \ - edge-vpnio/opt/edge-vpnio/Controller.py && \ - cd $wd + edge-vpnio/opt/edge-vpnio/Controller.py # docker-image + cd .. rm -f docker-image/edge-vpnio_20.7_amd64.deb docker rmi edgevpnio/evio-base:1.0 edgevpnio/evio-node:20.7 docker rmi $(docker images -q --filter "dangling=true") # testbed - cd ../testbed + cd ~/workspace/$EdgeVPNIO/tools/testbed rm -rf config log cert venv cd $wd } -function build_webrtc +function build_webrtc() { wd=$(pwd) - cd scripts - chmod +x build_webrtc.sh get_archives.sh get_include.sh - ./build_webrtc.sh -b debug -t ubuntu - ./get_archives.sh -b debug -t ubuntu - ./get_include.sh -b debug -t ubuntu -} - -function build_webrtc_with_release_ubuntu -{ - wd=$(pwd) - cd scripts - chmod +x build_webrtc.sh get_archives.sh get_include.sh - ./build_webrtc.sh -b release -t ubuntu - ./get_archives.sh -b release -t ubuntu - ./get_include.sh -b release -t ubuntu + cd $WorkspaceRoot + chmod +x $Build_WRTC $Get_Archives $Get_Include + $Build_WRTC -b "$1" -t "$2" + if [ $? -eq '0' ]; then + cd $WorkspaceRoot + $Get_Archives -b "$1" -t "$2" + if [ $? -eq '0' ]; then + cd $WorkspaceRoot + $Get_Include + fi + fi cd $wd } -function build_webrtc_with_debug_raspberry_pi -{ +function build_tincan() { wd=$(pwd) - cd scripts - chmod +x build_webrtc.sh get_archives.sh get_include.sh - ./build_webrtc.sh -b debug -t raspberry-pi - ./get_archives.sh -b debug -t raspberry-pi - ./get_include.sh -b debug -t raspberry-pi - cd $wd -} - -function build_webrtc_with_release_raspberry_pi -{ - wd=$(pwd) - cd scripts - chmod +x build_webrtc.sh get_archives.sh get_include.sh - ./build_webrtc.sh -b release -t raspberry-pi - ./get_archives.sh -b release -t raspberry-pi - ./get_include.sh -b release -t raspberry-pi - cd $wd -} - -function build_tincan { - wd=$(pwd) - cd scripts - chmod +x ./build_tincan.sh - ./build_tincan.sh -b debug -t ubuntu - cd $wd -} - -function build_tincan_release_ubuntu { - wd=$(pwd) - cd scripts - chmod +x ./build_tincan.sh - ./build_tincan.sh -b release -t ubuntu - cd $wd -} - -function build_tincan_debug_raspberry { - wd=$(pwd) - cd scripts - chmod +x ./build_tincan.sh - ./build_tincan.sh -b debug -t raspberry-pi - cd $wd -} - -function build_tincan_release_raspberry { - wd=$(pwd) - cd scripts - chmod +x ./build_tincan.sh - ./build_tincan.sh -b debug -t raspberry-pi + cd $WorkspaceRoot + chmod +x $Build_Tincan + $Build_Tincan -b "$1" -t "$2" cd $wd } @@ -255,28 +213,28 @@ case $1 in do_clean ;; build_webrtc) - build_webrtc + build_webrtc debug ubuntu ;; build_webrtc_with_release_ubuntu) - build_webrtc_with_release_ubuntu + build_webrtc release ubuntu ;; build_webrtc_with_debug_raspberry_pi) - build_webrtc_with_debug_raspberry_pi + build_webrtc debug raspberry-pi ;; build_webrtc_with_release_raspberry_pi) - build_webrtc_with_release_raspberry_pi + build_webrtc release raspberry-pi ;; build_tincan) - build_tincan + build_tincan debug ubuntu ;; build_tincan_release_ubuntu) - build_tincan_release_ubuntu + build_tincan release ubuntu ;; build_tincan_debug_raspberry) - build_tincan_debug_raspberry + build_tincan debug raspberry-pi ;; build_tincan_release_raspberry) - build_tincan_release_raspberry + build_tincan release raspberry-pi ;; all) do_full_setup diff --git a/scripts/get_include.sh b/scripts/get_include.sh index 6c706e5..3d22b03 100755 --- a/scripts/get_include.sh +++ b/scripts/get_include.sh @@ -32,6 +32,7 @@ copyHeaders webrtc-checkout/src/third_party/jsoncpp/source/include/json out/incl copyHeaders webrtc-checkout/src/third_party/jsoncpp/generated/version.h out/include/json copyHeaders webrtc-checkout/src/common_types.h out/include/webrtc copyHeaders webrtc-checkout/src/third_party/ffmpeg/libavcodec/jni.h out/include/webrtc + #files other than *.h mkdir -p out/include/libc++ mkdir -p out/include/libc++abi