From 99589a8bf22b476d1ecdbe7d77f00cdbc074f614 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20J=C3=A4genstedt?= Date: Mon, 4 Sep 2017 23:36:47 +0200 Subject: [PATCH] deploy.sh: make EXTRA_FILES preserve directory structure ... with the magic of rsync. Will be used for https://github.com/whatwg/console/pull/118. --- resources.whatwg.org/build/README.md | 2 +- resources.whatwg.org/build/deploy.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resources.whatwg.org/build/README.md b/resources.whatwg.org/build/README.md index 48f1fb803..621ae2cde 100644 --- a/resources.whatwg.org/build/README.md +++ b/resources.whatwg.org/build/README.md @@ -21,7 +21,7 @@ For non-local deploys, it is dependent on the following environment setup: Optional environment variables: - `$SERVER` is the server to deploy to. - `$SERVER_PUBLIC_KEY` is the public key of the deploy server, in the format of `known_hosts`. -- `$EXTRA_FILES` are extra files to copy for each build. Shell wildcards are allowed. Example: `EXTRA_FILES="*.png"`. +- `$EXTRA_FILES` are extra files to copy for each build. Shell wildcards are allowed, and directory structure will be preserved. Example: `EXTRA_FILES="images/*.png"`. - `$POST_BUILD_STEP` is an extra step to run after each build. Evaluated with the `$DIR` variable set to the build directory. Example: `POST_BUILD_STEP='python generate-stuff.py "$DIR"'`. An example `.travis.yml` file that uses this script would then be as follows: diff --git a/resources.whatwg.org/build/deploy.sh b/resources.whatwg.org/build/deploy.sh index 8b73e65d7..9a44a717c 100644 --- a/resources.whatwg.org/build/deploy.sh +++ b/resources.whatwg.org/build/deploy.sh @@ -68,7 +68,7 @@ copy_extra_files() { echo "Copying extra files ($EXTRA_FILES) to $1" # Will not pass shellcheck: https://stackoverflow.com/q/45931553/3191 # shellcheck disable=SC2086 - cp $EXTRA_FILES "$1" + rsync --relative $EXTRA_FILES "$1" fi }