Skip to content
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

Support pinning version during binary install #1237

Merged
merged 4 commits into from
Oct 24, 2023

Conversation

glemsom
Copy link
Contributor

@glemsom glemsom commented Oct 21, 2023

Support for specific version installation

For installations using the binary release method (using the official installer script), it would be nice to be able to define a specific version to install.

A user/developer can choose to define the NETBIRD_RELEASE variable during installation, to pin a specific version during installation.
If NETBIRD_RELEASE is not defined, we default to the current behavior of latest

Example usage (once merged)

export SKIP_UI_APP=true; export NETBIRD_RELEASE=v0.23.7; curl https://pkgs.netbird.io/install.sh | sh

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

@CLAassistant
Copy link

CLAassistant commented Oct 21, 2023

CLA assistant check
All committers have signed the CLA.

@mlsmaycon
Copy link
Collaborator

Hello @glemsom, thanks for your contribution.

Please check the annotations from Codacy regarding double quotes and we should be good to go.

@glemsom
Copy link
Contributor Author

glemsom commented Oct 23, 2023

Hello @glemsom, thanks for your contribution.

Please check the annotations from Codacy regarding double quotes and we should be good to go.

Ahh missed that variable.
Fixed in e7f70fc

release_files/install.sh Outdated Show resolved Hide resolved
As per Maycon's suggestion
@@ -23,19 +23,28 @@ if command -v sudo > /dev/null && [ "$(id -u)" -ne 0 ]; then
SUDO="sudo"
fi

get_latest_release() {
if [ -z ${NETBIRD_RELEASE+x} ]; then
Copy link
Collaborator

@mlsmaycon mlsmaycon Oct 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be failing. Can you try the following?

Suggested change
if [ -z ${NETBIRD_RELEASE+x} ]; then
if [ "x-$NETBIRD_RELEASE" = "x-" ]; then


get_release() {
local RELEASE=$1
if [ "$RELEASE" == "latest" ]; then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if [ "$RELEASE" == "latest" ]; then
if [ "$RELEASE" = "latest" ]; then

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late reply.
You're right. I only tested my change with bash.
I read through the workflows, and see we test using ubuntu:latest, which default to dash as shell - which in return does not support the "double equal-sign" that bash does.
Sorry about that !

(I've now imported your validation actions to my fork) 😄

We should for sure keep the validation action as-is, as it mimic the current recommended one-line installation behavior on the website. (I should just have tested my change better!)

This is now corrected to be POSIX compatible. (efc8164)
I imported the validation workflows to my fork - seems to go through now :)

@braginini
Copy link
Contributor

braginini commented Oct 24, 2023

@glemsom
I'm not coming here with a review of the PR. I just wanted to personally say Thank You for the contribution :) The whole NetBird team appreciates it!

Copy link
Collaborator

@mlsmaycon mlsmaycon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @glemsom, that's a great improvement.

@mlsmaycon mlsmaycon merged commit e7d52be into netbirdio:main Oct 24, 2023
27 checks passed
@glemsom
Copy link
Contributor Author

glemsom commented Oct 25, 2023

You are welcome. And thanks for an awesome product :)

@glemsom glemsom deleted the feature_support_specific_version branch October 25, 2023 04:06
pulsastrix pushed a commit to pulsastrix/netbird that referenced this pull request Dec 24, 2023
For installations using the binary release method (using the official installer script), it would be nice to be able to define a specific version to install.

A user/developer can choose to define the NETBIRD_RELEASE variable during installation, to pin a specific version during installation.
If NETBIRD_RELEASE is not defined, we default to the current behavior of latest
Foosec pushed a commit to Foosec/netbird that referenced this pull request May 8, 2024
For installations using the binary release method (using the official installer script), it would be nice to be able to define a specific version to install.

A user/developer can choose to define the NETBIRD_RELEASE variable during installation, to pin a specific version during installation.
If NETBIRD_RELEASE is not defined, we default to the current behavior of latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants