-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-13474][PROJECT INFRA] Update packaging scripts to push artifacts to home.apache.org #11350
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
JoshRosen
wants to merge
15
commits into
apache:master
from
JoshRosen:update-release-scripts-for-apache-home
Closed
Changes from 10 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
4d07db4
Chages for people.apache.org -> home.apache.org migration.
JoshRosen a458221
Remove auto-confirm.
JoshRosen 3a7b283
Configure SSH options for lftp.
JoshRosen 19d6e22
Allow parameter substitution in COMMANDS heredoc.
JoshRosen e43f7ac
mput syntax fix.
JoshRosen 1bb9e02
use rm -f
JoshRosen 52fedd0
Fixes to removal of old directories.
JoshRosen fc80ac7
Reverse sort order.
JoshRosen 1aed97e
Try to work around lack of symlink support in FTP.
JoshRosen fde8346
Debug flags.
JoshRosen b73a471
Exit 0 in rm.
JoshRosen 9ef4561
Let lftp do glob expansion.
JoshRosen 36c3466
&& -> ||
JoshRosen e448ae6
Try using put instead of mput for docs.
JoshRosen dd2766a
Try using lftp mirror instead
JoshRosen 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,8 +23,8 @@ usage: release-build.sh <package|docs|publish-snapshot|publish-release> | |
| Creates build deliverables from a Spark commit. | ||
|
|
||
| Top level targets are | ||
| package: Create binary packages and copy them to people.apache | ||
| docs: Build docs and copy them to people.apache | ||
| package: Create binary packages and copy them to home.apache | ||
| docs: Build docs and copy them to home.apache | ||
| publish-snapshot: Publish snapshot release to Apache snapshots | ||
| publish-release: Publish a release to Apache release repo | ||
|
|
||
|
|
@@ -64,13 +64,16 @@ for env in ASF_USERNAME ASF_RSA_KEY GPG_PASSPHRASE GPG_KEY; do | |
| fi | ||
| done | ||
|
|
||
| # Explicitly set locale in order to make `sort` output consistent across machines. | ||
| # See https://stackoverflow.com/questions/28881 for more details. | ||
| export LC_ALL=C | ||
|
|
||
| # Commit ref to checkout when building | ||
| GIT_REF=${GIT_REF:-master} | ||
|
|
||
| # Destination directory parent on remote server | ||
| REMOTE_PARENT_DIR=${REMOTE_PARENT_DIR:-/home/$ASF_USERNAME/public_html} | ||
|
|
||
| SSH="ssh -o ConnectTimeout=300 -o StrictHostKeyChecking=no -i $ASF_RSA_KEY" | ||
| GPG="gpg --no-tty --batch" | ||
| NEXUS_ROOT=https://repository.apache.org/service/local/staging | ||
| NEXUS_PROFILE=d63f592e7eac0 # Profile for Spark staging uploads | ||
|
|
@@ -97,18 +100,35 @@ if [ -z "$SPARK_PACKAGE_VERSION" ]; then | |
| fi | ||
|
|
||
| DEST_DIR_NAME="spark-$SPARK_PACKAGE_VERSION" | ||
| USER_HOST="[email protected]" | ||
|
|
||
| function LFTP { | ||
| SSH="ssh -o ConnectTimeout=300 -o StrictHostKeyChecking=no -i $ASF_RSA_KEY" | ||
| COMMANDS=$(cat <<EOF | ||
| set net:max-retries 1 && | ||
| set sftp:connect-program $SSH && | ||
| connect -u $ASF_USERNAME,p sftp://home.apache.org && | ||
| $@ | ||
| EOF | ||
| ) | ||
| lftp --norc -c "$COMMANDS" | ||
| } | ||
| export -f LFTP | ||
|
|
||
|
|
||
| git clean -d -f -x | ||
| rm .gitignore | ||
| rm -rf .git | ||
| cd .. | ||
|
|
||
| if [ -n "$REMOTE_PARENT_MAX_LENGTH" ]; then | ||
| old_dirs=$($SSH $USER_HOST ls -t $REMOTE_PARENT_DIR | tail -n +$REMOTE_PARENT_MAX_LENGTH) | ||
| old_dirs=$( | ||
| LFTP nlist $REMOTE_PARENT_DIR \ | ||
| | grep -v "^\." \ | ||
| | sort -r \ | ||
| | tail -n +$REMOTE_PARENT_MAX_LENGTH) | ||
| for old_dir in $old_dirs; do | ||
| echo "Removing directory: $old_dir" | ||
| $SSH $USER_HOST rm -r $REMOTE_PARENT_DIR/$old_dir | ||
| LFTP rm -rf $REMOTE_PARENT_DIR/$old_dir | ||
| done | ||
| fi | ||
|
|
||
|
|
@@ -178,11 +198,17 @@ if [[ "$1" == "package" ]]; then | |
| # Copy data | ||
| dest_dir="$REMOTE_PARENT_DIR/${DEST_DIR_NAME}-bin" | ||
| echo "Copying release tarballs to $dest_dir" | ||
| $SSH $USER_HOST mkdir $dest_dir | ||
| rsync -e "$SSH" spark-* $USER_HOST:$dest_dir | ||
| echo "Linking /latest to $dest_dir" | ||
| $SSH $USER_HOST rm -f "$REMOTE_PARENT_DIR/latest" | ||
| $SSH $USER_HOST ln -s $dest_dir "$REMOTE_PARENT_DIR/latest" | ||
| set -x | ||
| # Put to new directory: | ||
| LFTP mkdir -p $dest_dir | ||
| LFTP mput -O $dest_dir spark-* | ||
| # Delete /latest directory and rename new upload to /latest | ||
| LFTP rm -rf "$REMOTE_PARENT_DIR/latest" | ||
| LFTP mv $dest_dir "$REMOTE_PARENT_DIR/latest" | ||
| # Re-upload a second time and leave the files in the timestamped upload directory: | ||
| LFTP mkdir -p $dest_dir | ||
| LFTP mput -O $dest_dir spark-* | ||
| set +x | ||
| exit 0 | ||
| fi | ||
|
|
||
|
|
@@ -196,11 +222,15 @@ if [[ "$1" == "docs" ]]; then | |
| # TODO: Make configurable to add this: PRODUCTION=1 | ||
| PRODUCTION=1 RELEASE_VERSION="$SPARK_VERSION" jekyll build | ||
| echo "Copying release documentation to $dest_dir" | ||
| $SSH $USER_HOST mkdir $dest_dir | ||
| echo "Linking /latest to $dest_dir" | ||
| $SSH $USER_HOST rm -f "$REMOTE_PARENT_DIR/latest" | ||
| $SSH $USER_HOST ln -s $dest_dir "$REMOTE_PARENT_DIR/latest" | ||
| rsync -e "$SSH" -r _site/* $USER_HOST:$dest_dir | ||
| # Put to new directory: | ||
| LFTP mkdir -p $dest_dir | ||
| LFTP mput -O $dest_dir _site/* | ||
| # Delete /latest directory and rename new upload to /latest | ||
| LFTP rm -rf "$REMOTE_PARENT_DIR/latest" | ||
| LFTP mv $dest_dir "$REMOTE_PARENT_DIR/latest" | ||
| # Re-upload a second time and leave the files in the timestamped upload directory: | ||
| LFTP mkdir -p $dest_dir | ||
| LFTP mput -O $dest_dir _site/* | ||
| cd .. | ||
| exit 0 | ||
| fi | ||
|
|
||
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.
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.
I might need to quote the
spark-*so that the parameter expansion is done bylftprather than the shell.