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
19 changes: 9 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:
echo "127.0.0.1 dashboard.openwisp.org api.openwisp.org" | sudo tee -a /etc/hosts
# disable metric collection during builds
sed -i 's/METRIC_COLLECTION=True/METRIC_COLLECTION=False/' .env
# ERROR: Cannot uninstall urllib3 2.0.7, RECORD file not found. Hint: The package was installed by debian.
sudo apt remove python3-urllib3 python3-typing-extensions
sudo pip3 install -r requirements-test.txt

- name: QA checks
Expand All @@ -35,12 +37,10 @@ jobs:
- name: Use the auto-install script to start containers with edge images
id: auto_install_edge
if: ${{ !cancelled() && steps.deps.conclusion == 'success' }}
run: |
(sudo -E ./deploy/auto-install.sh <<EOF
edge
./.env
EOF
) || (docker compose --file /opt/openwisp/docker-openwisp/docker-compose.yml logs && exit 1)
run: echo "first auto-install.sh run temporarily disabled"
# run: |
# printf "edge\n./.env\n" | sudo -E ./deploy/auto-install.sh \
# || (docker compose --file /opt/openwisp/docker-openwisp/docker-compose.yml logs && exit 1)

- name: Build Images
id: build_images
Expand All @@ -65,10 +65,9 @@ jobs:
if: ${{ !cancelled() && steps.set_git_branch.conclusion == 'success' }}
# Do not remove the blank lines from the input.
run: |
(GIT_BRANCH="${GIT_BRANCH}" SKIP_PULL=true sudo -E ./deploy/auto-install.sh --upgrade <<EOF
latest
EOF
) || (cat /opt/openwisp/autoinstall.log && exit 1)
printf "latest\n" | \
GIT_BRANCH="${GIT_BRANCH}" SKIP_PULL=true sudo -E ./deploy/auto-install.sh --upgrade \
|| (cat /opt/openwisp/autoinstall.log && exit 1)

- name: Test
if: ${{ !cancelled() && steps.auto_install_upgrade.conclusion == 'success' }}
Expand Down
8 changes: 6 additions & 2 deletions images/common/collectstatic.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def get_pip_freeze_hash():
def run_collectstatic():
try:
subprocess.run(
["python", "manage.py", "collectstatic", "--noinput"], check=True
[sys.executable, "manage.py", "collectstatic", "--noinput"], check=True
)
except subprocess.CalledProcessError as e:
print(f"Error running 'collectstatic': {e}", file=sys.stderr)
Expand All @@ -43,9 +43,13 @@ def main():
redis_connection = redis.Redis.from_url(settings.CACHES["default"]["LOCATION"])
current_pip_hash = get_pip_freeze_hash()
cached_pip_hash = redis_connection.get("pip_freeze_hash")
if cached_pip_hash is None or cached_pip_hash.decode() != current_pip_hash:
if not cached_pip_hash or cached_pip_hash.decode() != current_pip_hash:
print("Changes in Python dependencies detected, running collectstatic...")
run_collectstatic()
redis_connection.set("pip_freeze_hash", current_pip_hash)
else:
print("No changes in Python dependencies, skipping collectstatic...")


if __name__ == "__main__":
main()
10 changes: 5 additions & 5 deletions images/openwisp_nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM nginx:1.27.5-alpine
FROM nginx:1.29.0-alpine

RUN apk add --update --no-cache \
openssl~=3.3.3-r0 \
py3-pip~=24.3.1-r0 \
certbot~=3.0.1-r0 \
certbot-nginx~=3.0.1-r0 && \
openssl~=3.5.1-r0 \
py3-pip~=25.1.1-r0 \
certbot~=4.0.0-r0 \
certbot-nginx~=4.0.0-r1 && \
rm -rf /var/cache/apk/* /tmp/*

WORKDIR /etc/nginx/
Expand Down
4 changes: 2 additions & 2 deletions images/openwisp_postfix/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ FROM alpine:3.22

WORKDIR /opt/openwisp/
RUN apk add --no-cache --upgrade \
openssl~=3.5.0-r0 \
openssl~=3.5.1-r0 \
cyrus-sasl~=2.1.28-r8 \
cyrus-sasl-login~=2.1.28-r8 && \
apk add --no-cache \
postfix~=3.10.2-r0 \
postfix~=3.10.3-r0 \
rsyslog~=8.2410.0-r1 \
tzdata~=2025b-r0 && \
rm -rf /tmp/* /var/cache/apk/*
Expand Down