-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-24297 release scripts should be able to use an existing project clone #1725
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
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -389,6 +389,43 @@ function configure_maven { | |
| EOF | ||
| } | ||
|
|
||
| # clone of the repo, deleting anything that exists in the working directory named after the project. | ||
| # optionally with auth details for pushing. | ||
| function git_clone_overwrite { | ||
| local asf_repo | ||
| if [ -z "${PROJECT}" ] || [ "${PROJECT}" != "${PROJECT#/}" ]; then | ||
| error "Project name must be defined and not start with a '/'. PROJECT='${PROJECT}'" | ||
| fi | ||
| rm -rf "${PROJECT}" | ||
|
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. I am a bit nervous here about malformed project names like "../.." |
||
|
|
||
| if [[ -z "${GIT_REPO}" ]]; then | ||
| asf_repo="gitbox.apache.org/repos/asf/${PROJECT}.git" | ||
| echo "[INFO] clone will be of the gitbox repo for ${PROJECT}." | ||
| if [ -n "${ASF_USERNAME}" ] && [ -n "${ASF_PASSWORD}" ]; then | ||
| # Ugly! | ||
| encoded_username=$(python -c "import urllib; print urllib.quote('''$ASF_USERNAME''')") | ||
| encoded_password=$(python -c "import urllib; print urllib.quote('''$ASF_PASSWORD''')") | ||
| GIT_REPO="https://$encoded_username:$encoded_password@${asf_repo}" | ||
| else | ||
| GIT_REPO="https://${asf_repo}" | ||
| fi | ||
| else | ||
| echo "[INFO] clone will be of provided git repo." | ||
| fi | ||
| # N.B. we use the shared flag because the clone is short lived and if a local repo repo was | ||
busbey marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # given this will let us refer to objects there directly instead of hardlinks or copying. | ||
| # The option is silently ignored for non-local repositories. see the note on git help clone | ||
| # for the --shared option for details. | ||
busbey marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| git clone --shared -b "${GIT_BRANCH}" -- "${GIT_REPO}" "${PROJECT}" | ||
| # If this was a host local git repo then add in an alternates and remote that will | ||
| # work back on the host if the RM needs to do any post-processing steps, i.e. pushing the git tag | ||
busbey marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # for more info see 'git help remote' and 'git help repository-layout'. | ||
| if [ -n "$HOST_GIT_REPO" ]; then | ||
| echo "${HOST_GIT_REPO}/objects" >> "${PROJECT}/.git/objects/info/alternates" | ||
| (cd "${PROJECT}"; git remote add host "${HOST_GIT_REPO}") | ||
| fi | ||
| } | ||
|
|
||
| # Writes report into cwd! | ||
| function generate_api_report { | ||
| local project="$1" | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.