-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathinstall.tmpl
More file actions
66 lines (47 loc) · 1.7 KB
/
install.tmpl
File metadata and controls
66 lines (47 loc) · 1.7 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/env sh
# Invoking this script:
#
# To install the latest stable version:
# curl https://raw.githubusercontent.com/drycc/workflow-cli/master/install-v2.sh | sh
#
# To install a specific released version ($VERSION):
# curl https://raw.githubusercontent.com/drycc/workflow-cli/master/install-v2.sh | sh -s $VERSION
#
# - download drycc cli binary
# - making sure drycc cli binary is executable
# - explain what was done
#
# install current version unless overridden by first command-line argument
VERSION=${1:-"{{DRYCC-CLIENT-VERSION}}"}
set -euf
check_platform_arch() {
local supported="linux-amd64 darwin-amd64"
if ! echo "${supported}" | tr ' ' '\n' | grep -q "${PLATFORM}-${ARCH}"; then
cat <<EOF
The Drycc Workflow CLI (drycc) is not currently supported on ${PLATFORM}-${ARCH}.
See https://github.com/drycc/workflow-cli for more information.
EOF
fi
}
PLATFORM="$(uname | tr '[:upper:]' '[:lower:]')"
ARCH="$(uname -m)"
# https://github.com/drycc/workflow-cli/releases/download/v1.0.1/drycc-v1.0.1-darwin-386
DRYCC_BIN_URL_BASE="https://github.com/drycc/workflow-cli/releases/download"
if [ "${ARCH}" = "x86_64" ]; then
ARCH="amd64"
fi
check_platform_arch
DRYCC_CLI="drycc-${VERSION}-${PLATFORM}-${ARCH}"
DRYCC_CLI_PATH="${DRYCC_CLI}"
if [ "${VERSION}" != 'stable' ]; then
DRYCC_CLI_PATH="${VERSION}/${DRYCC_CLI_PATH}"
fi
echo "Downloading ${DRYCC_CLI} From Google Cloud Storage..."
echo "Downloading binary from here: ${DRYCC_BIN_URL_BASE}/${DRYCC_CLI_PATH}"
curl -fsSL -o drycc "${DRYCC_BIN_URL_BASE}/${DRYCC_CLI_PATH}"
chmod +x drycc
cat <<EOF
The Drycc Workflow CLI (drycc) is now available in your current directory.
To learn more about Drycc Workflow, execute:
$ ./drycc --help
EOF