finalize livebook
This commit is contained in:
parent
acbaa7ce7d
commit
ffe61d7590
@ -20,35 +20,36 @@ color
|
|||||||
catch_errors
|
catch_errors
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
|
|
||||||
if [[ ! -f /opt/livebook/.mix/escripts/livebook ]]; then
|
if [[ ! -f /opt/livebook/.mix/escripts/livebook ]]; then
|
||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
if check_for_gh_release "livebook" "livebook-dev/livebook"; then
|
|
||||||
msg_info "Stopping ${APP}"
|
|
||||||
systemctl stop livebook
|
|
||||||
msg_info "Service stopped"
|
|
||||||
|
|
||||||
msg_info "Updating container"
|
|
||||||
$STD apt-get update
|
|
||||||
$STD apt-get -y upgrade
|
|
||||||
msg_ok "Updated container"
|
|
||||||
|
|
||||||
msg_info "Updating ${APP}"
|
|
||||||
source /opt/livebook/.env
|
|
||||||
cd /opt/livebook
|
|
||||||
$STD mix escript.install hex livebook --force
|
|
||||||
|
|
||||||
chown -R livebook:livebook /opt/livebook /data
|
|
||||||
systemctl start livebook
|
|
||||||
msg_ok "Updated ${APP}"
|
|
||||||
fi
|
|
||||||
exit
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
if check_for_gh_release "livebook" "livebook-dev/livebook"; then
|
||||||
|
msg_info "Stopping Service"
|
||||||
|
systemctl stop livebook
|
||||||
|
msg_info "Stopped Service"
|
||||||
|
|
||||||
|
msg_info "Updating Container"
|
||||||
|
$STD apt update
|
||||||
|
$STD apt upgrade -y
|
||||||
|
msg_ok "Updated Container"
|
||||||
|
|
||||||
|
msg_info "Updating Livebook"
|
||||||
|
source /opt/livebook/.env
|
||||||
|
cd /opt/livebook
|
||||||
|
$STD mix escript.install hex livebook --force
|
||||||
|
|
||||||
|
chown -R livebook:livebook /opt/livebook /data
|
||||||
|
systemctl start livebook
|
||||||
|
msg_ok "Updated Livebook"
|
||||||
|
msg_ok "Updated Successfully!"
|
||||||
|
fi
|
||||||
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
start
|
start
|
||||||
|
|||||||
@ -15,11 +15,11 @@ update_os
|
|||||||
|
|
||||||
msg_info "Installing Dependencies"
|
msg_info "Installing Dependencies"
|
||||||
$STD apt-get install -y \
|
$STD apt-get install -y \
|
||||||
build-essential \
|
build-essential \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
cmake \
|
cmake \
|
||||||
git \
|
git \
|
||||||
libncurses5-dev
|
libncurses5-dev
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
msg_info "Creating livebook user"
|
msg_info "Creating livebook user"
|
||||||
@ -28,7 +28,6 @@ export HOME=/opt/livebook
|
|||||||
$STD adduser --system --group --home /opt/livebook --shell /bin/bash livebook
|
$STD adduser --system --group --home /opt/livebook --shell /bin/bash livebook
|
||||||
msg_ok "Created livebook user"
|
msg_ok "Created livebook user"
|
||||||
|
|
||||||
|
|
||||||
msg_warn "WARNING: This script will run an external installer from a third-party source (https://elixir-lang.org)."
|
msg_warn "WARNING: This script will run an external installer from a third-party source (https://elixir-lang.org)."
|
||||||
msg_warn "The following code is NOT maintained or audited by our repository."
|
msg_warn "The following code is NOT maintained or audited by our repository."
|
||||||
msg_warn "If you have any doubts or concerns, please review the installer code before proceeding:"
|
msg_warn "If you have any doubts or concerns, please review the installer code before proceeding:"
|
||||||
@ -39,7 +38,8 @@ if [[ ! "$CONFIRM" =~ ^([yY][eE][sS]|[yY])$ ]]; then
|
|||||||
msg_error "Aborted by user. No changes have been made."
|
msg_error "Aborted by user. No changes have been made."
|
||||||
exit 10
|
exit 10
|
||||||
fi
|
fi
|
||||||
bash <(curl -sL https://elixir-lang.org/install.sh)
|
curl -fsSO https://elixir-lang.org/install.sh
|
||||||
|
$STD sh install.sh elixir@latest otp@latest
|
||||||
|
|
||||||
msg_info "Setup Erlang and Elixir"
|
msg_info "Setup Erlang and Elixir"
|
||||||
ERLANG_VERSION=$(ls /opt/livebook/.elixir-install/installs/otp/ | head -n1)
|
ERLANG_VERSION=$(ls /opt/livebook/.elixir-install/installs/otp/ | head -n1)
|
||||||
@ -100,6 +100,7 @@ motd_ssh
|
|||||||
customize
|
customize
|
||||||
|
|
||||||
msg_info "Cleaning Up"
|
msg_info "Cleaning Up"
|
||||||
$STD apt-get autoremove -y
|
$STD apt autoremove -y
|
||||||
$STD apt-get autoclean
|
$STD apt autoclean -y
|
||||||
|
$STD apt clean -y
|
||||||
msg_ok "Cleaned Up"
|
msg_ok "Cleaned Up"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user