-
-
Notifications
You must be signed in to change notification settings - Fork 114
[fix] Added DOCKER_TAG variable for version pinning to match intended release version #555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
89e27f0
a4f27a0
1163d9f
0e2f706
aa3db97
064b758
9b93572
b6b4e6f
23dd5bc
7d6f768
3842b37
7e2f422
d135571
239a466
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
atif09 marked this conversation as resolved.
Show resolved
Hide resolved
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,21 @@ | ||
| # Find documentation in README.md under | ||
| # the heading "Makefile Options". | ||
|
|
||
| OPENWISP_VERSION = 25.10.0 | ||
| include .env # The .env file can override ?= variables in the Makefile (e.g. OPENWISP_VERSION, IMAGE_OWNER) | ||
|
|
||
| # RELEASE_VERSION: version string used when tagging a new release. | ||
| RELEASE_VERSION = 25.10.0 | ||
| SHELL := /bin/bash | ||
| .SILENT: clean pull start stop | ||
|
|
||
| default: compose-build | ||
atif09 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| USER = registry.gitlab.com/openwisp/docker-openwisp | ||
| TAG = edge | ||
| # OPENWISP_VERSION: image tag used for pulling/pushing images (e.g. "edge", "latest", "25.10.0") | ||
| # Can be overridden via .env or command line. Not the same as RELEASE_VERSION | ||
| OPENWISP_VERSION ?= edge | ||
| IMAGE_OWNER ?= openwisp | ||
|
Comment on lines
+17
to
+18
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @atif09 what is the difference between
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| SKIP_PULL ?= false | ||
| SKIP_BUILD ?= false | ||
| SKIP_TESTS ?= false | ||
|
|
@@ -19,8 +26,8 @@ pull: | |
| for image in 'openwisp-base' 'openwisp-nfs' 'openwisp-api' 'openwisp-dashboard' \ | ||
| 'openwisp-freeradius' 'openwisp-nginx' 'openwisp-openvpn' 'openwisp-postfix' \ | ||
| 'openwisp-websocket' ; do \ | ||
| docker pull --quiet $(USER)/$${image}:$(TAG); \ | ||
| docker tag $(USER)/$${image}:$(TAG) openwisp/$${image}:latest; \ | ||
| docker pull --quiet $(USER)/$${image}:$(OPENWISP_VERSION); \ | ||
| docker tag $(USER)/$${image}:$(OPENWISP_VERSION) $(IMAGE_OWNER)/$${image}:$(OPENWISP_VERSION); \ | ||
| done | ||
|
|
||
| # Build | ||
|
|
@@ -41,11 +48,13 @@ base-build: | |
| $$BUILD_ARGS; \ | ||
| docker build --tag openwisp/openwisp-base:latest \ | ||
| --file ./images/openwisp_base/Dockerfile ./images/ \ | ||
| $$BUILD_ARGS | ||
| $$BUILD_ARGS; \ | ||
| docker tag openwisp/openwisp-base:latest $(IMAGE_OWNER)/openwisp-base:$(OPENWISP_VERSION) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand this change. Why is this required?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. without this
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. because |
||
|
|
||
| nfs-build: | ||
| docker build --tag openwisp/openwisp-nfs:latest \ | ||
| --file ./images/openwisp_nfs/Dockerfile ./images/ | ||
| --file ./images/openwisp_nfs/Dockerfile ./images/; \ | ||
| docker tag openwisp/openwisp-nfs:latest $(IMAGE_OWNER)/openwisp-nfs:$(OPENWISP_VERSION) | ||
|
|
||
| compose-build: base-build | ||
| docker compose build --parallel | ||
|
|
@@ -76,6 +85,8 @@ clean: | |
| openwisp/openwisp-base:intermedia-system \ | ||
| openwisp/openwisp-base:intermedia-python \ | ||
| openwisp/openwisp-nfs:latest \ | ||
| $(IMAGE_OWNER)/openwisp-base:$(OPENWISP_VERSION) \ | ||
| $(IMAGE_OWNER)/openwisp-nfs:$(OPENWISP_VERSION) \ | ||
| `docker images -f "dangling=true" -q` \ | ||
| `docker images | grep openwisp/docker-openwisp | tr -s ' ' | cut -d ' ' -f 3` &> /dev/null | ||
|
|
||
|
|
@@ -105,16 +116,13 @@ publish: | |
| for image in 'openwisp-base' 'openwisp-nfs' 'openwisp-api' 'openwisp-dashboard' \ | ||
| 'openwisp-freeradius' 'openwisp-nginx' 'openwisp-openvpn' 'openwisp-postfix' \ | ||
| 'openwisp-websocket' ; do \ | ||
| # Docker images built locally are tagged "latest" by default. \ | ||
| # This script updates the tag of each built image to a user-defined tag \ | ||
| # and pushes the newly tagged image to a Docker registry under the user's namespace. \ | ||
| docker tag openwisp/$${image}:latest $(USER)/$${image}:$(TAG); \ | ||
| docker tag $(IMAGE_OWNER)/$${image}:$(OPENWISP_VERSION) $(USER)/$${image}:$(TAG); \ | ||
| docker push $(USER)/$${image}:$(TAG); \ | ||
| if [ "$(TAG)" != "latest" ]; then \ | ||
| docker rmi $(USER)/$${image}:$(TAG); \ | ||
| fi; \ | ||
| done | ||
|
|
||
| release: | ||
| make publish TAG=latest SKIP_TESTS=true | ||
| make publish TAG=$(OPENWISP_VERSION) SKIP_BUILD=true SKIP_TESTS=true | ||
| make publish TAG=latest OPENWISP_VERSION=$(RELEASE_VERSION) SKIP_TESTS=true | ||
| make publish TAG=$(RELEASE_VERSION) OPENWISP_VERSION=$(RELEASE_VERSION) SKIP_BUILD=true SKIP_TESTS=true | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,11 +59,11 @@ apt_dependenices_setup() { | |
| } | ||
|
|
||
| get_version_from_user() { | ||
| echo -ne ${GRN}"OpenWISP Version (leave blank for latest): "${NON} | ||
| read openwisp_version | ||
| if [[ -z "$openwisp_version" ]]; then | ||
| openwisp_version=$(curl -L --silent https://api.github.com/repos/openwisp/docker-openwisp/releases/latest | jq -r .tag_name) | ||
| fi | ||
| echo -ne ${GRN}"OpenWISP Version (leave blank for latest stable release): "${NON} | ||
| read openwisp_version | ||
| if [[ -z "$openwisp_version" ]]; then | ||
| openwisp_version=$(curl -L --silent https://api.github.com/repos/openwisp/docker-openwisp/releases/latest | jq -r .tag_name) | ||
| fi | ||
|
Comment on lines
-62
to
+66
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we get rid of blank space changes?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will remove them |
||
| } | ||
|
|
||
| setup_docker() { | ||
|
|
@@ -128,7 +128,7 @@ setup_docker_openwisp() { | |
|
|
||
| cd $INSTALL_PATH &>>$LOG_FILE | ||
| check_status $? "docker-openwisp download failed." | ||
| echo $openwisp_version >$INSTALL_PATH/VERSION | ||
| set_env "OPENWISP_VERSION" "$openwisp_version" | ||
|
|
||
| if [[ ! -f "$env_path" ]]; then | ||
| # Dashboard Domain | ||
|
|
@@ -179,7 +179,7 @@ setup_docker_openwisp() { | |
| start_step "Configuring docker-openwisp..." | ||
| report_ok | ||
| start_step "Starting images docker-openwisp (this will take a while)..." | ||
| make start TAG=$(cat $INSTALL_PATH/VERSION) -C $INSTALL_PATH/ &>>$LOG_FILE | ||
| make start -C $INSTALL_PATH/ &>>$LOG_FILE | ||
| check_status $? "Starting openwisp failed." | ||
| } | ||
|
|
||
|
|
@@ -192,7 +192,7 @@ upgrade_docker_openwisp() { | |
|
|
||
| cd $INSTALL_PATH &>>$LOG_FILE | ||
| check_status $? "docker-openwisp download failed." | ||
| echo $openwisp_version >$INSTALL_PATH/VERSION | ||
| set_env "OPENWISP_VERSION" "$openwisp_version" | ||
|
|
||
| start_step "Configuring docker-openwisp..." | ||
| for config in $(grep '=' $ENV_BACKUP | cut -f1 -d'='); do | ||
|
|
@@ -202,7 +202,7 @@ upgrade_docker_openwisp() { | |
| report_ok | ||
|
|
||
| start_step "Starting images docker-openwisp (this will take a while)..." | ||
| make start TAG=$(cat $INSTALL_PATH/VERSION) -C $INSTALL_PATH/ &>>$LOG_FILE | ||
| make start -C $INSTALL_PATH/ &>>$LOG_FILE | ||
| check_status $? "Starting openwisp failed." | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.