-
Notifications
You must be signed in to change notification settings - Fork 50
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
WIP review draft deploy #201
Changes from 4 commits
6f7eced
a5fdc6f
6c16252
4a5ea80
e4d876b
637b32c
ed87fbd
26654bc
96e562b
dff2c51
b17a8b2
feb090d
d580f8d
352416b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ LS_URL="https://$SHORTNAME.spec.whatwg.org/" | |
COMMIT_URL_BASE="https://github.com/whatwg/$SHORTNAME/commit/" | ||
WEB_ROOT="$SHORTNAME.spec.whatwg.org" | ||
COMMITS_DIR="commit-snapshots" | ||
REVIEW_DRAFTS_DIR="review-drafts" | ||
|
||
# Optional environment variables (won't be set for local deploys) | ||
TRAVIS=${TRAVIS:-false} | ||
|
@@ -111,6 +112,32 @@ run_post_build_step "$WEB_ROOT" | |
echo "Living standard output to $WEB_ROOT" | ||
echo "" | ||
|
||
header "Starting review drafts..." | ||
echo "Note: review drafts must be added or changed in a single commit on master" | ||
for f in "$REVIEW_DRAFTS_DIR"/*.bs; do | ||
[ -e "$f" ] || continue # http://mywiki.wooledge.org/BashPitfalls#line-80 | ||
if [[ "$TRAVIS_PULL_REQUEST" == "true" ]]; then | ||
CHANGED_FILES=$(git diff --name-only master..HEAD) | ||
else | ||
CHANGED_FILES=$(git diff --name-only HEAD~1) | ||
fi | ||
for change in $CHANGED_FILES; do # Omit quotes around variable to split on whitespace | ||
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. FWIW we should probably stick to uppercase everywhere, I was just copying and pasting from places that did lowercase. |
||
if [[ "$f" != "$change" ]]; then | ||
continue | ||
fi | ||
echo "" | ||
BASENAME=$(basename "$f" .bs) | ||
DRAFT_DIR="$WEB_ROOT/$REVIEW_DRAFTS_DIR/$BASENAME" | ||
mkdir -p "$DRAFT_DIR" | ||
curlbikeshed -F md-Status="RD" \ | ||
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. Should this be whatwg/RD? 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. Nah, since we're already in the WHATWG org, just the status suffices. |
||
> "$DRAFT_DIR/index.html" | ||
copy_extra_files "$DRAFT_DIR" | ||
run_post_build_step "$DRAFT_DIR" | ||
echo "Review draft output to $DRAFT_DIR" | ||
done | ||
done | ||
echo "" | ||
|
||
# Standard service worker and robots.txt | ||
header "Getting the service worker hash..." | ||
SERVICE_WORKER_SHA=$(curlretry https://resources.whatwg.org/standard-service-worker.js | shasum | cut -c 1-40) | ||
|
@@ -133,7 +160,8 @@ importScripts(\"https://resources.whatwg.org/standard-service-worker.js\"); | |
> "$WEB_ROOT/service-worker.js" | ||
echo "User-agent: * | ||
Disallow: /branch-snapshots/ | ||
Disallow: /commit-snapshots/" > "$WEB_ROOT/robots.txt" | ||
Disallow: /commit-snapshots/ | ||
Disallow: /review-drafts/" > "$WEB_ROOT/robots.txt" | ||
echo "Service worker and robots.txt output to $WEB_ROOT" | ||
echo "" | ||
|
||
|
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.
Since we put the DATE directly in the draft I don't think we need to distinguish between added and changed anymore. Hence we can simply use --name-only instead of --name-status.
I used master..HEAD here so a PR will consider all commits. We'll just have to ensure to land as a single commit on master.
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.
Nice!