From 5b5df279c02c3a8897a1cb3916c5b1a4a9f3af5a Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 8 Dec 2023 13:10:44 +1100 Subject: [PATCH] Installer CLI fix (#6049) * Update heroku procfile - Fix command to run on ubuntu 20.04 - Add "invoke" command (duplicate of "cli") * Update docs for installer * Fix typo * Update root_commands.sh --- Procfile | 7 ++++++- contrib/install.sh | 4 ++-- contrib/installer/src/root_command.sh | 4 ++-- docs/docs/start/installer.md | 14 ++++++++++++++ 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/Procfile b/Procfile index 7761c4d5bc..ab832e932b 100644 --- a/Procfile +++ b/Procfile @@ -1,3 +1,8 @@ +# Web process: gunicorn web: env/bin/gunicorn --chdir $APP_HOME/InvenTree -c InvenTree/gunicorn.conf.py InvenTree.wsgi -b 0.0.0.0:$PORT +# Worker process: qcluster worker: env/bin/python InvenTree/manage.py qcluster -cli: echo "" && . env/bin/activate && exec env/bin/python -m invoke +# Invoke commands +invoke: echo "" | echo "" && . env/bin/activate && invoke +# CLI: Provided for backwards compatibility +cli: echo "" | echo "" && . env/bin/activate && invoke diff --git a/contrib/install.sh b/contrib/install.sh index 739d49ece0..3b432ae366 100755 --- a/contrib/install.sh +++ b/contrib/install.sh @@ -111,7 +111,7 @@ root_command() { done if [[ $NEEDS_LIBSSL1_1 == "true" ]]; then - echo "### Pathching for libssl1.1" + echo "### Installing libssl1.1" echo "deb http://security.ubuntu.com/ubuntu focal-security main" | sudo tee /etc/apt/sources.list.d/focal-security.list do_call "sudo apt-get update" @@ -120,7 +120,7 @@ root_command() { fi echo "### Getting and adding key" - curl -fsSL https://dl.packager.io/srv/$publisher/InvenTree/key | gpg --dearmor | tee /etc/apt/trusted.gpg.d/pkgr-inventree.gpg> /dev/null + curl -fsSL https://dl.packager.io/srv/$publisher/InvenTree/key | gpg --dearmor | tee /etc/apt/trusted.gpg.d/pkgr-inventree.gpg > /dev/null echo "### Adding package source" SOURCE_URL="deb [signed-by=/etc/apt/trusted.gpg.d/pkgr-inventree.gpg] https://dl.packager.io/srv/deb/$publisher/InvenTree/$source_url/$DIST_OS $DIST_VER main" echo "$SOURCE_URL" | tee /etc/apt/sources.list.d/inventree.list > /dev/null diff --git a/contrib/installer/src/root_command.sh b/contrib/installer/src/root_command.sh index b9c7b9a8d7..4e7bffcdc4 100644 --- a/contrib/installer/src/root_command.sh +++ b/contrib/installer/src/root_command.sh @@ -101,7 +101,7 @@ for pkg in $REQS; do done if [[ $NEEDS_LIBSSL1_1 == "true" ]]; then - echo "### Pathching for libssl1.1" + echo "### Installing libssl1.1" echo "deb http://security.ubuntu.com/ubuntu focal-security main" | sudo tee /etc/apt/sources.list.d/focal-security.list do_call "sudo apt-get update" @@ -110,7 +110,7 @@ if [[ $NEEDS_LIBSSL1_1 == "true" ]]; then fi echo "### Getting and adding key" -curl -fsSL https://dl.packager.io/srv/$publisher/InvenTree/key | gpg --dearmor | tee /etc/apt/trusted.gpg.d/pkgr-inventree.gpg> /dev/null +curl -fsSL https://dl.packager.io/srv/$publisher/InvenTree/key | gpg --dearmor | tee /etc/apt/trusted.gpg.d/pkgr-inventree.gpg > /dev/null echo "### Adding package source" SOURCE_URL="deb [signed-by=/etc/apt/trusted.gpg.d/pkgr-inventree.gpg] https://dl.packager.io/srv/deb/$publisher/InvenTree/$source_url/$DIST_OS $DIST_VER main" echo "$SOURCE_URL" | tee /etc/apt/sources.list.d/inventree.list > /dev/null diff --git a/docs/docs/start/installer.md b/docs/docs/start/installer.md index b17248d721..721a30fbed 100644 --- a/docs/docs/start/installer.md +++ b/docs/docs/start/installer.md @@ -151,6 +151,20 @@ inventree config All CLI settings are lost when the package is uninstalled. Use the config file where possible as it is kept on uninstall and can easily be synced across instances. Environment variables are a good place for passwords (but not the secret_key). +### Invoke + +Many InvenTree administration operations run using the `invoke` tool. When installed via the package installer, these commands can be called as follows: + +```bash +inventree run invoke +``` + +For example, to print InvenTree version information: + +```bash +inventree run invoke version +``` + ## Architecture The packages are provided by [packager.io](https://packager.io/). They are built each time updates are pushed to GitHub and released about 10 minutes later. The local package index must be updated to see the new release in the package manager.