diff --git a/test/e2e/tekton_test.go b/test/e2e/tekton_test.go index 84fcccf00f..42d1a728b5 100644 --- a/test/e2e/tekton_test.go +++ b/test/e2e/tekton_test.go @@ -50,10 +50,10 @@ func TestTektonPipeline(t *testing.T) { _, err = kubectl.RunWithOpts([]string{"apply", "-n", test.env.Namespace, "-f", basedir + "/kn-deployer-rbac.yaml"}, runOpts{}) assert.NilError(t, err) - _, err = kubectl.RunWithOpts([]string{"apply", "-n", test.env.Namespace, "-f", basedir + "/buildah-task.yaml"}, runOpts{}) + _, err = kubectl.RunWithOpts([]string{"apply", "-n", test.env.Namespace, "-f", "https://raw.githubusercontent.com/tektoncd/catalog/master/buildah/buildah.yaml"}, runOpts{}) assert.NilError(t, err) - _, err = kubectl.RunWithOpts([]string{"apply", "-n", test.env.Namespace, "-f", basedir + "/kn-task.yaml"}, runOpts{}) + _, err = kubectl.RunWithOpts([]string{"apply", "-n", test.env.Namespace, "-f", "https://raw.githubusercontent.com/tektoncd/catalog/master/kn/kn.yaml"}, runOpts{}) assert.NilError(t, err) _, err = kubectl.RunWithOpts([]string{"apply", "-n", test.env.Namespace, "-f", basedir + "/kn-pipeline.yaml"}, runOpts{}) diff --git a/test/resources/tekton/buildah-task.yaml b/test/resources/tekton/buildah-task.yaml deleted file mode 100644 index 306636f801..0000000000 --- a/test/resources/tekton/buildah-task.yaml +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright 2019 The Knative Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -apiVersion: tekton.dev/v1alpha1 -kind: Task -metadata: - name: buildah -spec: - inputs: - params: - - name: BUILDER_IMAGE - description: The location of the buildah builder image. - default: quay.io/buildah/stable:v1.11.0 - - name: DOCKERFILE - description: Path to the Dockerfile to build. - default: ./Dockerfile - - name: TLSVERIFY - description: Verify the TLS on the registry endpoint (for push/pull to a non-TLS registry) - default: "true" - - resources: - - name: source - type: git - - outputs: - resources: - - name: image - type: image - - steps: - - name: build - image: $(inputs.params.BUILDER_IMAGE) - workingDir: /workspace/source/test/test_images/helloworld - command: ['buildah', 'bud', '--tls-verify=$(inputs.params.TLSVERIFY)', '--layers', '-f', '$(inputs.params.DOCKERFILE)', '-t', '$(outputs.resources.image.url)', '.'] - volumeMounts: - - name: varlibcontainers - mountPath: /var/lib/containers - securityContext: - privileged: true - - - name: push - image: $(inputs.params.BUILDER_IMAGE) - workingDir: /workspace/source/test/test_images/helloworld - command: ['buildah', 'push', '--tls-verify=$(inputs.params.TLSVERIFY)', '$(outputs.resources.image.url)', 'docker://$(outputs.resources.image.url)'] - volumeMounts: - - name: varlibcontainers - mountPath: /var/lib/containers - securityContext: - privileged: true - - volumes: - - name: varlibcontainers - emptyDir: {} \ No newline at end of file diff --git a/test/resources/tekton/kn-pipeline.yaml b/test/resources/tekton/kn-pipeline.yaml index 54c05c7aad..70c583fe2d 100644 --- a/test/resources/tekton/kn-pipeline.yaml +++ b/test/resources/tekton/kn-pipeline.yaml @@ -38,6 +38,9 @@ spec: outputs: - name: image resource: image + params: + - name: DOCKERFILE + value: ./test/test_images/helloworld/Dockerfile - name: kn-service-create taskRef: name: kn diff --git a/test/resources/tekton/kn-task.yaml b/test/resources/tekton/kn-task.yaml deleted file mode 100644 index 7afa612f85..0000000000 --- a/test/resources/tekton/kn-task.yaml +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright 2019 The Knative Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -apiVersion: tekton.dev/v1alpha1 -kind: Task -metadata: - name: kn -spec: - inputs: - params: - - name: kn-image - description: kn CLI container image to run this task - default: gcr.io/knative-nightly/knative.dev/client/cmd/kn - - name: ARGS - type: array - description: kn CLI arguments to run - default: - - "help" - resources: - - name: image - type: image - steps: - - name: kn - image: "$(inputs.params.kn-image)" - command: ["/ko-app/kn"] - args: ["$(inputs.params.ARGS)"] diff --git a/test/test_images/helloworld/Dockerfile b/test/test_images/helloworld/Dockerfile index 0ff63b8344..c59fb76775 100644 --- a/test/test_images/helloworld/Dockerfile +++ b/test/test_images/helloworld/Dockerfile @@ -5,7 +5,7 @@ FROM golang:1.12 as builder # Copy local code to the container image. WORKDIR /go/src/knative.dev/client/test/test_images/helloworld -COPY . . +COPY ./test/test_images/helloworld/helloworld.go . # Build the command inside the container. # (You may fetch or manage dependencies here,