Skip to content

Commit

Permalink
Support deploying extra files using an EXTRA_FILES variable
Browse files Browse the repository at this point in the history
  • Loading branch information
foolip committed Aug 28, 2017
1 parent bfc617b commit 7feb000
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions resources.whatwg.org/build/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ echo ""

rm -rf "$WEB_ROOT" || exit 0

copy_extra_files() {
if [[ "$EXTRA_FILES" != "" ]]; then
cp $EXTRA_FILES $1
fi
}

if [[ $BRANCH != "master" ]] ; then
# Branch snapshot, if not master
BRANCH_DIR="$WEB_ROOT/$BRANCHES_DIR/$BRANCH"
Expand All @@ -72,7 +78,8 @@ if [[ $BRANCH != "master" ]] ; then
-F md-title="$TITLE (Branch Snapshot $BRANCH)" \
-F md-Text-Macro="SNAPSHOT-LINK $BACK_TO_LS_LINK" \
> "$BRANCH_DIR/index.html";
echo "Branch snapshot output to $WEB_ROOT/$BRANCHES_DIR/$BRANCH"
copy_extra_files "$BRANCH_DIR"
echo "Branch snapshot output to $BRANCH_DIR"
else
# Commit snapshot, if master
COMMIT_DIR="$WEB_ROOT/$COMMITS_DIR/$SHA"
Expand All @@ -82,13 +89,15 @@ else
-F md-title="$TITLE (Commit Snapshot $SHA)" \
-F md-Text-Macro="SNAPSHOT-LINK $BACK_TO_LS_LINK" \
> "$COMMIT_DIR/index.html";
echo "Commit snapshot output to $WEB_ROOT/$COMMITS_DIR/$SHA"
copy_extra_files "$COMMIT_DIR"
echo "Commit snapshot output to $COMMIT_DIR"
echo ""

# Living standard, if master
curl https://api.csswg.org/bikeshed/ -f -F file=@"$INPUT_FILE" \
-F md-Text-Macro="SNAPSHOT-LINK $SNAPSHOT_LINK" \
> "$WEB_ROOT/index.html"
copy_extra_files "$WEB_ROOT"

echo "\"use strict\";
importScripts(\"https://resources.whatwg.org/standard-service-worker.js\");
Expand Down

0 comments on commit 7feb000

Please sign in to comment.