Skip to content

Commit

Permalink
Add echo of rsync command, expand README.
Browse files Browse the repository at this point in the history
  • Loading branch information
asford committed Jul 27, 2018
1 parent d7c64c0 commit 2bffd7a
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,38 @@ steps:
pre: "-rv remote:/build/ccache ./ccache"
```


## Ugly Hacks

From `man rsync`, "Rsync is a fast and extraordinarily versatile file
copying tool [...] it offers a large number of options that control every
aspect of its behavior and permit very flexible specification."

:trollface:

Rsync does *not* support creation of nested output directories. Create
a nested output directory via repeated "no-op" copies:

```
steps:
- plugins:
uw-ipd/rsync#v0.1:
post:
- "-Rrv --exclude=* . remote:/build/artifacts"
- "-Rrv --exclude=* . remote:/build/artifacts/${BUILDKITE_BRANCH}"
- "-Rrv --exclude=* . remote:/build/artifacts/${BUILDKITE_BRANCH}/${BUILDKITE_BUILD_NUMBER}"
- "-Rrv bin remote:/build/artifacts/${BUILDKITE_BRANCH}/${BUILDKITE_BUILD_NUMBER}"
```

Create a nested output directory via the "rsync-path trick":

```yml
steps:
- plugins:
uw-ipd/rsync#v0.1:
post: "--rsync-path="mkdir -p /build/artifacts/${BUILDKITE_BRANCH}/${BUILDKITE_BUILD_NUMBER} && rsync" -Rrv bin remote:/build/artifacts/${BUILDKITE_BRANCH}/${BUILDKITE_BUILD_NUMBER}"
```

## Configuration

### `pre`
Expand Down
1 change: 1 addition & 0 deletions hooks/post-command
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ echo "--- rsync-ing "
for path in "${paths[@]}"
do
## `eval` to support step-time varibles in the command
echo rsync $path
eval rsync $path
done
1 change: 1 addition & 0 deletions hooks/pre-command
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ echo "--- rsync-ing "
for path in "${paths[@]}"
do
## `eval` to support step-time varibles in the command
echo rsync $path
eval rsync $path
done

0 comments on commit 2bffd7a

Please sign in to comment.