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

Don't run GCB example on structure tests #1984

Merged
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
7 changes: 7 additions & 0 deletions examples/google-cloud-build/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM golang:1.10.1-alpine3.7 as builder
COPY main.go .
RUN go build -o /app main.go

FROM alpine:3.7
CMD ["./app"]
COPY --from=builder /app .
33 changes: 33 additions & 0 deletions examples/google-cloud-build/README.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
=== Example: Getting started with a simple go app
:icons: font

This is a simple example based on

* *building* a single go file app and with a multistage `Dockerfile` using Google Cloud Build
* *tagging* using the default tagPolicy (`gitCommit`)
* *deploying* a single container pod using `kubectl`

ifndef::env-github[]
==== link:{github-repo-tree}/examples/getting-started[Example files icon:github[]]

[source,yaml, indent=3, title=skaffold.yaml]
----
include::skaffold.yaml[]
----

[source,go, indent=3, title=main.go, syntax=go]
----
include::main.go[]
----

[source,docker, indent=3, title=Dockerfile]
----
include::Dockerfile[]
----

[source,yaml, indent=3, title=k8s-pod.yaml]
----
include::k8s-pod.yaml[]
----

endif::[]
8 changes: 8 additions & 0 deletions examples/google-cloud-build/k8s-pod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: Pod
metadata:
name: getting-started
spec:
containers:
- name: getting-started
image: gcr.io/k8s-skaffold/skaffold-example
14 changes: 14 additions & 0 deletions examples/google-cloud-build/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package main

import (
"fmt"
"time"
)

func main() {
for {
fmt.Println("Hello world!")

time.Sleep(time.Second * 1)
}
}
12 changes: 12 additions & 0 deletions examples/google-cloud-build/skaffold.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: skaffold/v1beta8
kind: Config
build:
googleCloudBuild:
projectId: k8s-skaffold
artifacts:
- image: gcr.io/k8s-skaffold/skaffold-example

deploy:
kubectl:
manifests:
- k8s-*
7 changes: 7 additions & 0 deletions integration/examples/google-cloud-build/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM golang:1.10.1-alpine3.7 as builder
COPY main.go .
RUN go build -o /app main.go

FROM alpine:3.7
CMD ["./app"]
COPY --from=builder /app .
33 changes: 33 additions & 0 deletions integration/examples/google-cloud-build/README.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
=== Example: Getting started with a simple go app
:icons: font

This is a simple example based on

* *building* a single go file app and with a multistage `Dockerfile` using Google Cloud Build
* *tagging* using the default tagPolicy (`gitCommit`)
* *deploying* a single container pod using `kubectl`

ifndef::env-github[]
==== link:{github-repo-tree}/examples/getting-started[Example files icon:github[]]

[source,yaml, indent=3, title=skaffold.yaml]
----
include::skaffold.yaml[]
----

[source,go, indent=3, title=main.go, syntax=go]
----
include::main.go[]
----

[source,docker, indent=3, title=Dockerfile]
----
include::Dockerfile[]
----

[source,yaml, indent=3, title=k8s-pod.yaml]
----
include::k8s-pod.yaml[]
----

endif::[]
8 changes: 8 additions & 0 deletions integration/examples/google-cloud-build/k8s-pod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: Pod
metadata:
name: getting-started
spec:
containers:
- name: getting-started
image: gcr.io/k8s-skaffold/skaffold-example
14 changes: 14 additions & 0 deletions integration/examples/google-cloud-build/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package main

import (
"fmt"
"time"
)

func main() {
for {
fmt.Println("Hello world!")

time.Sleep(time.Second * 1)
}
}
11 changes: 11 additions & 0 deletions integration/examples/google-cloud-build/skaffold.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: skaffold/v1beta8
kind: Config
build:
googleCloudBuild:
projectId: k8s-skaffold
artifacts:
- image: gcr.io/k8s-skaffold/skaffold-example
deploy:
kubectl:
manifests:
- k8s-*
4 changes: 0 additions & 4 deletions integration/examples/structure-tests/skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ deploy:
manifests:
- k8s-*
profiles:
- name: gcb
build:
googleCloudBuild:
projectId: k8s-skaffold
- name: test
test:
- image: gcr.io/k8s-skaffold/skaffold-example
Expand Down
3 changes: 1 addition & 2 deletions integration/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ func TestRun(t *testing.T) {
pods: []string{"bazel"},
}, {
description: "Google Cloud Build",
dir: "examples/structure-tests",
args: []string{"-p", "gcb"},
dir: "examples/google-cloud-build",
pods: []string{"getting-started"},
remoteOnly: true,
}, {
Expand Down