diff --git a/test/e2e/tekton_test.go b/test/e2e/tekton_test.go index b2ac387b4c..6567ed329b 100644 --- a/test/e2e/tekton_test.go +++ b/test/e2e/tekton_test.go @@ -55,7 +55,7 @@ func TestTektonPipeline(t *testing.T) { _, err = kubectl.Run("apply", "-f", basedir+"/kn-deployer-rbac.yaml") assert.NilError(t, err) - _, err = kubectl.Run("apply", "-f", basedir+"/buildah.yaml") + _, err = kubectl.Run("apply", "-f", "https://raw.githubusercontent.com/tektoncd/catalog/master/buildah/buildah.yaml") assert.NilError(t, err) _, err = kubectl.Run("apply", "-f", "https://raw.githubusercontent.com/tektoncd/catalog/master/kn/kn.yaml") diff --git a/test/resources/tekton/buildah.yaml b/test/resources/tekton/buildah.yaml deleted file mode 100644 index 1e9635b277..0000000000 --- a/test/resources/tekton/buildah.yaml +++ /dev/null @@ -1,66 +0,0 @@ -# Copyright 2020 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. -# Define a ServiceAccount named kn-deployer-account that has permission to -# manage Knative services. ---- -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 - command: ['buildah', 'bud', '--format=docker', '--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 - 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: {} diff --git a/test/resources/tekton/kn-pipeline-run.yaml b/test/resources/tekton/kn-pipeline-run.yaml index 9a5b671c48..f8f2757fb9 100644 --- a/test/resources/tekton/kn-pipeline-run.yaml +++ b/test/resources/tekton/kn-pipeline-run.yaml @@ -27,6 +27,8 @@ spec: resourceRef: name: buildah-build-kn-create-image params: + - name: IMAGE_FORMAT + value: "docker" - name: ARGS value: - "service" diff --git a/test/resources/tekton/kn-pipeline.yaml b/test/resources/tekton/kn-pipeline.yaml index 6e1d8bbda4..0f4bbb51b3 100644 --- a/test/resources/tekton/kn-pipeline.yaml +++ b/test/resources/tekton/kn-pipeline.yaml @@ -27,6 +27,9 @@ spec: description: Arguments to pass to kn CLI default: - "help" + - name: IMAGE_FORMAT + type: string + description: Image format to build and push to registry tasks: - name: buildah-build taskRef: @@ -43,6 +46,8 @@ spec: value: ./test/test_images/helloworld/Dockerfile - name: BUILDER_IMAGE value: "quay.io/buildah/stable:latest" + - name: FORMAT + value: "$(params.IMAGE_FORMAT)" - name: kn-service-create taskRef: name: kn diff --git a/test/tekton-tests.sh b/test/tekton-tests.sh index 27594a46bb..4b0a3c3315 100755 --- a/test/tekton-tests.sh +++ b/test/tekton-tests.sh @@ -28,16 +28,18 @@ export PATH=$PATH:${REPO_ROOT_DIR} # Script entry point. initialize $@ -export TEKTON_VERSION=${TEKTON_VERSION:-v0.9.2} +export TEKTON_VERSION=${TEKTON_VERSION:-v0.11.1} export KN_E2E_NAMESPACE=tkn-kn header "Running integration tests for Tekton" +subheader "Installing Tekton Pipelines ${TEKTON_VERSION}" # Install Tekton if not already installed if [[ $(kubectl api-resources | grep -c tekton.dev) -eq 0 ]]; then kubectl apply -f https://github.com/tektoncd/pipeline/releases/download/${TEKTON_VERSION}/release.yaml fi +subheader "Configuring docker and registry" if (( IS_PROW )); then # Configure Docker so that we can create a secret for GCR gcloud auth configure-docker @@ -53,6 +55,7 @@ for file in kn-deployer-rbac kn-pipeline-resource; do -e "s#\${CONTAINER_REGISTRY}#${CONTAINER_REGISTRY}#" ${resource_dir}/${file}-template.yaml > ${resource_dir}/${file}.yaml done +subheader "Running test pipeline" go_test_e2e -timeout=30m -tags=tekton ./test/e2e || fail_test success