From 78c87060d074e6aa0e272f7a064bf2a71c6e198c Mon Sep 17 00:00:00 2001 From: xnacly Date: Tue, 20 Jul 2021 11:37:29 +0200 Subject: [PATCH] updated the setup script - now allows for easier addition of new repos via a python script - split setup.sh to setup.py & clone_all_repos.sh to make dynamic addition of all repos with the github api easier - vscode workspace now gets generated from all repos in the orga --- scripts/setup/clone_all_repos.sh | 22 +++++++ scripts/setup/fosscord.code-workspace | 93 +++++++-------------------- scripts/setup/fosscord.txt | 16 ++--- scripts/setup/generate.py | 22 +++++++ scripts/setup/setup.sh | 23 ++----- 5 files changed, 78 insertions(+), 98 deletions(-) create mode 100644 scripts/setup/clone_all_repos.sh create mode 100644 scripts/setup/generate.py diff --git a/scripts/setup/clone_all_repos.sh b/scripts/setup/clone_all_repos.sh new file mode 100644 index 0000000..23022ff --- /dev/null +++ b/scripts/setup/clone_all_repos.sh @@ -0,0 +1,22 @@ +git clone git://github.com/fosscord/css-mediaquery.git css-mediaquery +git clone git://github.com/fosscord/docker.git docker +git clone git://github.com/fosscord/fosscord.git fosscord +git clone git://github.com/fosscord/fosscord-api.git api +git clone git://github.com/fosscord/fosscord-cdn.git cdn +git clone git://github.com/fosscord/fosscord-client.git client +git clone git://github.com/fosscord/fosscord-client-native.git client-native +git clone git://github.com/fosscord/fosscord-dashboard.git dashboard +git clone git://github.com/fosscord/fosscord-docs.git docs +git clone git://github.com/fosscord/fosscord-gateway.git gateway +git clone git://github.com/fosscord/fosscord-landingpage.git landingpage +git clone git://github.com/fosscord/fosscord-plugins.git plugins +git clone git://github.com/fosscord/fosscord-rtc.git rtc +git clone git://github.com/fosscord/fosscord-server.git server +git clone git://github.com/fosscord/fosscord-server-util.git server-util +git clone git://github.com/fosscord/fosscord-support.git support +git clone git://github.com/fosscord/fosscord-themes.git themes +git clone git://github.com/fosscord/fosscord-ui.git ui +git clone git://github.com/fosscord/fosscord-voice-gateway.git voice-gateway +git clone git://github.com/fosscord/fosscord-webrtc-server.git webrtc-server +git clone git://github.com/fosscord/fosscord.js.git fosscord.js +git clone git://github.com/fosscord/react-native-withcss.git react-native-withcss diff --git a/scripts/setup/fosscord.code-workspace b/scripts/setup/fosscord.code-workspace index 1dadaa2..cb2f964 100644 --- a/scripts/setup/fosscord.code-workspace +++ b/scripts/setup/fosscord.code-workspace @@ -1,73 +1,26 @@ { "folders": [ - { - "path": "." - }, - { - "path": "./assets" - }, - { - "path": "./cdn" - }, - { - "path": "./client" - }, - { - "path": "./client-native" - }, - { - "path": "./docs" - }, - { - "path": "./dashboard" - }, - { - "path": "./gateway" - }, - { - "path": "./fosscord.js" - }, - { - "path": "./api" - }, - { - "path": "./rtc" - }, - { - "path": "./rtc-js" - }, - { - "path": "./voice-gateway" - }, - { - "path": "./landingpage" - }, - { - "path": "./media" - }, - { - "path": "./plugins" - }, - { - "path": "./rpc" - }, - { - "path": "./scripts" - }, - { - "path": "./server-util" - }, - { - "path": "./support" - }, - { - "path": "./themes" - }, - { - "path": "./ui" - } - ], - "settings": { - "liveServer.settings.multiRootWorkspaceName": "fosscord" - } + { "path": "css-mediaquery" }, + { "path": "docker" }, + { "path": "fosscord" }, + { "path": "api" }, + { "path": "cdn" }, + { "path": "client" }, + { "path": "client-native" }, + { "path": "dashboard" }, + { "path": "docs" }, + { "path": "gateway" }, + { "path": "landingpage" }, + { "path": "plugins" }, + { "path": "rtc" }, + { "path": "server" }, + { "path": "server-util" }, + { "path": "support" }, + { "path": "themes" }, + { "path": "ui" }, + { "path": "voice-gateway" }, + { "path": "webrtc-server" }, + { "path": "fosscord.js" }, + { "path": "react-native-withcss" } + ] } diff --git a/scripts/setup/fosscord.txt b/scripts/setup/fosscord.txt index e0cb67f..81960a5 100644 --- a/scripts/setup/fosscord.txt +++ b/scripts/setup/fosscord.txt @@ -1,10 +1,8 @@ - ____ _____ ____ ____ ____ _____ ____ ____ - /\ _`\ /\ __`\ /\ _`\ /\ _`\ /\ _`\ /\ __`\ /\ _`\ /\ _`\ - \ \ \L\_\\ \ \/\ \\ \,\L\_\\ \,\L\_\\ \ \/\_\\ \ \/\ \\ \ \L\ \\ \ \/\ \ - \ \ _\/ \ \ \ \ \\/_\__ \ \/_\__ \ \ \ \/_/_\ \ \ \ \\ \ , / \ \ \ \ \ - \ \ \/ \ \ \_\ \ /\ \L\ \ /\ \L\ \\ \ \L\ \\ \ \_\ \\ \ \\ \ \ \ \_\ \ - \ \_\ \ \_____\\ `\____\\ `\____\\ \____/ \ \_____\\ \_\ \_\\ \____/ - \/_/ \/_____/ \/_____/ \/_____/ \/___/ \/_____/ \/_/\/ / \/___/ - - \ No newline at end of file + ____ _____ ____ ____ ____ _____ ____ ____ +/\ _`\ /\ __`\ /\ _`\ /\ _`\ /\ _`\ /\ __`\ /\ _`\ /\ _`\ +\ \ \L\_\\ \ \/\ \\ \,\L\_\\ \,\L\_\\ \ \/\_\\ \ \/\ \\ \ \L\ \\ \ \/\ \ + \ \ _\/ \ \ \ \ \\/_\__ \ \/_\__ \ \ \ \/_/_\ \ \ \ \\ \ , / \ \ \ \ \ + \ \ \/ \ \ \_\ \ /\ \L\ \ /\ \L\ \\ \ \L\ \\ \ \_\ \\ \ \\ \ \ \ \_\ \ + \ \_\ \ \_____\\ `\____\\ `\____\\ \____/ \ \_____\\ \_\ \_\\ \____/ + \/_/ \/_____/ \/_____/ \/_____/ \/___/ \/_____/ \/_/\/ / \/___/ diff --git a/scripts/setup/generate.py b/scripts/setup/generate.py new file mode 100644 index 0000000..ab6a4ae --- /dev/null +++ b/scripts/setup/generate.py @@ -0,0 +1,22 @@ +# script to: +# - get all repo git urls from the fosscord orga and format them to make the process of updating the setup script less tiresome +# - create a workspace file for VScode + +import requests + +workspace = { + "folders":[] +} +repos = "" +response = requests.get("https://api.github.com/users/fosscord/repos").json() + +for repo in response: + name = repo['name'].replace('fosscord-','') + workspace["folders"].append({"path":f"{name}"}) + repos += f"git clone {repo['git_url']} {name}\n" + +with open("clone_all_repos.sh","w") as f: + f.write(repos) + +with open("fosscord.code-workspace", "w") as f: + f.write(str(workspace).replace("'",'"')) diff --git a/scripts/setup/setup.sh b/scripts/setup/setup.sh index f120dce..f501316 100755 --- a/scripts/setup/setup.sh +++ b/scripts/setup/setup.sh @@ -1,4 +1,6 @@ #!/bin/sh +cat fosscord.txt +echo cat << EOF -------------------------------------- Fosscord Open Source Contribution Setup @@ -42,25 +44,8 @@ mkdir fosscord cd fosscord echo Cloning all repositories -git clone https://github.com/fosscord/fosscord overview -git clone https://github.com/fosscord/fosscord-api api -git clone https://github.com/fosscord/fosscord-gateway gateway -git clone https://github.com/fosscord/fosscord-themes themes -git clone https://github.com/fosscord/fosscord-plugins plugins -git clone https://github.com/fosscord/fosscord-gateway gateway -git clone https://github.com/fosscord/fosscord-media media -git clone https://github.com/fosscord/fosscord-server-util server-util -git clone https://github.com/fosscord/fosscord-cdn cdn -git clone https://github.com/fosscord/fosscord-ui ui -git clone https://github.com/fosscord/fosscord-client client -git clone https://github.com/fosscord/fosscord-dashboard dashboard -git clone https://github.com/fosscord/fosscord-support support -git clone https://github.com/fosscord/fosscord-landingpage landingpage -git clone https://github.com/fosscord/css-mediaquery css-mediaquery -git clone https://github.com/fosscord/react-native-withcss react-native-withcss - -echo '{"folders":[{"path":"overview"},{"path":"cdn"},{"path":"api"},{"path":"gateway"},{"path":"media"},{"path":"server-util"},{"path":"ui"},{"path":"client"},{"path":"plugins"},{"path":"themes"},{"path":"landingpage"},{"path":"dashboard"},{"path":"support"},{"path":"css-mediaquery"},{"path":"react-native-withcss"}]}' >> fosscord.code-workspace - +sh ../clone_all_repos.sh +mv ../fosscord.code-workspace ./fosscord.code-workspace while true; do echo "Do you wish to launch the VSCode workspace?"