Skip to content

Commit

Permalink
Merge pull request #9 from WanderaOrg/initializer-cmd
Browse files Browse the repository at this point in the history
Project restructure
  • Loading branch information
coufalja authored Mar 29, 2018
2 parents 6637266 + a5c0500 commit e447908
Show file tree
Hide file tree
Showing 26 changed files with 47 additions and 76 deletions.
16 changes: 10 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,24 @@ FROM golang:1.10 AS builder
RUN curl -fsSL -o /usr/local/bin/dep https://github.com/golang/dep/releases/download/v0.4.1/dep-linux-amd64 \
&& chmod +x /usr/local/bin/dep

RUN mkdir -p /go/src/github.com/WanderaOrg/scccmd/config
WORKDIR /go/src/github.com/WanderaOrg/scccmd/config
RUN mkdir -p /go/src/github.com/WanderaOrg/scccmd/
WORKDIR /go/src/github.com/WanderaOrg/scccmd/

COPY Gopkg.toml Gopkg.lock ./
RUN dep ensure -vendor-only

COPY config/ .
RUN CGO_ENABLED=0 go build -o ../bin/config
COPY cmd/ ./cmd
COPY internal/ ./internal
COPY pkg/ ./pkg
COPY main.go .

RUN CGO_ENABLED=0 go build -o bin/scccmd


# Runtime image
FROM alpine:latest
RUN apk --no-cache add ca-certificates
COPY --from=builder /go/src/github.com/WanderaOrg/scccmd/bin/config /app/config
COPY --from=builder /go/src/github.com/WanderaOrg/scccmd/bin/scccmd /app/scccmd
WORKDIR /app

