diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 23cf2a4..b31966d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,6 +43,26 @@ jobs: with: # The vcpkg.json file, which will be part of cache key computation. vcpkgJsonGlob: '**/src/vcpkg.json' + + - name: Download cloudfuse for Windows + if: ${{ Contains(matrix.os, 'windows') }} + shell: pwsh + run: | + $download_url = Invoke-RestMethod -Uri "https://api.github.com/repos/Seagate/cloudfuse/releases/latest" | Select-Object -ExpandProperty assets | Where-Object { $_.name -like "*no_gui_windows_amd64.exe" } | Select-Object -ExpandProperty browser_download_url + $file_name = $download_url.Split('/')[-1] + Invoke-WebRequest -Uri $download_url -OutFile $file_name + + - name: Download cloudfuse for Linux amd64 (no_gui) + if: ${{ Contains(matrix.os, 'ubuntu') }} + run: | + download_url=$(curl -s https://api.github.com/repos/Seagate/cloudfuse/releases/latest | jq -r '.assets[] | select(.name | contains("no_gui_linux_amd64.deb")) | .browser_download_url') + curl -LO $download_url + + - name: Download cloudfuse for Linux arm64 (no_gui) + if: ${{ Contains(matrix.os, 'ubuntu') }} + run: | + download_url=$(curl -s https://api.github.com/repos/Seagate/cloudfuse/releases/latest | jq -r '.assets[] | select(.name | contains("no_gui_linux_arm64.deb")) | .browser_download_url') + curl -LO $download_url - name: Run build script for Linux x64 if: ${{ Contains(matrix.os, 'ubuntu') }} @@ -56,6 +76,8 @@ jobs: run: | mkdir nx-lyve-cloud-plugin-${{ matrix.os }}_x64 mv ../nx-lyve-cloud-plugin-build/cloudfuse_plugin/*.so nx-lyve-cloud-plugin-${{ matrix.os }}_x64/cloudfuse_plugin.so + mv ./cloudfuse*_linux_amd64.deb nx-lyve-cloud-plugin-${{ matrix.os }}/ + cp ./install_plugin_linux.sh nx-lyve-cloud-plugin-${{ matrix.os }}_x64/ cp ./setup_fuse_allow_other.sh nx-lyve-cloud-plugin-${{ matrix.os }}_x64/ zip -r nx-lyve-cloud-plugin-${{ matrix.os }}_x64.zip nx-lyve-cloud-plugin-${{ matrix.os }}_x64 @@ -76,6 +98,8 @@ jobs: run: | mkdir nx-lyve-cloud-plugin-${{ matrix.os }}_arm64 mv ../nx-lyve-cloud-plugin-build/cloudfuse_plugin/*.so nx-lyve-cloud-plugin-${{ matrix.os }}_arm64/cloudfuse_plugin.so + mv ./cloudfuse*_linux_arm64.deb nx-lyve-cloud-plugin-${{ matrix.os }}/ + cp ./install_plugin_linux.sh nx-lyve-cloud-plugin-${{ matrix.os }}_arm64/ cp ./setup_fuse_allow_other.sh nx-lyve-cloud-plugin-${{ matrix.os }}_arm64/ zip -r nx-lyve-cloud-plugin-${{ matrix.os }}_arm64.zip nx-lyve-cloud-plugin-${{ matrix.os }}_arm64 @@ -91,7 +115,9 @@ jobs: if: ${{ Contains(matrix.os, 'windows') }} run: | mkdir nx-lyve-cloud-plugin-windows - mv ..\nx-lyve-cloud-plugin-build\cloudfuse_plugin\Release\cloudfuse_plugin.dll nx-lyve-cloud-plugin-windows/cloudfuse_plugin.dll + mv ..\nx-lyve-cloud-plugin-build\cloudfuse_plugin\Release\cloudfuse_plugin.dll nx-lyve-cloud-plugin-windows\cloudfuse_plugin.dll + mv .\install_plugin_windows.bat nx-lyve-cloud-plugin-windows\ + mv .\cloudfuse*_windows_amd64.deb nx-lyve-cloud-plugin-windows\ Compress-Archive nx-lyve-cloud-plugin-windows nx-lyve-cloud-plugin-windows.zip - name: Archive production artifacts from Ubuntu x64 diff --git a/setup_fuse_allow_other.sh b/install_plugin_linux.sh similarity index 60% rename from setup_fuse_allow_other.sh rename to install_plugin_linux.sh index cc01f00..ee3a96c 100755 --- a/setup_fuse_allow_other.sh +++ b/install_plugin_linux.sh @@ -1,4 +1,9 @@ #!/bin/bash + +## Copyright © 2024 Seagate Technology LLC and/or its Affiliates +set -e + +### Setup Fuse Allow Other FUSE_CONF="/etc/fuse.conf" # Check if "user_allow_other" is already in the file @@ -17,3 +22,15 @@ else echo "Added user_allow_other added to $FUSE_CONF" fi fi + +### Install Cloudfuse +echo "Installing Cloudfuse" +apt-get install libssl-dev +apt-get install ./cloudfuse*.deb + +### Install plugin +echo "Installing Cloudfuse plugin" +cp cloudfuse_plugin.so /opt/networkoptix-metavms/mediaserver/bin/plugins/ +systemctl restart networkoptix-mediaserver.service + +echo "Finished installing Cloudfuse plugin" diff --git a/install_plugin_windows.bat b/install_plugin_windows.bat new file mode 100644 index 0000000..696f436 --- /dev/null +++ b/install_plugin_windows.bat @@ -0,0 +1,52 @@ +:: Copyright © 2024 Seagate Technology LLC and/or its Affiliates +@echo off + +:: Find the installer file +for %%I in (cloudfuse*.exe) do ( + set "installer=%%I" + break +) + +:: Check if the installer file exists and if so install it +if exist "%installer%" ( + echo Installing Cloudfuse + "%installer%" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART +) else ( + echo Installer file not found + exit /b +) + +echo Installing plugin + +:: Stop the VMS server +set serviceName="metavmsMediaServer" +echo Attempting to stop %serviceName% +net stop %serviceName% >NUL 2>&1 +echo Service stopped successfully. + +:: Copy the plugin file +echo Attempting to copy the plugin file +copy ".\cloudfuse_plugin.dll" "C:\Program Files\Network Optix\Nx Meta\MediaServer\plugins\" +set copyError=%errorlevel% +if %copyError% neq 0 ( + echo Failed to copy the plugin file +) + +:: Restart the VMS +echo Attempting to start %serviceName% +net start %serviceName% >NUL 2>&1 +if %errorlevel% neq 0 ( + echo Installation failed: Unable to restart %serviceName%. It must be restarted manually. + exit /b +) + +if %copyError% neq 0 ( + echo Installation failed: Unable to copy plugin file + exit /b +) + + +echo Service started successfully. +echo Finished installing Cloudfuse plugin + +pause