feat(actions): bootstrap sol runner
All checks were successful
runner-smoke / smoke (push) Successful in 36s
All checks were successful
runner-smoke / smoke (push) Successful in 36s
This commit is contained in:
28
bootstrap/gitea-actions/scripts/bootstrap-sol.sh
Executable file
28
bootstrap/gitea-actions/scripts/bootstrap-sol.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"
|
||||
MODULE_DIR="$(cd -- "${SCRIPT_DIR}/.." && pwd -P)"
|
||||
REPO_ROOT="$(cd -- "${MODULE_DIR}/../.." && pwd -P)"
|
||||
|
||||
SOL_HOST="${SOL_HOST:-149.50.96.162}"
|
||||
SOL_USER="${SOL_USER:-user}"
|
||||
SOL_SSH_KEY="${SOL_SSH_KEY:-/home/user/dev/mcp/keys/mpabi/mevnode_mcp}"
|
||||
REMOTE_STAGING_DIR="${REMOTE_STAGING_DIR:-/tmp/trade-gitops-bootstrap}"
|
||||
|
||||
ssh_sol() {
|
||||
ssh -i "$SOL_SSH_KEY" -o IdentitiesOnly=yes -o StrictHostKeyChecking=no "$SOL_USER@$SOL_HOST" "$@"
|
||||
}
|
||||
|
||||
"${SCRIPT_DIR}/create-runner-registration-secret.sh"
|
||||
|
||||
tar -C "$REPO_ROOT" -cf - bootstrap/gitea-actions | \
|
||||
ssh_sol "rm -rf ${REMOTE_STAGING_DIR} && mkdir -p ${REMOTE_STAGING_DIR} && tar -C ${REMOTE_STAGING_DIR} -xf -"
|
||||
|
||||
ssh_sol "sudo mkdir -p /var/lib/trade-gitops/gitea-actions/runner-data"
|
||||
ssh_sol "sudo k3s kubectl apply -k ${REMOTE_STAGING_DIR}/bootstrap/gitea-actions"
|
||||
ssh_sol "sudo k3s kubectl -n gitea-actions rollout status deploy/trade-next-act-runner --timeout=180s"
|
||||
|
||||
"${SCRIPT_DIR}/sync-k3s-kubeconfig-org-secret.sh"
|
||||
|
||||
ssh_sol "sudo k3s kubectl -n gitea-actions get pods -o wide"
|
||||
Reference in New Issue
Block a user