This repository has been archived by the owner on Aug 19, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into Abhijay007/newPrerequisite
- Loading branch information
Showing
44 changed files
with
1,578 additions
and
243 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: test-microk8s-ubuntu | ||
|
||
on: | ||
pull_request: | ||
branches: [master] | ||
push: | ||
branches: [master] | ||
|
||
jobs: | ||
test-linux: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out Git repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Get all script files that have changed | ||
id: changed-files | ||
uses: tj-actions/changed-files@v37 | ||
with: | ||
files: | | ||
assets/scripts/**.sh | ||
.github/workflows/test-microk8s-ubuntu.yml | ||
files_ignore: assets/scripts/configure-minikube-linux.sh | ||
since_last_remote_commit: true | ||
|
||
- name: Configure MicroK8s Cluster | ||
if: ${{ steps.changed-files.outputs.any_modified == 'true' }} | ||
run: | | ||
ASSETS_PATH="$GITHUB_WORKSPACE/assets" | ||
CONFIGS_PATH="/home/runner/opt/config" | ||
FORCE_DB_REFRESH=true | ||
ENGINE_PATH="/home/runner/opt/etherealengine" | ||
CLUSTER_ID=test | ||
OPS_PATH="/home/runner/opt/ethereal-engine-ops" | ||
PASSWORD= # Github actions run in password-less sudo mode. | ||
ENABLE_RIPPLE_STACK=false | ||
mkdir -p "$CONFIGS_PATH" | ||
curl https://raw.githubusercontent.com/EtherealEngine/ethereal-engine-ops/master/configs/local.microk8s.template.values.yaml -o "$CONFIGS_PATH/test-engine.values.yaml" | ||
sed -i "s,^\([[:space:]]*hostUploadFolder:\).*,\1 '/home/runner/opt/etherealengine/packages/server/upload'," "$CONFIGS_PATH/test-engine.values.yaml" | ||
bash "$ASSETS_PATH/scripts/configure-microk8s-linux.sh" \ | ||
-a "$ASSETS_PATH" \ | ||
-c "$CONFIGS_PATH" \ | ||
-d "$FORCE_DB_REFRESH" \ | ||
-f "$ENGINE_PATH" \ | ||
-i "$CLUSTER_ID" \ | ||
-o "$OPS_PATH" \ | ||
-p "$PASSWORD" \ | ||
-r "$ENABLE_RIPPLE_STACK" | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
|
||
#========== | ||
# Ref: https://stackoverflow.com/a/73285729 | ||
#========== | ||
|
||
#======================== | ||
# Verify Git installation | ||
#======================== | ||
|
||
$IS_GIT_INSTALLED = $false; | ||
|
||
$gitVersion = Invoke-Expression "& git --version" | ||
|
||
if ($gitVersion) { | ||
Write-Host "git for windows is installed"; | ||
$IS_GIT_INSTALLED = $true; | ||
} | ||
else { | ||
Write-Host "git for windows is not installed"; | ||
$IS_GIT_INSTALLED = $false; | ||
} | ||
|
||
#============ | ||
# Install Git | ||
#============ | ||
|
||
if ($IS_GIT_INSTALLED -eq $false) { | ||
$exePath = "$env:TEMP\git.exe" | ||
|
||
# Reference: https://copdips.com/2019/12/Using-Powershell-to-retrieve-latest-package-url-from-github-releases.html | ||
$url = 'https://github.com/git-for-windows/git/releases/latest' | ||
$request = [System.Net.WebRequest]::Create($url) | ||
$response = $request.GetResponse() | ||
$realTagUrl = $response.ResponseUri.OriginalString | ||
$version = $realTagUrl.split('/')[-1].Trim('v') | ||
$downloadUrl = $realTagUrl.Replace('tag', 'download') + '/Git-' + $version.Replace('.windows', '') + '-64-bit.exe' | ||
|
||
# Download git installer | ||
Write-Host "downloading git for windows using url: $downloadUrl" | ||
Invoke-WebRequest -Uri $downloadUrl -UseBasicParsing -OutFile $exePath | ||
|
||
Start-Process powershell -PassThru -WindowStyle hidden -Wait -verb runas -ArgumentList " -file $PSScriptRoot\setup-git-windows.ps1 '$exePath'" | ||
|
||
$gitVersion = Invoke-Expression "& git --version" | ||
} | ||
|
||
Write-Host "git for windows version is $gitVersion"; | ||
|
||
exit 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
#=========== | ||
# Parameters | ||
#=========== | ||
|
||
while getopts o:p: flag; do | ||
case "${flag}" in | ||
p) PASSWORD=${OPTARG} ;; | ||
*) | ||
echo "Invalid argument passed" >&2 | ||
exit 1 | ||
;; | ||
esac | ||
done | ||
|
||
if [[ -z $PASSWORD ]]; then | ||
echo "Missing arguments" | ||
exit 1 | ||
fi | ||
|
||
#=========== | ||
# Verify MOK | ||
#=========== | ||
|
||
if mokutil --version 2>/dev/null | grep -q 'command not found'; then | ||
echo "mokutil is not installed" | ||
echo $(mokutil --version) | ||
|
||
echo "$PASSWORD" | sudo -S apt-get update -y | ||
echo "$PASSWORD" | sudo -S apt-get install -y mokutil | ||
else | ||
echo "mokutil is installed" | ||
fi | ||
|
||
if echo "$PASSWORD" | sudo -S mokutil --sb-state | grep -q 'SecureBoot enabled'; then | ||
echo "Secureboot is enabled" | ||
if echo "$PASSWORD" | sudo -S mokutil --list-enrolled | grep -q 'Secure Boot Module Signature key'; then | ||
echo "mok is enrolled" | ||
exit 0 | ||
else | ||
echo "mok is not enrolled" | ||
#Exit code 2 indicates permission is needed | ||
exit 2 | ||
fi | ||
else | ||
echo "SecureBoot is disabled" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.