ENTRYPOINT ["./config"]
ENTRYPOINT ["./scccmd"]
2 changes: 1 addition & 1 deletion config/cmd/decrypt.go → cmd/decrypt.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"fmt"
"github.com/WanderaOrg/scccmd/config/client"
"github.com/WanderaOrg/scccmd/pkg/client"
"github.com/spf13/cobra"
"io/ioutil"
"os"
Expand Down
2 changes: 1 addition & 1 deletion config/cmd/decrypt_test.go → cmd/decrypt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cmd
import (
"bytes"
"fmt"
"github.com/WanderaOrg/scccmd/config/internal"
"github.com/WanderaOrg/scccmd/internal"
"net/http"
"net/http/httptest"
"testing"
Expand Down
2 changes: 1 addition & 1 deletion config/cmd/encrypt.go → cmd/encrypt.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"fmt"
"github.com/WanderaOrg/scccmd/config/client"
"github.com/WanderaOrg/scccmd/pkg/client"
"github.com/spf13/cobra"
"io/ioutil"
"os"
Expand Down
2 changes: 1 addition & 1 deletion config/cmd/encrypt_test.go → cmd/encrypt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cmd
import (
"bytes"
"fmt"
"github.com/WanderaOrg/scccmd/config/internal"
"github.com/WanderaOrg/scccmd/internal"
"net/http"
"net/http/httptest"
"testing"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion config/cmd/get.go → cmd/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"fmt"
"github.com/WanderaOrg/scccmd/config/client"
"github.com/WanderaOrg/scccmd/pkg/client"
"github.com/spf13/cobra"
"io/ioutil"
)
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion config/cmd/root.go → cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
var Verbose bool

var rootCmd = &cobra.Command{
Use: "config",
Use: "scccmd",
DisableAutoGenTag: true,
Short: "Spring Cloud Config management tool",
Long: `Commandline tool used for managing configuration from Spring Cloud Config Server.
Expand Down
File renamed without changes.
33 changes: 0 additions & 33 deletions docs/config_init.md

This file was deleted.

14 changes: 7 additions & 7 deletions docs/config.md → docs/scccmd.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## config
## scccmd

Spring Cloud Config management tool

Expand All @@ -11,14 +11,14 @@ Tool currently provides functionality t get (download) config file from server.
### Options

```
-h, --help help for config
-h, --help help for scccmd
-v, --verbose verbose output
```

### SEE ALSO
* [config decrypt](config_decrypt.md) - Decrypt the value server-side and prints the response
* [config encrypt](config_encrypt.md) - Encrypt the value server-side and prints the response
* [config gendoc](config_gendoc.md) - Generates documentation for this tool in Markdown format
* [config get](config_get.md) - Get the config from the given config server
* [config initializer](config_initializer.md) - Runs K8s initializer for injecting config from Cloud Config Server
* [scccmd decrypt](scccmd_decrypt.md) - Decrypt the value server-side and prints the response
* [scccmd encrypt](scccmd_encrypt.md) - Encrypt the value server-side and prints the response
* [scccmd gendoc](scccmd_gendoc.md) - Generates documentation for this tool in Markdown format
* [scccmd get](scccmd_get.md) - Get the config from the given config server
* [scccmd initializer](scccmd_initializer.md) - Runs K8s initializer for injecting config from Cloud Config Server

6 changes: 3 additions & 3 deletions docs/config_decrypt.md → docs/scccmd_decrypt.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## config decrypt
## scccmd decrypt

Decrypt the value server-side and prints the response

Expand All @@ -8,7 +8,7 @@ Decrypt the value server-side and prints the response
Decrypt the value server-side and prints the response

```
config decrypt [flags]
scccmd decrypt [flags]
```

### Options
Expand All @@ -26,5 +26,5 @@ config decrypt [flags]
```

### SEE ALSO
* [config](config.md) - Spring Cloud Config management tool
* [scccmd](scccmd.md) - Spring Cloud Config management tool

6 changes: 3 additions & 3 deletions docs/config_encrypt.md → docs/scccmd_encrypt.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## config encrypt
## scccmd encrypt

Encrypt the value server-side and prints the response

Expand All @@ -8,7 +8,7 @@ Encrypt the value server-side and prints the response
Encrypt the value server-side and prints the response

```
config encrypt [flags]
scccmd encrypt [flags]
```

### Options
Expand All @@ -26,5 +26,5 @@ config encrypt [flags]
```

### SEE ALSO
* [config](config.md) - Spring Cloud Config management tool
* [scccmd](scccmd.md) - Spring Cloud Config management tool

6 changes: 3 additions & 3 deletions docs/config_gendoc.md → docs/scccmd_gendoc.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## config gendoc
## scccmd gendoc

Generates documentation for this tool in Markdown format

Expand All @@ -8,7 +8,7 @@ Generates documentation for this tool in Markdown format
Generates documentation for this tool in Markdown format

```
config gendoc [flags]
scccmd gendoc [flags]
```

### Options
Expand All @@ -25,5 +25,5 @@ config gendoc [flags]
```

### SEE ALSO
* [config](config.md) - Spring Cloud Config management tool
* [scccmd](scccmd.md) - Spring Cloud Config management tool

8 changes: 4 additions & 4 deletions docs/config_get.md → docs/scccmd_get.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## config get
## scccmd get

Get the config from the given config server

Expand All @@ -24,7 +24,7 @@ Get the config from the given config server
```

### SEE ALSO
* [config](config.md) - Spring Cloud Config management tool
* [config get files](config_get_files.md) - Get the config files from the given config server
* [config get values](config_get_values.md) - Get the config values in specified format from the given config server
* [scccmd](scccmd.md) - Spring Cloud Config management tool
* [scccmd get files](scccmd_get_files.md) - Get the config files from the given config server
* [scccmd get values](scccmd_get_values.md) - Get the config values in specified format from the given config server

6 changes: 3 additions & 3 deletions docs/config_get_files.md → docs/scccmd_get_files.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## config get files
## scccmd get files

Get the config files from the given config server

Expand All @@ -8,7 +8,7 @@ Get the config files from the given config server
Get the config files from the given config server

```
config get files [flags]
scccmd get files [flags]
```

### Options
Expand All @@ -29,5 +29,5 @@ config get files [flags]
```

### SEE ALSO
* [config get](config_get.md) - Get the config from the given config server
* [scccmd get](scccmd_get.md) - Get the config from the given config server

6 changes: 3 additions & 3 deletions docs/config_get_values.md → docs/scccmd_get_values.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## config get values
## scccmd get values

Get the config values in specified format from the given config server

Expand All @@ -8,7 +8,7 @@ Get the config values in specified format from the given config server
Get the config values in specified format from the given config server

```
config get values [flags]
scccmd get values [flags]
```

### Options
Expand All @@ -30,5 +30,5 @@ config get values [flags]
```

### SEE ALSO
* [config get](config_get.md) - Get the config from the given config server
* [scccmd get](scccmd_get.md) - Get the config from the given config server

6 changes: 3 additions & 3 deletions docs/config_initializer.md → docs/scccmd_initializer.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## config initializer
## scccmd initializer

Runs K8s initializer for injecting config from Cloud Config Server

Expand All @@ -8,7 +8,7 @@ Runs K8s initializer for injecting config from Cloud Config Server
Runs K8s initializer for injecting config from Cloud Config Server

```
config initializer [flags]
scccmd initializer [flags]
```

### Options
Expand All @@ -28,5 +28,5 @@ config initializer [flags]
```

### SEE ALSO
* [config](config.md) - Spring Cloud Config management tool
* [scccmd](scccmd.md) - Spring Cloud Config management tool

File renamed without changes.
2 changes: 1 addition & 1 deletion config/main.go → main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"github.com/WanderaOrg/scccmd/config/cmd"
"github.com/WanderaOrg/scccmd/cmd"
"os"
)

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion config/client/client_test.go → pkg/client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package client
import (
"bytes"
"fmt"
"github.com/WanderaOrg/scccmd/config/internal"
"github.com/WanderaOrg/scccmd/internal"
"net/http"
"net/http/httptest"
"testing"
Expand Down

0 comments on commit e447908

Please sign in to comment.