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
Docksal RC Version #719
Docksal RC Version #719
Conversation
bin/fin
Outdated
URL_REPO_BACKDROP="https://github.com/docksal/example-backdrop.git" | ||
URL_ADDONS_HOSTING="https://raw.githubusercontent.com" | ||
URL_ADDONS_REPO="$URL_ADDONS_HOSTING/docksal/addons" | ||
REPO_OWNER="docksal" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of this constant? It's not like we are going to change it abruptly :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may not now correct, but it gives the ability for docksal to be forked and for people to eventually use their own repos with their own patches. At least that is where my thought is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we please revert the changes unrelated to Docksal RC Version for now?
bin/fin
Outdated
|
||
# Get information about that tag as we need to get the sha tag associated with that | ||
URL_REPO_TAG="${GITHUB_API}/repos/${REPO_URL}/git/refs/tags/${latest_tag}" | ||
local commit_sha=$(curl -sSL $URL_REPO_TAG | grep sha | sed 's/\"sha": \"\(.*\)",/\1/' | tr -d '[:space:]') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is there a need to get commit? You can just use tag name
https://raw.githubusercontent.com/docksal/docksal/${latest_tag}/bin/fin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@achekulaev documentation suggested I needed to get the SHA in order to get the file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to be working fine
https://raw.githubusercontent.com/docksal/docksal/v1.9.1/bin/fin
https://raw.githubusercontent.com/docksal/docksal/v1.9.0/bin/fin
https://raw.githubusercontent.com/docksal/docksal/v1.0.0/bin/fin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I checked and changed it but the github api documentation made it seem like I could ONLY use the hash not the tag is what I was saying.
bin/fin
Outdated
|
||
# Return the url for fin. If person has set DOCKSAL_USE_RC then we return that otherwise return masters URL | ||
# which will return the latest stable version. | ||
get_latest_version_fin () |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return the url for fin.
get_latest_fin_url
?
bin/fin
Outdated
@@ -4289,6 +4320,8 @@ check_for_updates () | |||
|
|||
# Check once bi-weekly | |||
next_check=$(( $last_check + ($one_week * 2) )) | |||
# Check once a day if DOCKSAL_USE_RC is set | |||
wants_rc_version && next_check=$(( $last_check + $one_day )) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic of the check_for_update
function can be tricky to read/recall so I would recommend lengthier syntax here
if wants_rc_version; then
# Check once a day if DOCKSAL_USE_RC is set
next_check=$(( $last_check + $one_day ))
else
# Check bi-weekly otherwise
next_check=$(( $last_check + ($one_week * 2) ))
fi
bin/fin
Outdated
@@ -6377,8 +6414,9 @@ case "$1" in | |||
elif [[ "$1" == "--project-images" ]]; then | |||
update_project_images | |||
elif [[ "$1" == "--self" ]]; then | |||
echo "Downloading $URL_FIN" | |||
curl -kfsSL "$URL_FIN?r=$RANDOM" | sudo tee "$FIN_PATH_UPDATED" >/dev/null | |||
fin_file_url=$(get_latest_version_fin) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable where get_latest_version_fin
result is stored is called fin_url
in the check_for_updates
function, for consistency it should be called the same here.
Added ability for users to select using the RC/Latest version of docksal by setting the
DOCKSAL_USE_RC=1
variable within their$HOME/.docksal/docksal.env
This assumes that we tag develop branch with
v1.10.0-rc1
this doesn't necessarily check to see if we using the-rcX
versioning but just grabs the latest "release" within github which corresponds with the latest tag.Solves #673