From 6d3e6fda890944b53ae6166870a97a117f17d8f5 Mon Sep 17 00:00:00 2001 From: Charafeddine Cheraa Date: Wed, 29 Sep 2021 11:27:06 +0300 Subject: [PATCH 1/2] upload prebuilt binaries evolvedbinary/fusion-studio#124 --- .circleci/config.yml | 22 ++++++++++ docker/centos7_x64/build.sh | 12 +++--- upload-prebuilt-binaries.sh | 85 +++++++++++++++++++++++++++++++++++++ 3 files changed, 113 insertions(+), 6 deletions(-) create mode 100755 upload-prebuilt-binaries.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 254ff10..ff94d5f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -56,6 +56,17 @@ jobs: - run: command: yarn package no_output_timeout: 15m + - run: + name: add server to known hosts + command: | + mkdir -p ~/.ssh + ssh-keyscan static.evolvedbinary.com >> ~/.ssh/known_hosts + - add_ssh_keys: + fingerprints: + - "3b:f6:39:ee:37:d3:5a:3f:c5:cd:45:9c:15:6a:44:36" + - run: + name: Uploading prebuilt binaries + command: ./upload-prebuilt-binaries.sh # Artifacts - unless: condition: @@ -103,6 +114,17 @@ jobs: - run: node --version - run: yarn --version - run: yarn package + - run: + name: add server to known hosts + command: | + mkdir -p ~/.ssh + ssh-keyscan static.evolvedbinary.com >> ~/.ssh/known_hosts + - add_ssh_keys: + fingerprints: + - "3b:f6:39:ee:37:d3:5a:3f:c5:cd:45:9c:15:6a:44:36" + - run: + name: Uploading prebuilt binaries + command: ./upload-prebuilt-binaries.sh win - store_artifacts: path: dist/fusion-studio-2.0.0-next.0-installer.exe destination: Windows diff --git a/docker/centos7_x64/build.sh b/docker/centos7_x64/build.sh index 9f438ca..de33c2f 100644 --- a/docker/centos7_x64/build.sh +++ b/docker/centos7_x64/build.sh @@ -1,12 +1,12 @@ # !/bin/sh source /root/.bashrc source scl_source enable devtoolset-8 -yarn config set drivelist_binary_host https://pear.evolvedbinary.com/fusion-studio/prebuild/drivelist -yarn config set @theia/node-pty_binary_host https://pear.evolvedbinary.com/fusion-studio/prebuild/node-pty -yarn config set find-git-repositories_binary_host https://pear.evolvedbinary.com/fusion-studio/prebuild/find-git-repositories -yarn config set native-keymap_binary_host https://pear.evolvedbinary.com/fusion-studio/prebuild/native-keymap -yarn config set nsfw_binary_host https://pear.evolvedbinary.com/fusion-studio/prebuild/nsfw -yarn config set oniguruma_binary_host https://pear.evolvedbinary.com/fusion-studio/prebuild/oniguruma +export npm_config_drivelist_binary_host=https://static.evolvedbinary.com/fusion-studio-bin/drivelist +export npm_config__theia_node_pty_binary_host=https://static.evolvedbinary.com/fusion-studio-bin/node-pty +export npm_config_find_git_repositories_binary_host=https://static.evolvedbinary.com/fusion-studio-bin/find-git-repositories +export npm_config_native_keymap_binary_host=https://static.evolvedbinary.com/fusion-studio-bin/native-keymap +export npm_config_nsfw_binary_host=https://static.evolvedbinary.com/fusion-studio-bin/nsfw +export npm_config_oniguruma_binary_host=https://static.evolvedbinary.com/fusion-studio-bin/oniguruma cp /root/force-download.js /project cd /project if [ -d /project/node_modules ]; then diff --git a/upload-prebuilt-binaries.sh b/upload-prebuilt-binaries.sh new file mode 100755 index 0000000..8599be0 --- /dev/null +++ b/upload-prebuilt-binaries.sh @@ -0,0 +1,85 @@ +# !/bin/bash +abi=80 +user=ccheraa +ignoredbinaries="ffmpeg conpty_console_list conpty" +server=static.evolvedbinary.com +basedir=/www-data/static.evolvedbinary.com/fusion-studio-bin +os=$1 +function ignored { + [[ $ignoredbinaries =~ (^|[[:space:]])$1($|[[:space:]]) ]] +} +function upload { + echo processing $1: + [[ $1 =~ .*/build/Release/(.*).node ]] + file=${BASH_REMATCH[1]} + ignored $file + if [[ $? == "0" ]]; then + echo "package in ignore list, skipped." + else + [[ $1 =~ node_modules/([^/]+/)*([^/]+)/build/Release/(.*).node ]] + pkgpath=${BASH_REMATCH[1]} + pkg=${BASH_REMATCH[2]} + pkgjson=node_modules/$pkgpath$pkg/package.json + pkgversion=$(cat $pkgjson | grep '"version"' | sed 's/.*"version".*"\(.*\)".*/\1/') + if [[ "$OSTYPE" == "linux-gnu"* ]]; then + platform=linux + elif [[ "$OSTYPE" == "darwin"* ]]; then + platform=darwin + else + platform=win32 + fi + tar=$pkg-v$pkgversion-electron-v$abi-$platform-x64.tar.gz; + dir=$pkg/v$pkgversion; + tardir=$basedir/$dir; + tarpath=$tardir/$tar; + ssh $user@$server "[[ -f $tarpath ]];" + if [[ $? == "0" ]]; then + echo $pkg@$pkgversion found, no need to re-upload. + else + printf "$pkg@$pkgversion not found. uploading...\n" + tmp=/tmp/$tar + mkdir -p $tmp/build/Release + cp $1 $tmp/build/Release + tar -czf $tmp/$tar --directory=$tmp build > /dev/null + ssh $user@$server "mkdir -p \"$tardir\"" + scp -q $tmp/$tar $user@$server:$tardir + rm -rf $tmp + fi + fi +} +function list { + if [[ "$os" == "win" ]]; then + ls -R node_modules | { + while IFS= read -r filename + do + if [[ "$filename" =~ (.*):$ ]]; then + dir=${BASH_REMATCH[1]} + else + if [[ "$filename" != "" ]]; then + echo "$dir/$filename" + fi + fi + done + } | grep /build/Release | grep .node | { + while IFS= read -r path + do + if [[ $path =~ $root/(.*)/build/Release/([^/]*).node ]] && [[ ${BASH_REMATCH[2]} != ffmpeg ]]; then + echo "$path" + fi + done + } | { + while IFS= read -r path + do + echo "$path" + done + } + else + find node_modules -wholename "*/build/Release/*.node" -exec bash -c '[[ $(dirname $1) == *build/Release ]] && [[ $1 =~ node_modules/(.*)/build/Release/(.*).node ]] && echo $1' bash {} \; + fi +} +l=$(list) +for x in $l +do + upload $x +done +echo done! \ No newline at end of file From 4b938abc3a8e98d2b32128188b828ce80325d161 Mon Sep 17 00:00:00 2001 From: Charafeddine Cheraa Date: Thu, 30 Sep 2021 07:27:36 +0300 Subject: [PATCH 2/2] install latest version of OpenSSH evolvedbinary/fusion-studio#124 --- .circleci/config.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index ff94d5f..1e510de 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -114,6 +114,12 @@ jobs: - run: node --version - run: yarn --version - run: yarn package + - run: + name: Install latest version of OpenSSH + command: | + choco install openssh + echo 'export PATH=$(echo $PATH | sed '"'"'s/\\/c\\/Windows\\/System32\\/OpenSSH/\\/c\\/Program\\ Files\\/OpenSSH-Win64\\/ssh/g'"'"')' >> $BASH_ENV + source $BASH_ENV - run: name: add server to known hosts command: |