Skip to content

Commit c3e0226

Browse files
authored
Merge pull request #879 from r2d4/bazel
add bazel to skaffold docker image, add integration test for bazel
2 parents a011cbe + 58df382 commit c3e0226

File tree

4 files changed

+25
-2
lines changed

4 files changed

+25
-2
lines changed

deploy/skaffold/Dockerfile

+6
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ RUN curl -LO https://github.com/kubernetes-sigs/kustomize/releases/download/v${K
4646
chmod +x kustomize_${KUSTOMIZE_VERSION}_linux_amd64 && \
4747
mv kustomize_${KUSTOMIZE_VERSION}_linux_amd64 /usr/local/bin/kustomize
4848

49+
RUN echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list \
50+
&& curl https://bazel.build/bazel-release.pub.gpg | apt-key add -
51+
52+
RUN apt-get update \
53+
&& apt-get install -y bazel
54+
4955
ENV PATH /usr/local/go/bin:/go/bin:/google-cloud-sdk/bin:$PATH
5056

5157
FROM runtime_deps as builder

examples/bazel/k8s/k8s-pod.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: bazel
5+
spec:
6+
containers:
7+
- name: bazel
8+
image: gcr.io/k8s-skaffold/skaffold-bazel

examples/bazel/skaffold.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@ apiVersion: skaffold/v1alpha2
22
kind: Config
33
build:
44
artifacts:
5-
- imageName: gcr.io/k8s-skaffold/skaffold-example
5+
- imageName: gcr.io/k8s-skaffold/skaffold-bazel
66
workspace: .
77
bazel:
88
target: //:skaffold_example.tar
99
local: {}
1010
deploy:
1111
kubectl:
1212
manifests:
13-
- ../getting-started/k8s-*

integration/run_test.go

+10
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,16 @@ func TestRun(t *testing.T) {
161161
},
162162
dir: "../examples/kustomize",
163163
},
164+
{
165+
description: "bazel example",
166+
args: []string{"run"},
167+
pods: []testObject{
168+
{
169+
name: "bazel",
170+
},
171+
},
172+
dir: "../examples/bazel",
173+
},
164174
{
165175
description: "kaniko example",
166176
args: []string{"run"},

0 commit comments

Comments
 (0)