Skip to content
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
6 changes: 3 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ set -o errexit

# Install Poetry, a dependency management, packaging, and build system.
# Uninstall legacy/transitional Poetry version of 1.1.15
PATH="$HOME/.local/bin:$PATH" # account for more constrained environments.
PATH="$HOME/.local/bin:$PATH" # ensure legacy path.
if which poetry && poetry --version | grep -q "1.1.15"; then
echo "Poetry version 1.1.15 found - UNINSTALLING"
curl -sSL https://install.python-poetry.org | python3 - --uninstall
rm --force /root/.local/bin/poetry # remove dangling dead link.
fi
PATH="${PATH//'/root/.local/bin:'/''}" # null all legacy poetry paths
# We are run, outside of development, only by RPM's %posttrans.
# We are run by rockstor-build.service.
# As such our .venv dir has already been removed in %post (update mode).
echo "Unset VIRTUAL_ENV"
# Redundant when updating from rockstor 5.0.3-0 onwards: src/rockstor/system/pkg_mgmt.py
Expand Down Expand Up @@ -88,7 +88,7 @@ export Environment="PASSWORD_STORE_DIR=/root/.password-store"
# Additional collectstatic options --clear --dry-run
export DJANGO_SETTINGS_MODULE=settings
# must be run in project root:
/usr/local/bin/poetry run django-admin collectstatic --no-input --verbosity 2
poetry run django-admin collectstatic --no-input --verbosity 2
echo

echo "ROCKSTOR BUILD SCRIPT COMPLETED"
Expand Down
21 changes: 21 additions & 0 deletions conf/rockstor-build.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[Unit]
Description=Build Rockstor
ConditionPathIsDirectory=!/opt/rockstor/.venv
After=postgresql.service
After=NetworkManager.service
After=NetworkManager-wait-online.service
Requires=postgresql.service
Requires=NetworkManager.service
# https://pypi.org/ to install/update Poetry, & have it build/rebuild .venv.
Requires=NetworkManager-wait-online.service

[Service]
Environment="DJANGO_SETTINGS_MODULE=settings"
Environment="PASSWORD_STORE_DIR=/root/.password-store"
WorkingDirectory=/opt/rockstor
ExecStart=/opt/rockstor/build.sh
Type=oneshot
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
2 changes: 2 additions & 0 deletions conf/rockstor-pre.service
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
[Unit]
Description=Tasks required prior to starting Rockstor
After=rockstor-build.service
After=postgresql.service
After=NetworkManager.service
Requires=rockstor-build.service
Requires=postgresql.service
Requires=NetworkManager.service

Expand Down
1 change: 1 addition & 0 deletions src/rockstor/scripts/initrock.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
SYSTEMD_OVERRIDE_DIR = "/etc/systemd/system"

ROCKSTOR_SYSTEMD_SERVICES = [
"rockstor-build.service", # Build/Rebuild .venv & jslibs, init `pass`.
"rockstor-pre.service", # Loads us (initrock.py).
"rockstor.service",
"rockstor-bootstrap.service",
Expand Down
2 changes: 1 addition & 1 deletion src/rockstor/system/pkg_mgmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ def update_run(subscription=None, update_all_other=False):
# Unset inherited VIRTUAL_ENV environmental variable before invoking rpm/zypper
atfo.write("unset VIRTUAL_ENV\n")
atfo.write(pkg_in_up_rockstor)
# rockstor-bootstrap Requires rockstor which Requires rockstor-pre (initrock)
# rockstor-bootstrap Requires rockstor which Requires rockstor-pre (initrock) which Requires rockstor-build
atfo.write("{} start rockstor-bootstrap\n".format(SYSTEMCTL))
else: # update_all_other True so update all bar the rockstor package.
logger.info(
Expand Down