blob: 7405cb5e61780ef4fdb2f545c5bcf2724cf8e70d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
#!/usr/bin/env bash
playbook_add() {
local dl_arch
local dl_baseurl
local dl_binary
local dl_version
# Install seaweedfs
case "${BASHTARD_PLATFORM[arch]}" in
x86_64) dl_arch=amd64 ;;
*) die "NYI" ;;
esac
dl_baseurl="https://github.com/seaweedfs/seaweedfs/releases/download"
dl_binary="$(printf "%s_%s.tar.gz" "${BASHTARD_PLATFORM[os]}" "$dl_arch")"
dl_version="$(config "$BASHTARD_PLAYBOOK.version" "3.63")"
buffer="$(tmpdir)"
chgdir "$buffer"
info "$BASHTARD_PLAYBOOK/add" "Fetching $dl_baseurl/$dl_version/$dl_binary"
curl -L "$dl_baseurl/$dl_version/$dl_binary" > "$dl_binary"
tar xzf "$dl_binary"
mv -v -- "weed" "$(config "fs.bindir")/weed"
# Create mount.weed symlink
ln -fsv "$(config "fs.bindir")/weed" "$(config "fs.bindir")/mount.weed"
# Create directories used by seaweedfs
mkdir -pv -- "$(config "fs.etcdir")/seaweedfs"
}
playbook_sync() {
:;
}
playbook_del() {
# Remove configuration files
rm -fr -- "$(config "fs.etcdir")/seaweedfs"
# Remove downloaded binary and symlinks
rm -fr -- "$(config "fs.bindir")/weed"
rm -fr -- "$(config "fs.bindir")/mount.weed"
}
|