Skip to content

Commit b5f9fbb

Browse files
committed
[fix] Add OPENWISP_VERSION variable for version pinning
Introduces OPENWISP_VERSION environment variable to control image versions: - .env defaults to edge for development - auto-install.sh writes latest for production deployments - docker-compose.yml uses edge for all services - Makefile reads from .env and uses separate RELEASE_VERSION for releases Fixes #554
1 parent 9b93572 commit b5f9fbb

4 files changed

Lines changed: 19 additions & 19 deletions

File tree

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
DASHBOARD_DOMAIN=dashboard.openwisp.org
66
API_DOMAIN=api.openwisp.org
77
# Image tag pinning
8-
DOCKER_TAG=latest
8+
OPENWISP_VERSION=edge
99
# SSH Credentials Configurations
1010
SSH_PRIVATE_KEY_PATH=/home/openwisp/.ssh/id_ed25519
1111
SSH_PUBLIC_KEY_PATH=/home/openwisp/.ssh/id_ed25519.pub

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
include .env
55
export
66

7-
OPENWISP_VERSION = 25.10.0
7+
RELEASE_VERSION = 25.10.0
88
SHELL := /bin/bash
99
.SILENT: clean pull start stop
1010

@@ -23,7 +23,7 @@ pull:
2323
'openwisp-freeradius' 'openwisp-nginx' 'openwisp-openvpn' 'openwisp-postfix' \
2424
'openwisp-websocket' ; do \
2525
docker pull --quiet $(USER)/$${image}:$(TAG); \
26-
docker tag $(USER)/$${image}:$(TAG) openwisp/$${image}:$${DOCKER_TAG:-latest}; \
26+
docker tag $(USER)/$${image}:$(TAG) openwisp/$${image}:$${OPENWISP_VERSION:-edge}; \
2727
done
2828

2929
# Build
@@ -120,4 +120,4 @@ publish:
120120

121121
release:
122122
make publish TAG=latest SKIP_TESTS=true
123-
make publish TAG=$(OPENWISP_VERSION) SKIP_BUILD=true SKIP_TESTS=true
123+
make publish TAG=$(RELEASE_VERSION) SKIP_BUILD=true SKIP_TESTS=true

