Skip to content

Commit 97d5916

Browse files
committed
Merge pull request #2034 from mboersma/1957-deisctl-installer-fixes
fix(deisctl): refresh-units uses $HOME/.deis/units by default
2 parents d8228df + ca16746 commit 97d5916

7 files changed

Lines changed: 22 additions & 11 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ $ ssh-add ~/.vagrant.d/insecure_private_key
5454
Install the [deisctl utility](deisctl#installation) used to provision and operate Deis.
5555

5656
```console
57-
$ curl -sSL http://deis.io/deisctl/install.sh | sudo sh
57+
$ curl -sSL http://deis.io/deisctl/install.sh | sh
5858
```
5959

6060
Export `DEISCTL_TUNNEL` so you can connect to one of the VMs using the `deisctl` client on your workstation.

contrib/coreos/user-data

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ coreos:
5050

5151
[Service]
5252
Type=oneshot
53-
ExecStart=/usr/bin/sh -c 'curl -sSL http://deis.io/deisctl/install.sh | sh'
53+
ExecStart=/usr/bin/sh -c 'curl -sSL http://deis.io/deisctl/install.sh | sh -s 0.13.0-dev'
5454
write_files:
5555
- path: /etc/deis-release
5656
content: |

deisctl/Makefile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,17 @@ build:
1010
installer:
1111
rm -rf dist && mkdir -p dist
1212
CGO_ENABLED=0 godep go build -a -ldflags '-s' -o dist/deisctl .
13-
@if [ ! -d makeself ]; then git clone -b deisctl-hack https://github.com/deis/makeself.git; fi
14-
PATH=./makeself:$$PATH makeself.sh --bzip2 --nox11 --target /usr/local/bin dist \
13+
@if [ ! -d makeself ]; then git clone -b single-binary https://github.com/deis/makeself.git; fi
14+
PATH=./makeself:$$PATH BINARY=deisctl makeself.sh --bzip2 --current --nox11 dist \
1515
dist/deisctl-`cat deis-version`-`go env GOOS`-`go env GOARCH`.run "Deis Control Utility" \
16-
"deisctl refresh-units && chmod 755 /var/lib/deis /var/lib/deis/units && chmod -R 644 /var/lib/deis/units/*"
16+
"./deisctl refresh-units \
17+
&& echo \
18+
&& echo '\033[0;36mdeisctl\033[0m is in the current directory and unit files are' \
19+
&& echo 'in $$HOME/.deis/units. Please move \033[0;36mdeisctl\033[0m to a' \
20+
&& echo 'directory in your search PATH.' \
21+
&& echo \
22+
&& echo 'See http://docs.deis.io/ for documentation.' \
23+
&& echo"
1724

1825
install:
1926
godep go install -v .

deisctl/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
To install the latest `deisctl` on Linux or Mac OS X, run this command:
1010

1111
```console
12-
$ curl -sSL http://deis.io/deisctl/install.sh | sudo sh
12+
$ curl -sSL http://deis.io/deisctl/install.sh | sh
1313
```
1414

1515
The installer puts `deisctl` in */usr/local/bin* and downloads current Deis unit files
@@ -46,8 +46,8 @@ Then, export the `DEISCTL_UNITS` environment variable so deisctl can find the un
4646
$ export DEISCTL_UNITS="$PATH_TO_DEISCTL/units"
4747
```
4848

49-
This is also useful for specifying custom behavior on Deis units, such as using
50-
fleet metadata to lock the builder to a more powerful node, or keep application
49+
This is also useful for specifying custom behavior on Deis units, such as using
50+
fleet metadata to lock the builder to a more powerful node, or keep application
5151
nodes free of control plane elements.
5252

5353
## Remote Configuration

deisctl/backend/fleet/unit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
// path hierarchy for finding systemd service templates
1515
var templatePaths = []string{
1616
os.Getenv("DEISCTL_UNITS"),
17-
os.Getenv("HOME") + "/.deis/units",
17+
path.Join(os.Getenv("HOME"), ".deis", "units"),
1818
"/var/lib/deis/units",
1919
}
2020

deisctl/cmd/cmd.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"io/ioutil"
77
"net/http"
88
"os"
9+
"path"
910
"path/filepath"
1011
"regexp"
1112
"strconv"
@@ -283,7 +284,7 @@ Usage:
283284
deisctl refresh-units [-p <target>] [-t <tag>]
284285
285286
Options:
286-
-p --path=<target> where to save unit files [default: /var/lib/deis/units]
287+
-p --path=<target> where to save unit files [default: $HOME/.deis/units]
287288
-t --tag=<tag> git tag, branch, or SHA to use when downloading unit files
288289
[default: master]
289290
`
@@ -294,6 +295,9 @@ Options:
294295
os.Exit(2)
295296
}
296297
dir := args["--path"].(string)
298+
if dir == "$HOME/.deis/units" || dir == "~/.deis/units" {
299+
dir = path.Join(os.Getenv("HOME"), ".deis", "units")
300+
}
297301
// create the target dir if necessary
298302
if err := os.MkdirAll(dir, 0755); err != nil {
299303
return err

tests/bin/test-latest.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ log_phase "Installing clients"
2626
make -C client build
2727

2828
# install latest deisctl from the website
29-
curl -sSL http://deis.io/deisctl/install.sh | sudo sh
29+
curl -sSL http://deis.io/deisctl/install.sh | sh
3030

3131
# ensure we use distributed unit files
3232
unset DEISCTL_UNITS

0 commit comments

Comments
 (0)