From 173bc7201cb92680eccd5dbf95d8d2d77dd7f8ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Slavi=C5=A1a=20Are=C5=BEina?= <58952836+tremor021@users.noreply.github.com> Date: Mon, 14 Apr 2025 15:12:28 +0200 Subject: [PATCH] Neo4j: Add Java dependency (#3871) * Add Java dependency * update * Update neo4j-install.sh * Update neo4j.sh * update --------- Co-authored-by: CanbiZ <47820557+MickLesk@users.noreply.github.com> --- ct/neo4j.sh | 36 ++++++++++++++++++++++++------------ install/neo4j-install.sh | 11 ++++++++++- 2 files changed, 34 insertions(+), 13 deletions(-) diff --git a/ct/neo4j.sh b/ct/neo4j.sh index d3d7e0df2..129f0e50d 100644 --- a/ct/neo4j.sh +++ b/ct/neo4j.sh @@ -20,18 +20,30 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -d /etc/neo4j ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - msg_info "Updating ${APP}" - $STD apt-get update - $STD apt-get -y upgrade - msg_ok "Updated Successfully" + header_info + check_container_storage + check_container_resources + if [[ ! -d /etc/neo4j ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + if ! dpkg -l | grep -q temurin-21-jre; then + msg_info "Installing Adoptium JDK" + $STD apt-get install -y \ + gnupg2 \ + lsb-release + mkdir -p /etc/apt/keyrings + curl -fsSL https://packages.adoptium.net/artifactory/api/gpg/key/public | gpg --dearmor >/etc/apt/trusted.gpg.d/adoptium.gpg + echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" >/etc/apt/sources.list.d/adoptium.list + $STD apt-get update + $STD apt-get install -y temurin-21-jre + msg_ok "Adoptium JDK installed" + fi + msg_info "Updating ${APP}" + $STD apt-get update + $STD apt-get -y upgrade + msg_ok "Updated Successfully" + exit } start @@ -41,4 +53,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:7474${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:7474${CL}" diff --git a/install/neo4j-install.sh b/install/neo4j-install.sh index acbe5ec16..df62ac78d 100644 --- a/install/neo4j-install.sh +++ b/install/neo4j-install.sh @@ -15,13 +15,22 @@ network_check update_os msg_info "Installing Dependencies" -$STD apt-get install -y gpg +$STD apt-get install -y \ + gnupg2 \ + lsb-release msg_ok "Installed Dependencies" +msg_info "Setting up Adoptium Repository" +mkdir -p /etc/apt/keyrings +curl -fsSL "https://packages.adoptium.net/artifactory/api/gpg/key/public" | gpg --dearmor >/etc/apt/trusted.gpg.d/adoptium.gpg +echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" >/etc/apt/sources.list.d/adoptium.list +msg_ok "Set up Adoptium Repository" + msg_info "Installing Neo4j (patience)" curl -fsSL "https://debian.neo4j.com/neotechnology.gpg.key" | gpg --dearmor -o /etc/apt/keyrings/neotechnology.gpg echo 'deb [signed-by=/etc/apt/keyrings/neotechnology.gpg] https://debian.neo4j.com stable latest' >/etc/apt/sources.list.d/neo4j.list $STD apt-get update +$STD apt-get install -y temurin-21-jre $STD apt-get install -y neo4j sed -i '/server.default_listen_address/s/^#//' /etc/neo4j/neo4j.conf systemctl enable -q --now neo4j