deploy/auto-install.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ get_version_from_user() {
6262
echo -ne ${GRN}"OpenWISP Version (leave blank for latest): "${NON}
6363
read openwisp_version
6464
if [[ -z "$openwisp_version" ]]; then
65-
openwisp_version=$(curl -L --silent https://api.github.com/repos/openwisp/docker-openwisp/releases/latest | jq -r .tag_name)
65+
openwisp_version="latest"
6666
fi
6767
}
6868

@@ -128,7 +128,7 @@ setup_docker_openwisp() {
128128

129129
cd $INSTALL_PATH &>>$LOG_FILE
130130
check_status $? "docker-openwisp download failed."
131-
echo $openwisp_version >$INSTALL_PATH/VERSION
131+
set_env "OPENWISP_VERSION" "$openwisp_version"
132132

133133
if [[ ! -f "$env_path" ]]; then
134134
# Dashboard Domain
@@ -179,7 +179,7 @@ setup_docker_openwisp() {
179179
start_step "Configuring docker-openwisp..."
180180
report_ok
181181
start_step "Starting images docker-openwisp (this will take a while)..."
182-
make start TAG=$(cat $INSTALL_PATH/VERSION) -C $INSTALL_PATH/ &>>$LOG_FILE
182+
make start -C $INSTALL_PATH/ &>>$LOG_FILE
183183
check_status $? "Starting openwisp failed."
184184
}
185185

@@ -192,7 +192,7 @@ upgrade_docker_openwisp() {
192192

193193
cd $INSTALL_PATH &>>$LOG_FILE
194194
check_status $? "docker-openwisp download failed."
195-
echo $openwisp_version >$INSTALL_PATH/VERSION
195+
set_env "OPENWISP_VERSION" "$openwisp_version"
196196

197197
start_step "Configuring docker-openwisp..."
198198
for config in $(grep '=' $ENV_BACKUP | cut -f1 -d'='); do
@@ -202,7 +202,7 @@ upgrade_docker_openwisp() {
202202
report_ok
203203

204204
start_step "Starting images docker-openwisp (this will take a while)..."
205-
make start TAG=$(cat $INSTALL_PATH/VERSION) -C $INSTALL_PATH/ &>>$LOG_FILE
205+
make start -C $INSTALL_PATH/ &>>$LOG_FILE
206206
check_status $? "Starting openwisp failed."
207207
}
208208

docker-compose.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ x-celery-depends-on: &celery-depends-on
1212

1313
services:
1414
dashboard:
15-
image: openwisp/openwisp-dashboard:${DOCKER_TAG:-latest}
15+
image: openwisp/openwisp-dashboard:${OPENWISP_VERSION:-edge}
1616
restart: always
1717
build:
1818
context: images
@@ -35,7 +35,7 @@ services:
3535
- influxdb
3636

3737
api:
38-
image: openwisp/openwisp-api:${DOCKER_TAG:-latest}
38+
image: openwisp/openwisp-api:${OPENWISP_VERSION:-edge}
3939
restart: always
4040
build:
4141
context: images
@@ -55,7 +55,7 @@ services:
5555
- dashboard
5656

5757
websocket:
58-
image: openwisp/openwisp-websocket:${DOCKER_TAG:-latest}
58+
image: openwisp/openwisp-websocket:${OPENWISP_VERSION:-edge}
5959
restart: always
6060
build:
6161
context: images
@@ -70,7 +70,7 @@ services:
7070
- dashboard
7171

7272
celery:
73-
image: openwisp/openwisp-dashboard:${DOCKER_TAG:-latest}
73+
image: openwisp/openwisp-dashboard:${OPENWISP_VERSION:-edge}
7474
restart: always
7575
environment:
7676
- MODULE_NAME=celery
@@ -85,7 +85,7 @@ services:
8585
network_mode: "${CELERY_SERVICE_NETWORK_MODE-service:openvpn}"
8686

8787
celery_monitoring:
88-
image: openwisp/openwisp-dashboard:${DOCKER_TAG:-latest}
88+
image: openwisp/openwisp-dashboard:${OPENWISP_VERSION:-edge}
8989
restart: always
9090
environment:
9191
- MODULE_NAME=celery_monitoring
@@ -99,7 +99,7 @@ services:
9999
network_mode: "${CELERY_SERVICE_NETWORK_MODE-service:openvpn}"
100100

101101
celerybeat:
102-
image: openwisp/openwisp-dashboard:${DOCKER_TAG:-latest}
102+
image: openwisp/openwisp-dashboard:${OPENWISP_VERSION:-edge}
103103
restart: always
104104
environment:
105105
- MODULE_NAME=celerybeat
@@ -113,7 +113,7 @@ services:
113113
- dashboard
114114

115115
nginx:
116-
image: openwisp/openwisp-nginx:${DOCKER_TAG:-latest}
116+
image: openwisp/openwisp-nginx:${OPENWISP_VERSION:-edge}
117117
restart: always
118118
build:
119119
context: images
@@ -140,7 +140,7 @@ services:
140140
- websocket
141141

142142
freeradius:
143-
image: openwisp/openwisp-freeradius:${DOCKER_TAG:-latest}
143+
image: openwisp/openwisp-freeradius:${OPENWISP_VERSION:-edge}
144144
restart: always
145145
build:
146146
context: images
@@ -156,7 +156,7 @@ services:
156156
- dashboard
157157

158158
postfix:
159-
image: openwisp/openwisp-postfix:${DOCKER_TAG:-latest}
159+
image: openwisp/openwisp-postfix:${OPENWISP_VERSION:-edge}
160160
restart: always
161161
build:
162162
context: images
@@ -167,7 +167,7 @@ services:
167167
- openwisp_certs:/etc/ssl/mail
168168

169169
openvpn:
170-
image: openwisp/openwisp-openvpn:${DOCKER_TAG:-latest}
170+
image: openwisp/openwisp-openvpn:${OPENWISP_VERSION:-edge}
171171
restart: on-failure
172172
build:
173173
context: images

0 commit comments

Comments
 (0)