Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade golang 1.14 to 1.15.2 #42

Merged
merged 1 commit into from
Sep 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Let's examine the `config.yaml` fields so you will feel more comfortable editing
| output_binary | /app | output binary artifact inside the runtime container |
| build_command | go build -o {{.output_binary}} | build command inside the runtime container. Note you can reference other configuration fields. When enabling Debugger `-gcflags="all=-N -l"` will be appended to the build command to stop compiler optimization and symbol removing |
| run_command | {.output_binary}} | run command, probably most of the time will just be the binary artifact path |
| runtime_image | golang:1.14 | base Docker image for the runtime container |
| runtime_image | golang:1.15.2 | base Docker image for the runtime container |
| debugger_enabled | false | whether to enable delve debugger inside the container or just use hot-reload |
| debugger_port | 40000 | delve debugger listen port, relevant only if `debugger_enabled` was set |
| expose_ports | [] | list of ports to expose inside the container. Uses the same syntax as docker-compose for mapping between host and container ports(e.g: "8080:8080"). No need to add the delve debugger listen port as it will be auto-added |
Expand Down
2 changes: 1 addition & 1 deletion doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Configurations
output_binary - output binary artifact inside the runtime container (default: "/app")
build_command - build command inside the runtime container (default: "go build -o {{.output_binary}}")
run_command - run command, probably most of the time will just be the binary artifact path (default: "{.output_binary}}")
runtime_image - base Docker image for the runtime container (default: "golang:1.14")
runtime_image - base Docker image for the runtime container (default: "golang:1.15.2")
debugger_enabled - whether to enable delve debugger inside the container or just use hot-reload (default: false)
debugger_port - delve debugger listen port, relevant only if debugger_enabled was set (default: 40000)
expose_ports - list of ports to expose inside the container (default: [])
Expand Down
12 changes: 6 additions & 6 deletions pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func TestConfig_Load(t *testing.T) {
name: my-app
output_binary: /app
build_command: go build -o {{.output_binary}} -gcflags="all=-N-l"
runtime_image: golang:1.14
runtime_image: golang:1.15.2
run_command: '{{.output_binary}}'
debugger_port: 40000
expose_ports:
Expand All @@ -32,7 +32,7 @@ expose_ports:
OutputBinaryPath: "/app",
BuildCommand: `go build -o /app -gcflags="all=-N-l"`,
RunCommand: "/app",
RuntimeImage: "golang:1.14",
RuntimeImage: "golang:1.15.2",
DebuggerPort: 40000,
ExposePorts: []string{"8080:8080"},
},
Expand All @@ -43,7 +43,7 @@ expose_ports:
name: my-app
output_binary: /app
build_command: go build -o {{.output_binary}} -gcflags="all=-N-l"
runtime_image: golang:1.14
runtime_image: golang:1.15.2
run_command: '{{.output_binary}}'
debugger_port: 40000
expose_ports:
Expand All @@ -54,7 +54,7 @@ expose_ports:
OutputBinaryPath: "/app",
BuildCommand: `go build -o /app -gcflags="all=-N-l"`,
RunCommand: "/app",
RuntimeImage: "golang:1.14",
RuntimeImage: "golang:1.15.2",
DebuggerPort: 40000,
ExposePorts: []string{"8080:8080"},
},
Expand Down Expand Up @@ -122,7 +122,7 @@ func TestConfig_Write(t *testing.T) {
OutputBinaryPath: "/app",
BuildCommand: "go build -o /app -gcflags=\"all=-N-l\"",
RunCommand: "/app",
RuntimeImage: "golang:1.14",
RuntimeImage: "golang:1.15.2",
DebuggerPort: 40000,
DebuggerEnabled: true,
ExposePorts: []string{"8080", "8081:8081"},
Expand All @@ -131,7 +131,7 @@ func TestConfig_Write(t *testing.T) {
output_binary: /app
build_command: go build -o /app -gcflags="all=-N-l"
run_command: /app
runtime_image: golang:1.14
runtime_image: golang:1.15.2
debugger_enabled: true
debugger_port: 40000
expose_ports:
Expand Down
4 changes: 2 additions & 2 deletions pkg/config/render_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var mockConfig = &Config{
OutputBinaryPath: "/app",
BuildCommand: "go build",
RunCommand: "/app",
RuntimeImage: "golang:1.14",
RuntimeImage: "golang:1.15.2",
DebuggerEnabled: false,
DebuggerPort: 0,
ExposePorts: []string{"8080"},
Expand Down Expand Up @@ -67,7 +67,7 @@ func TestConfig_RenderDockerfile(t *testing.T) {
err := mockConfig.RenderDockerfile(out)
assert.NoError(t, err)
assert.Equal(t,
`FROM golang:1.14
`FROM golang:1.15.2
RUN go get github.com/githubnemo/CompileDaemon
RUN go get github.com/go-delve/delve/cmd/dlv

Expand Down
2 changes: 1 addition & 1 deletion pkg/config/testdata/generate_docker_compose_0.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: my-app
output_binary: /app
build_command: go build -o {{.output_binary}}
runtime_image: golang:1.14
runtime_image: golang:1.15.2
run_command: '{{.output_binary}}'
debugger_port: 40000
debugger_enabled: true
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/testdata/generate_docker_compose_1.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: my-app
output_binary: /app
build_command: go build -o {{.output_binary}}
runtime_image: golang:1.14
runtime_image: golang:1.15.2
run_command: '{{.output_binary}}'
debugger_port: 40000
debugger_enabled: false
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/testdata/generate_docker_compose_2.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: my-app
output_binary: /app
build_command: go build -o {{.output_binary}}
runtime_image: golang:1.14
runtime_image: golang:1.15.2
run_command: '{{.output_binary}}'
debugger_port: 40000
debugger_enabled: false
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/testdata/generate_docker_compose_3.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: my-app
output_binary: /app
build_command: go build -o {{.output_binary}}
runtime_image: golang:1.14
runtime_image: golang:1.15.2
run_command: '{{.output_binary}}'
debugger_port: 40000
debugger_enabled: false
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/testdata/generate_docker_compose_4.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: my-app
output_binary: /app
build_command: go build -o {{.output_binary}}
run_command: '{{.output_binary}}'
runtime_image: golang:1.14
runtime_image: golang:1.15.2
debugger_enabled: true
debugger_port: 40000
expose_ports: []
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/testdata/generate_dockerfile_0.golden
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.14
FROM golang:1.15.2
RUN go get github.com/githubnemo/CompileDaemon
RUN go get github.com/go-delve/delve/cmd/dlv

Expand Down
2 changes: 1 addition & 1 deletion pkg/config/testdata/generate_dockerfile_0.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: my-app
output_binary: /app
build_command: go build -o {{.output_binary}}
runtime_image: golang:1.14
runtime_image: golang:1.15.2
run_command: '{{.output_binary}}'
debugger_port: 40000
debugger_enabled: true
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/testdata/generate_dockerfile_1.golden
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.14
FROM golang:1.15.2
RUN go get github.com/githubnemo/CompileDaemon
RUN go get github.com/go-delve/delve/cmd/dlv

Expand Down
2 changes: 1 addition & 1 deletion pkg/config/testdata/generate_dockerfile_1.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: my-app
output_binary: /app
build_command: go build -o {{.output_binary}}
runtime_image: golang:1.14
runtime_image: golang:1.15.2
run_command: '{{.output_binary}}'
debugger_port: 40000
debugger_enabled: false
Expand Down
2 changes: 1 addition & 1 deletion pkg/input/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func LoadOrDefault(workDir string) (*config.Config, bool) {
OutputBinaryPath: "/app",
BuildCommand: `go build -o {{.output_binary}}`,
RunCommand: `{{.output_binary}}`,
RuntimeImage: "golang:1.14",
RuntimeImage: "golang:1.15.2",
}

configFilePath := config.FilePath(workDir, config.Path)
Expand Down