Skip to content

Commit ea27dbf

Browse files
committed
Merge branch 'master' of https://github.com/covexo/devspace into test-sync
2 parents ec690db + 2389f87 commit ea27dbf

24 files changed

Lines changed: 721 additions & 290 deletions

File tree

Gopkg.lock

Lines changed: 143 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
source = "https://github.com/moby/moby"
1616
revision = "ae7016427f8cba4e4d8fcb979d6ba313ee2c0702"
1717

18+
[[constraint]]
19+
name = "github.com/docker/cli"
20+
version = "v18.06.1-ce"
21+
1822
[[constraint]]
1923
name = "github.com/rhysd/go-github-selfupdate"
2024
revision = "41c1bbb0804a2994dae69502a8c76e7c456ad45e"

cmd/up.go

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313
"github.com/covexo/devspace/pkg/util/log"
1414

15-
"github.com/covexo/devspace/pkg/devspace/kaniko"
15+
"github.com/covexo/devspace/pkg/devspace/builder/kaniko"
1616
"github.com/covexo/devspace/pkg/devspace/registry"
1717
synctool "github.com/covexo/devspace/pkg/devspace/sync"
1818

@@ -103,27 +103,31 @@ func (cmd *UpCmd) Run(cobraCmd *cobra.Command, args []string) {
103103
log.StartFileLogging()
104104

105105
workdir, err := os.Getwd()
106-
107106
if err != nil {
108107
log.Fatalf("Unable to determine current workdir: %s", err.Error())
109108
}
110109

111110
cmd.workdir = workdir
112111

113112
configExists, _ := configutil.ConfigExists()
114-
115113
if !configExists {
116114
initCmd := &InitCmd{
117115
flags: InitCmdFlagsDefault,
118116
}
119117

120118
initCmd.Run(nil, []string{})
121119
}
120+
122121
cmd.kubectl, err = kubectl.NewClient()
122+
if err != nil {
123+
log.Fatalf("Unable to create new kubectl client: %v", err)
124+
}
123125

126+
err = cmd.ensureNamespace()
124127
if err != nil {
125-
log.Fatalf("Unable to create new kubectl client: %s", err.Error())
128+
log.Fatalf("Unable to create release namespace: %v", err)
126129
}
130+
127131
cmd.initHelm()
128132

129133
if cmd.flags.initRegistry {
@@ -133,7 +137,7 @@ func (cmd *UpCmd) Run(cobraCmd *cobra.Command, args []string) {
133137
log.StopWait()
134138

135139
if err != nil {
136-
log.Fatalf("Docker registry error: %s", err.Error())
140+
log.Fatalf("Docker registry error: %v", err)
137141
}
138142

139143
log.Done("Docker registry started")
@@ -149,7 +153,6 @@ func (cmd *UpCmd) Run(cobraCmd *cobra.Command, args []string) {
149153
cmd.buildImage()
150154

151155
err = configutil.SaveConfig()
152-
153156
if err != nil {
154157
log.Fatalf("Config saving error: %s", err.Error())
155158
}
@@ -181,6 +184,28 @@ func (cmd *UpCmd) Run(cobraCmd *cobra.Command, args []string) {
181184
cmd.enterTerminal()
182185
}
183186

187+
func (cmd *UpCmd) ensureNamespace() error {
188+
config := configutil.GetConfig(false)
189+
releaseNamespace := *config.DevSpace.Release.Namespace
190+
191+
// Check if registry namespace exists
192+
_, err := cmd.kubectl.CoreV1().Namespaces().Get(releaseNamespace, metav1.GetOptions{})
193+
if err != nil {
194+
// Create registry namespace
195+
_, err = cmd.kubectl.CoreV1().Namespaces().Create(&k8sv1.Namespace{
196+
ObjectMeta: metav1.ObjectMeta{
197+
Name: releaseNamespace,
198+
},
199+
})
200+
201+
if err != nil {
202+
return err
203+
}
204+
}
205+
206+
return nil
207+
}
208+
184209
func (cmd *UpCmd) shouldRebuild(buildFlagChanged bool) bool {
185210
config := configutil.GetConfig(false)
186211
mustRebuild := true

docs/docs/getting-started/installation.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: 1. Installation
55
You can either use one of our install scripts or simply download the released binary for your platform manually.
66

77
## Install Scripts
8-
The following install scripts make it easy to install the DevSpace CLI. Simply copy the the commands into the recommended command line tool.
8+
The following install scripts make it easy to install the DevSpace CLI. Simply copy the the commands into the recommended command line tool. The script will install the devspace CLI and add it to the PATH environment variable.
99

1010
### For Windows
1111
1. Open CMD with **admin rights**.
@@ -16,18 +16,21 @@ curl -s "https://raw.githubusercontent.com/covexo/devspace/master/scripts/instal
1616
del "%Temp%\install-devspace.bat"
1717
```
1818

19-
**Note:** After running the install script, you should close the terminal window that you used to run the install script.
19+
**Note:** After running the install script, you should reopen the terminal window to refresh the environment variables.
2020

2121
### For Linux
22-
1. Run this install script with **root privileges**:
22+
1. Run the command:
2323
```bash
24-
tmpdir=$(dirname $(mktemp -u))
25-
curl -s "https://raw.githubusercontent.com/covexo/devspace/master/scripts/installer-linux.sh" >"$tmpdir/install-devspace.sh"
26-
"$tmpdir/install-devspace.sh" "/usr/bin/devspace"
27-
rm -r "$tmpdir"
24+
curl --silent "https://api.github.com/repos/covexo/devspace/releases/latest" | sed -nr 's!.*"(https://github.com[^"]*devspace-linux-amd64)".*!\1!p' | xargs -n 1 curl -L -o devspace && chmod +x devspace && sudo mv devspace /usr/local/bin
25+
```
26+
27+
### For Mac
28+
1. Run the command:
29+
```bash
30+
curl --silent "https://api.github.com/repos/covexo/devspace/releases/latest" | sed -nr 's!.*"(https://github.com[^"]*devspace-darwin-amd64)".*!\1!p' | xargs -n 1 curl -L -o devspace && chmod +x devspace && sudo mv devspace /usr/local/bin
2831
```
2932

3033
## Binary Download
3134
An alternative to the install scripts is to:
32-
1. download the release yourself from the [GitHub releases page](https://github.com/covexo/devspace/releases)
33-
2. and run `PATH_TO_YOUR_RELEASE_FILE install` with admin/root priveleges
35+
1. download the latest release from the [GitHub releases page](https://github.com/covexo/devspace/releases)
36+
2. add the binary folder path to your PATH environment variable **OR** run `PATH_TO_YOUR_RELEASE_FILE install` with admin/root priveleges

0 commit comments

Comments
 (0)