Former-commit-id: 5fc019a057ae7a5ff4084610cc6c9314bbad4e30 Former-commit-id: c27ff117a67a3db831cac6d01fb4fc4b101256db1.0
parent
3e822179be
commit
16856a76a2
@ -1 +0,0 @@
|
|||||||
FROM alpine
|
|
@ -1,7 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import "fmt"
|
|
||||||
|
|
||||||
func main(){
|
|
||||||
fmt.Printf("Hello World!");
|
|
||||||
}
|
|
@ -1,18 +1,21 @@
|
|||||||
kind: pipeline
|
kind: pipeline
|
||||||
name: default
|
name: default
|
||||||
type: docker
|
type: docker
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: test
|
||||||
|
image: golang:1.12
|
||||||
|
commands:
|
||||||
|
- go test
|
||||||
|
- ls
|
||||||
- name: build
|
- name: build
|
||||||
image: golang:1.12
|
image: golang:1.12
|
||||||
commands:
|
commands:
|
||||||
- go build
|
- go build
|
||||||
- go test
|
- ls
|
||||||
|
|
||||||
- name: publish
|
- name: publish
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
settings:
|
settings:
|
||||||
registry: 172.20.32.1:5000
|
registry: 172.20.32.1:5000
|
||||||
repo: 172.20.32.1:5000/go/hello-world
|
repo: 172.20.32.1:5000/go/hello-world
|
||||||
insecure: true
|
insecure: true
|
||||||
tags: [ 1, 1.1, latest ]
|
tags: [ 1, 1.2, latest ]
|
@ -0,0 +1,3 @@
|
|||||||
|
FROM scratch
|
||||||
|
ADD example /
|
||||||
|
ENTRYPOINT ["/example"]
|
@ -0,0 +1,2 @@
|
|||||||
|
# example
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import "fmt"
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
fmt.Println(HelloWorld())
|
||||||
|
}
|
||||||
|
|
||||||
|
// HelloWorld is a function that returns a string containing "hello world".
|
||||||
|
func HelloWorld() string {
|
||||||
|
return "hello world"
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"os"
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestMain(m *testing.M) {
|
||||||
|
os.Exit(m.Run())
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestHelloWorld(t *testing.T) {
|
||||||
|
if HelloWorld() != "hello world" {
|
||||||
|
t.Errorf("got %s expected %s", HelloWorld(), "hello world")
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue