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

Feat: installer env vars enabling unattended installation #143

Merged
merged 1 commit into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
15 changes: 10 additions & 5 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ prompt_default_no() {

if [ -f nodekit ]; then
warn "A nodekit file already exists in the current directory."
if prompt_default_no "Do you want to upgrade it to the latest nodekit?"; then
# Set the NODEKIT_FORCE_INSTALL environment variable to anything in order to force upgrading nodekit without prompting
if [[ -n "${NODEKIT_FORCE_INSTALL-}" ]] || prompt_default_no "Do you want to upgrade it to the latest nodekit?"; then
rm nodekit
else
info "Not upgrading nodekit.\n\nYou can run nodekit with:\n\n./nodekit\n\nOr start the installer with:\n\n./nodekit bootstrap"
Expand Down Expand Up @@ -103,8 +104,12 @@ trap - exit
success "Downloaded: ${Bold_Green}${target} as nodekit 🎉${Reset}"
info "Explore all nodekit options with:"
echo "./nodekit --help"
echo ""
info "Starting nodekit bootstrap"
echo "./nodekit bootstrap"

./nodekit bootstrap
# Set the NODEKIT_SKIP_BOOTSTRAP environment variable to anything in order to skip bootstrap
# Useful for non-interactive setup
if [[ -z "${NODEKIT_SKIP_BOOTSTRAP-}" ]]; then
echo ""
info "Starting nodekit bootstrap"
echo "./nodekit bootstrap"
./nodekit bootstrap
fi
13 changes: 13 additions & 0 deletions unattended.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

# Install nodekit, replacing any previous nodekit (FORCE_INSTALL) and skipping the interactive bootstrap
wget -qO- https://nodekit.run/install.sh | NODEKIT_FORCE_INSTALL=1 NODEKIT_SKIP_BOOTSTRAP=1 bash

# Install node
./nodekit install -f

# Wait a bit for connections to be established
sleep 2m

# Start a fast catchup
./nodekit catchup start
Loading