Skip to content

Commit 67513c4

Browse files
Merge pull request #141 from nirs/download-nightly
docs: add download-odf-nightly.sh script
2 parents 6765dea + 91a4896 commit 67513c4

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed

README.md

+12
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,15 @@ These are the arguments that apply to all commands:
109109
```bash
110110
./bin/odf -h
111111
```
112+
113+
### Download nightly build
114+
115+
If you want to test the latest nightly build you can use the
116+
download-odf-nightly.sh script:
117+
118+
```bash
119+
scripts/download-odf-nightly.sh v4.19
120+
```
121+
122+
The command downloads the latest 4.19 build image and extracts the odf
123+
executable to the current directory.

scripts/download-odf-nightly.sh

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#!/bin/sh
2+
# Download a nightly build of odf cli executable for the current platform and
3+
# architecture.
4+
5+
set -e
6+
7+
version="$1"
8+
9+
if [ -z "$version" ]; then
10+
cat <<EOF
11+
Usage: $0 VERSION
12+
13+
Examples:
14+
15+
$0 v4.19
16+
17+
EOF
18+
exit 1
19+
fi
20+
21+
image="quay.io/rhceph-dev/odf4-odf-cli-rhel9:$version"
22+
platform=$(uname)
23+
24+
case $platform in
25+
Darwin)
26+
platform=macosx
27+
executable=odf
28+
;;
29+
Linux)
30+
platform=linux
31+
machine=$(uname -m)
32+
case $machine in
33+
x86_64)
34+
executable=odf-amd64
35+
;;
36+
aarch64)
37+
executable=odf-arm64
38+
;;
39+
ppc64le,s390x)
40+
executable=odf-$machine
41+
;;
42+
*)
43+
echo "unsupported machine $machine"
44+
exit 1
45+
;;
46+
esac
47+
;;
48+
*)
49+
echo "unsupported platform $platform"
50+
exit 1
51+
;;
52+
esac
53+
54+
# We have only linux/amd64, linux/s390x, and linux/ppc64le images. The
55+
# linux/amd64 image includes builds for all platforms.
56+
oc image extract "$image" \
57+
--filter-by-os "^linux/amd64" \
58+
--file "/usr/share/odf/$platform/$executable"
59+
60+
chmod +x "$executable"
61+
62+
if [ "$executable" != "odf" ]; then
63+
mv "$executable" odf
64+
fi

0 commit comments

Comments
 (0)