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
|
||||
name: default
|
||||
type: docker
|
||||
|
||||
steps:
|
||||
- name: test
|
||||
image: golang:1.12
|
||||
commands:
|
||||
- go test
|
||||
- ls
|
||||
- name: build
|
||||
image: golang:1.12
|
||||
commands:
|
||||
- go build
|
||||
- go test
|
||||
|
||||
- ls
|
||||
- name: publish
|
||||
image: plugins/docker
|
||||
settings:
|
||||
registry: 172.20.32.1:5000
|
||||
repo: 172.20.32.1:5000/go/hello-world
|
||||
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