Use vendored JQ
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
9814efca5d
commit
59381e5293
|
@ -10,6 +10,8 @@ The script can be run on its own like so.
|
|||
$ ./abra-hetzner my-new-vps cx11 debian-10 --ssh-keys foo@example.com
|
||||
```
|
||||
|
||||
It assumes a `$ABRA_DIR/vendor/jq` binary installation of [jq](https://stedolan.github.io/jq/tutorial/).
|
||||
|
||||
## Hacking
|
||||
|
||||
You can read the Hetzner Cloud API docs (e.g. [locations endpoint](https://docs.hetzner.cloud/#locations)).
|
||||
|
|
|
@ -108,6 +108,10 @@ declare -p "${prefix}__ssh_keys" "${prefix}__location" "${prefix}_name_" \
|
|||
"${prefix}_type_" "${prefix}_image_"; done; }
|
||||
# docopt parser above, complete command for generating this parser is `docopt.sh abra-hetzner`
|
||||
|
||||
ABRA_DIR="${ABRA_DIR:-$HOME/.abra}"
|
||||
ABRA_VENDOR_DIR="$ABRA_DIR/vendor"
|
||||
JQ=$ABRA_VENDOR_DIR/jq"
|
||||
|
||||
abra_hetzner() {
|
||||
declare abra_hetzner__name_ abra_hetzner__type_ abra_hetzner__image_ \
|
||||
abra_hetzner___ssh_keys abra_hetzner___location
|
||||
|
@ -146,7 +150,7 @@ abra_hetzner() {
|
|||
}" \
|
||||
'https://api.hetzner.cloud/v1/servers')
|
||||
|
||||
ip=$(echo "$response" | jq -r ".server .public_net .ipv4 .ip")
|
||||
ip=$(echo "$response" | $JQ -r ".server .public_net .ipv4 .ip")
|
||||
|
||||
if [[ -n "$ip" ]]; then
|
||||
error_msg=$(echo "$response" | jq -r ".error .message")
|
||||
|
|
Loading…
Reference in New Issue