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

[fix] Install latest published release from GitHub #407 #412

Merged
merged 4 commits into from
Dec 18, 2024
Merged
Changes from 1 commit
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
18 changes: 11 additions & 7 deletions deploy/auto-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,18 @@ error_msg_with_continue() {

apt_dependenices_setup() {
start_step "Setting up dependencies..."
apt --yes install python3 python3-pip git python3-dev gawk libffi-dev libssl-dev gcc make &>>$LOG_FILE
apt --yes install python3 python3-pip git python3-dev gawk libffi-dev libssl-dev gcc make curl &>>$LOG_FILE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also include jq, so we don't into similar errors like curl.

check_status $? "Python dependencies installation failed."
}

get_version_from_user() {
echo -ne ${GRN}"OpenWISP Version (leave blank for latest): "${NON}
read openwisp_version
if [[ -z "$openwisp_version" ]]; then
openwisp_version=$(curl -L --silent https://api.github.com/repos/openwisp/docker-openwisp/releases/latest | jq .tag_name | tr -d '"')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
openwisp_version=$(curl -L --silent https://api.github.com/repos/openwisp/docker-openwisp/releases/latest | jq .tag_name | tr -d '"')
openwisp_version=$(curl -L --silent https://api.github.com/repos/openwisp/docker-openwisp/releases/latest | jq -r .tag_name)

fi
}

setup_docker() {
start_step "Setting up docker..."
docker info &>/dev/null
Expand Down Expand Up @@ -91,9 +99,7 @@ download_docker_openwisp() {

setup_docker_openwisp() {
echo -e ${GRN}"\nOpenWISP Configuration:"${NON}
echo -ne ${GRN}"OpenWISP Version (leave blank for latest): "${NON}
read openwisp_version
if [[ -z "$openwisp_version" ]]; then openwisp_version=latest; fi
get_version_from_user
echo -ne ${GRN}"Do you have .env file? Enter filepath (leave blank for ad-hoc configuration): "${NON}
read env_path
if [[ ! -f "$env_path" ]]; then
Expand Down Expand Up @@ -177,9 +183,7 @@ setup_docker_openwisp() {

upgrade_docker_openwisp() {
echo -e ${GRN}"\nOpenWISP Configuration:"${NON}
echo -ne ${GRN}"OpenWISP Version (leave blank for latest): "${NON}
read openwisp_version
if [[ -z "$openwisp_version" ]]; then openwisp_version=latest; fi
get_version_from_user
echo ""

download_docker_openwisp "$openwisp_version"
Expand Down