Skip to content

Commit

Permalink
test microk8s cluster configuring script for linux (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
CITIZENDOT committed Aug 5, 2023
1 parent 8ee1842 commit 1b78b8c
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
52 changes: 52 additions & 0 deletions .github/workflows/test-microk8s-ubuntu.yml
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
3 changes: 2 additions & 1 deletion assets/scripts/configure-microk8s-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ while getopts a:c:d:f:i:o:p:r: flag; do
esac
done

if [[ -z $ASSETS_FOLDER || -z $CONFIGS_FOLDER || -z $FORCE_DB_REFRESH || -z $ENGINE_FOLDER || -z $CLUSTER_ID || -z $OPS_FOLDER || -z $PASSWORD || -z $ENABLE_RIPPLE_STACK ]]; then
if [[ -z $ASSETS_FOLDER || -z $CONFIGS_FOLDER || -z $FORCE_DB_REFRESH || -z $ENGINE_FOLDER || -z $CLUSTER_ID || -z $OPS_FOLDER || -z $ENABLE_RIPPLE_STACK ]]; then
# Allow empty passwords
echo "Missing arguments"
exit 1
fi
Expand Down

0 comments on commit 1b78b8c

Please sign in to comment.