Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create installer #37

Merged
merged 17 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 "*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("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("linux_arm64.deb")) | .browser_download_url')
curl -LO $download_url

- name: Run build script for Linux x64
if: ${{ Contains(matrix.os, 'ubuntu') }}
Expand All @@ -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

Expand All @@ -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

Expand All @@ -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
Expand Down
18 changes: 18 additions & 0 deletions setup_fuse_allow_other.sh → install_plugin_linux.sh
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -17,3 +22,16 @@ 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"
systemctl stop networkoptix-mediaserver.service
cp cloudfuse_plugin.so /opt/networkoptix-metavms/mediaserver/bin/plugins/
systemctl start networkoptix-mediaserver.service
foodprocessor marked this conversation as resolved.
Show resolved Hide resolved

echo "Finished installing Cloudfuse plugin"
46 changes: 46 additions & 0 deletions install_plugin_windows.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
:: 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%
sc 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\"
if %errorlevel% neq 0 (
echo Failed to copy the plugin file
exit /b
)

:: Restart the VMS
echo Attempting to start %serviceName%
sc start %serviceName% >NUL 2>&1
if %errorlevel% neq 0 (
echo Failed to start %serviceName%
exit /b
)
foodprocessor marked this conversation as resolved.
Show resolved Hide resolved

foodprocessor marked this conversation as resolved.
Show resolved Hide resolved
echo Service started successfully.
echo Finished installing Cloudfuse plugin

pause
Loading