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

Docksal RC Version #719

Merged
merged 7 commits into from Jul 23, 2018
Merged

Docksal RC Version #719

merged 7 commits into from Jul 23, 2018

Conversation

sean-e-dietrich
Copy link
Member

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

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"
Copy link
Member

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 :)

Copy link
Member Author

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.

Copy link
Member

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:]')
Copy link
Member

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

Copy link
Member Author

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

Copy link
Member

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

Copy link
Member Author

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 ()
Copy link
Member

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 ))
Copy link
Member

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)
Copy link
Member

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.

@achekulaev achekulaev merged commit ddb542b into develop Jul 23, 2018
@achekulaev achekulaev deleted the rc_test branch July 23, 2018 17:15
@lmakarov lmakarov mentioned this pull request Jul 31, 2018
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

2 participants