e2e: Run tekton e2e against pipeline v0.11.1 (#803)

* Use buildah task from master branch and paramterize FORMAT

* Configure pipeline v0.11.1

* DNM: Run tekton e2e in this PR

* Revert "DNM: Run tekton e2e in this PR"

This reverts commit 903f5bec409c90174a37cc84acd561a405ef896e.
This commit is contained in:
Navid Shaikh 2020-04-15 12:10:47 +05:30 committed by GitHub
parent 48f4359b24
commit 98282307f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 68 deletions

View File

@ -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")

View File

@ -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: {}

View File

@ -27,6 +27,8 @@ spec:
resourceRef:
name: buildah-build-kn-create-image
params:
- name: IMAGE_FORMAT
value: "docker"
- name: ARGS
value:
- "service"

View File

@ -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

View File

@ -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