Skip to content

Commit 2bffd7a

Browse files
author
Alex Ford
committed
Add echo of rsync command, expand README.
1 parent d7c64c0 commit 2bffd7a

3 files changed

Lines changed: 34 additions & 0 deletions

File tree

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,38 @@ steps:
5959
pre: "-rv remote:/build/ccache ./ccache"
6060
```
6161

62+
63+
## Ugly Hacks
64+
65+
From `man rsync`, "Rsync is a fast and extraordinarily versatile file
66+
copying tool [...] it offers a large number of options that control every
67+
aspect of its behavior and permit very flexible specification."
68+
69+
:trollface:
70+
71+
Rsync does *not* support creation of nested output directories. Create
72+
a nested output directory via repeated "no-op" copies:
73+
74+
```
75+
steps:
76+
- plugins:
77+
uw-ipd/rsync#v0.1:
78+
post:
79+
- "-Rrv --exclude=* . remote:/build/artifacts"
80+
- "-Rrv --exclude=* . remote:/build/artifacts/${BUILDKITE_BRANCH}"
81+
- "-Rrv --exclude=* . remote:/build/artifacts/${BUILDKITE_BRANCH}/${BUILDKITE_BUILD_NUMBER}"
82+
- "-Rrv bin remote:/build/artifacts/${BUILDKITE_BRANCH}/${BUILDKITE_BUILD_NUMBER}"
83+
```
84+
85+
Create a nested output directory via the "rsync-path trick":
86+
87+
```yml
88+
steps:
89+
- plugins:
90+
uw-ipd/rsync#v0.1:
91+
post: "--rsync-path="mkdir -p /build/artifacts/${BUILDKITE_BRANCH}/${BUILDKITE_BUILD_NUMBER} && rsync" -Rrv bin remote:/build/artifacts/${BUILDKITE_BRANCH}/${BUILDKITE_BUILD_NUMBER}"
92+
```
93+
6294
## Configuration
6395

6496
### `pre`

hooks/post-command

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,6 @@ echo "--- rsync-ing "
2828
for path in "${paths[@]}"
2929
do
3030
## `eval` to support step-time varibles in the command
31+
echo rsync $path
3132
eval rsync $path
3233
done

hooks/pre-command

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,6 @@ echo "--- rsync-ing "
2828
for path in "${paths[@]}"
2929
do
3030
## `eval` to support step-time varibles in the command
31+
echo rsync $path
3132
eval rsync $path
3233
done

0 commit comments

Comments
 (0)