diff --git a/task/buildah/0.1/tests/pre-apply-task-hook.sh b/task/buildah/0.1/tests/pre-apply-task-hook.sh index d810d148ad..e39fb789ab 100755 --- a/task/buildah/0.1/tests/pre-apply-task-hook.sh +++ b/task/buildah/0.1/tests/pre-apply-task-hook.sh @@ -5,4 +5,4 @@ add_sidecar_registry ${TMPF} # Add git-clone -kubectl -n ${tns} apply -f ./git/git-clone.yaml +kubectl -n ${tns} apply -f ./task/git-clone/0.1/git-clone.yaml diff --git a/task/buildpacks-v3/0.1/tests/pre-apply-task-hook.sh b/task/buildpacks-v3/0.1/tests/pre-apply-task-hook.sh index d810d148ad..e39fb789ab 100755 --- a/task/buildpacks-v3/0.1/tests/pre-apply-task-hook.sh +++ b/task/buildpacks-v3/0.1/tests/pre-apply-task-hook.sh @@ -5,4 +5,4 @@ add_sidecar_registry ${TMPF} # Add git-clone -kubectl -n ${tns} apply -f ./git/git-clone.yaml +kubectl -n ${tns} apply -f ./task/git-clone/0.1/git-clone.yaml diff --git a/task/git-batch-merge/0.1/tests/run.yaml b/task/git-batch-merge/0.1/tests/run.yaml index 7e373f59d2..6a523e1173 100644 --- a/task/git-batch-merge/0.1/tests/run.yaml +++ b/task/git-batch-merge/0.1/tests/run.yaml @@ -1,141 +1,4 @@ --- -apiVersion: tekton.dev/v1beta1 -kind: TaskRun -metadata: - name: git-cli-run -spec: - taskRef: - name: git-cli - workspaces: - - name: source - emptyDir: {} - - name: input - emptyDir: {} - params: - - name: GIT_SCRIPT - value: | - git init - git remote add origin https://github.com/kelseyhightower/nocode - git pull origin master ---- -apiVersion: tekton.dev/v1alpha1 -kind: TaskRun -metadata: - name: git-clone-run-noargs -spec: - workspaces: - - name: output - emptyDir: {} - taskRef: - name: git-clone - inputs: - params: - - name: url - value: https://github.com/kelseyhightower/nocode ---- -apiVersion: tekton.dev/v1alpha1 -kind: TaskRun -metadata: - name: git-clone-run-tag -spec: - workspaces: - - name: output - emptyDir: {} - taskRef: - name: git-clone - inputs: - params: - - name: url - value: https://github.com/kelseyhightower/nocode - - name: revision - value: 1.0.0 - ---- -apiVersion: tekton.dev/v1alpha1 -kind: TaskRun -metadata: - name: git-clone-run-no-submodules -spec: - workspaces: - - name: output - emptyDir: {} - taskRef: - name: git-clone - inputs: - params: - - name: url - value: https://github.com/githubtraining/example-dependency - - name: submodules - value: "false" ---- -apiVersion: tekton.dev/v1alpha1 -kind: TaskRun -metadata: - name: git-clone-run-no-depth-2 -spec: - workspaces: - - name: output - emptyDir: {} - taskRef: - name: git-clone - inputs: - params: - - name: url - value: https://github.com/kelseyhightower/nocode - - name: depth - value: "2" ---- -apiVersion: tekton.dev/v1alpha1 -kind: TaskRun -metadata: - name: git-clone-run-sslverify-none -spec: - workspaces: - - name: output - emptyDir: {} - taskRef: - name: git-clone - inputs: - params: - - name: url - value: https://github.com/kelseyhightower/nocode - - name: sslVerify - value: "false" ---- -apiVersion: tekton.dev/v1alpha1 -kind: TaskRun -metadata: - name: git-clone-run-subdirectory -spec: - workspaces: - - name: output - emptyDir: {} - taskRef: - name: git-clone - inputs: - params: - - name: url - value: https://github.com/kelseyhightower/nocode - - name: subdirectory - value: "hellomoto" ---- -apiVersion: tekton.dev/v1alpha1 -kind: TaskRun -metadata: - name: git-clone-run-delete-existing -spec: - workspaces: - - name: output - emptyDir: {} - taskRef: - name: git-clone - inputs: - params: - - name: url - value: https://github.com/kelseyhightower/nocode - - name: deleteExisting - value: "true" ---- apiVersion: tekton.dev/v1alpha1 kind: TaskRun metadata: diff --git a/task/git-cli/0.1/tests/run.yaml b/task/git-cli/0.1/tests/run.yaml index 7e373f59d2..8404a8283d 100644 --- a/task/git-cli/0.1/tests/run.yaml +++ b/task/git-cli/0.1/tests/run.yaml @@ -17,159 +17,3 @@ spec: git init git remote add origin https://github.com/kelseyhightower/nocode git pull origin master ---- -apiVersion: tekton.dev/v1alpha1 -kind: TaskRun -metadata: - name: git-clone-run-noargs -spec: - workspaces: - - name: output - emptyDir: {} - taskRef: - name: git-clone - inputs: - params: - - name: url - value: https://github.com/kelseyhightower/nocode ---- -apiVersion: tekton.dev/v1alpha1 -kind: TaskRun -metadata: - name: git-clone-run-tag -spec: - workspaces: - - name: output - emptyDir: {} - taskRef: - name: git-clone - inputs: - params: - - name: url - value: https://github.com/kelseyhightower/nocode - - name: revision - value: 1.0.0 - ---- -apiVersion: tekton.dev/v1alpha1 -kind: TaskRun -metadata: - name: git-clone-run-no-submodules -spec: - workspaces: - - name: output - emptyDir: {} - taskRef: - name: git-clone - inputs: - params: - - name: url - value: https://github.com/githubtraining/example-dependency - - name: submodules - value: "false" ---- -apiVersion: tekton.dev/v1alpha1 -kind: TaskRun -metadata: - name: git-clone-run-no-depth-2 -spec: - workspaces: - - name: output - emptyDir: {} - taskRef: - name: git-clone - inputs: - params: - - name: url - value: https://github.com/kelseyhightower/nocode - - name: depth - value: "2" ---- -apiVersion: tekton.dev/v1alpha1 -kind: TaskRun -metadata: - name: git-clone-run-sslverify-none -spec: - workspaces: - - name: output - emptyDir: {} - taskRef: - name: git-clone - inputs: - params: - - name: url - value: https://github.com/kelseyhightower/nocode - - name: sslVerify - value: "false" ---- -apiVersion: tekton.dev/v1alpha1 -kind: TaskRun -metadata: - name: git-clone-run-subdirectory -spec: - workspaces: - - name: output - emptyDir: {} - taskRef: - name: git-clone - inputs: - params: - - name: url - value: https://github.com/kelseyhightower/nocode - - name: subdirectory - value: "hellomoto" ---- -apiVersion: tekton.dev/v1alpha1 -kind: TaskRun -metadata: - name: git-clone-run-delete-existing -spec: - workspaces: - - name: output - emptyDir: {} - taskRef: - name: git-clone - inputs: - params: - - name: url - value: https://github.com/kelseyhightower/nocode - - name: deleteExisting - value: "true" ---- -apiVersion: tekton.dev/v1alpha1 -kind: TaskRun -metadata: - name: git-batch-merge-test-mode-merge -spec: - workspaces: - - name: output - emptyDir: {} - taskRef: - name: git-batch-merge - inputs: - params: - - name: url - value: https://github.com/kelseyhightower/nocode - - name: mode - value: "merge" - - name: batchedRefs - value: "refs/pull/4014/head refs/pull/3894/head" ---- -apiVersion: tekton.dev/v1alpha1 -kind: TaskRun -metadata: - name: git-batch-merge-test-mode-merge-cherry-pick -spec: - workspaces: - - name: output - emptyDir: {} - taskRef: - name: git-batch-merge - inputs: - params: - - name: url - value: https://github.com/kelseyhightower/nocode - - name: mode - value: "cherry-pick" - - name: batchedRefs - value: "refs/pull/4014/head refs/pull/3894/head" diff --git a/task/git-clone/0.1/tests/run.yaml b/task/git-clone/0.1/tests/run.yaml index 7e373f59d2..6671665663 100644 --- a/task/git-clone/0.1/tests/run.yaml +++ b/task/git-clone/0.1/tests/run.yaml @@ -1,23 +1,4 @@ --- -apiVersion: tekton.dev/v1beta1 -kind: TaskRun -metadata: - name: git-cli-run -spec: - taskRef: - name: git-cli - workspaces: - - name: source - emptyDir: {} - - name: input - emptyDir: {} - params: - - name: GIT_SCRIPT - value: | - git init - git remote add origin https://github.com/kelseyhightower/nocode - git pull origin master ---- apiVersion: tekton.dev/v1alpha1 kind: TaskRun metadata: @@ -135,41 +116,3 @@ spec: value: https://github.com/kelseyhightower/nocode - name: deleteExisting value: "true" ---- -apiVersion: tekton.dev/v1alpha1 -kind: TaskRun -metadata: - name: git-batch-merge-test-mode-merge -spec: - workspaces: - - name: output - emptyDir: {} - taskRef: - name: git-batch-merge - inputs: - params: - - name: url - value: https://github.com/kelseyhightower/nocode - - name: mode - value: "merge" - - name: batchedRefs - value: "refs/pull/4014/head refs/pull/3894/head" ---- -apiVersion: tekton.dev/v1alpha1 -kind: TaskRun -metadata: - name: git-batch-merge-test-mode-merge-cherry-pick -spec: - workspaces: - - name: output - emptyDir: {} - taskRef: - name: git-batch-merge - inputs: - params: - - name: url - value: https://github.com/kelseyhightower/nocode - - name: mode - value: "cherry-pick" - - name: batchedRefs - value: "refs/pull/4014/head refs/pull/3894/head" diff --git a/task/git-rebase/0.1/tests/run.yaml b/task/git-rebase/0.1/tests/run.yaml deleted file mode 100644 index 7e373f59d2..0000000000 --- a/task/git-rebase/0.1/tests/run.yaml +++ /dev/null @@ -1,175 +0,0 @@ ---- -apiVersion: tekton.dev/v1beta1 -kind: TaskRun -metadata: - name: git-cli-run -spec: - taskRef: - name: git-cli - workspaces: - - name: source - emptyDir: {} - - name: input - emptyDir: {} - params: - - name: GIT_SCRIPT - value: | - git init - git remote add origin https://github.com/kelseyhightower/nocode - git pull origin master ---- -apiVersion: tekton.dev/v1alpha1 -kind: TaskRun -metadata: - name: git-clone-run-noargs -spec: - workspaces: - - name: output - emptyDir: {} - taskRef: - name: git-clone - inputs: - params: - - name: url - value: https://github.com/kelseyhightower/nocode ---- -apiVersion: tekton.dev/v1alpha1 -kind: TaskRun -metadata: - name: git-clone-run-tag -spec: - workspaces: - - name: output - emptyDir: {} - taskRef: - name: git-clone - inputs: - params: - - name: url - value: https://github.com/kelseyhightower/nocode - - name: revision - value: 1.0.0 - ---- -apiVersion: tekton.dev/v1alpha1 -kind: TaskRun -metadata: - name: git-clone-run-no-submodules -spec: - workspaces: - - name: output - emptyDir: {} - taskRef: - name: git-clone - inputs: - params: - - name: url - value: https://github.com/githubtraining/example-dependency - - name: submodules - value: "false" ---- -apiVersion: tekton.dev/v1alpha1 -kind: TaskRun -metadata: - name: git-clone-run-no-depth-2 -spec: - workspaces: - - name: output - emptyDir: {} - taskRef: - name: git-clone - inputs: - params: - - name: url - value: https://github.com/kelseyhightower/nocode - - name: depth - value: "2" ---- -apiVersion: tekton.dev/v1alpha1 -kind: TaskRun -metadata: - name: git-clone-run-sslverify-none -spec: - workspaces: - - name: output - emptyDir: {} - taskRef: - name: git-clone - inputs: - params: - - name: url - value: https://github.com/kelseyhightower/nocode - - name: sslVerify - value: "false" ---- -apiVersion: tekton.dev/v1alpha1 -kind: TaskRun -metadata: - name: git-clone-run-subdirectory -spec: - workspaces: - - name: output - emptyDir: {} - taskRef: - name: git-clone - inputs: - params: - - name: url - value: https://github.com/kelseyhightower/nocode - - name: subdirectory - value: "hellomoto" ---- -apiVersion: tekton.dev/v1alpha1 -kind: TaskRun -metadata: - name: git-clone-run-delete-existing -spec: - workspaces: - - name: output - emptyDir: {} - taskRef: - name: git-clone - inputs: - params: - - name: url - value: https://github.com/kelseyhightower/nocode - - name: deleteExisting - value: "true" ---- -apiVersion: tekton.dev/v1alpha1 -kind: TaskRun -metadata: - name: git-batch-merge-test-mode-merge -spec: - workspaces: - - name: output - emptyDir: {} - taskRef: - name: git-batch-merge - inputs: - params: - - name: url - value: https://github.com/kelseyhightower/nocode - - name: mode - value: "merge" - - name: batchedRefs - value: "refs/pull/4014/head refs/pull/3894/head" ---- -apiVersion: tekton.dev/v1alpha1 -kind: TaskRun -metadata: - name: git-batch-merge-test-mode-merge-cherry-pick -spec: - workspaces: - - name: output - emptyDir: {} - taskRef: - name: git-batch-merge - inputs: - params: - - name: url - value: https://github.com/kelseyhightower/nocode - - name: mode - value: "cherry-pick" - - name: batchedRefs - value: "refs/pull/4014/head refs/pull/3894/head" diff --git a/task/golang-build/0.1/tests/pre-apply-task-hook.sh b/task/golang-build/0.1/tests/pre-apply-task-hook.sh index d810d148ad..e39fb789ab 100755 --- a/task/golang-build/0.1/tests/pre-apply-task-hook.sh +++ b/task/golang-build/0.1/tests/pre-apply-task-hook.sh @@ -5,4 +5,4 @@ add_sidecar_registry ${TMPF} # Add git-clone -kubectl -n ${tns} apply -f ./git/git-clone.yaml +kubectl -n ${tns} apply -f ./task/git-clone/0.1/git-clone.yaml diff --git a/task/golang-build/0.1/tests/run.yaml b/task/golang-build/0.1/tests/run.yaml index 7bd8c9e9d1..afe510def5 100644 --- a/task/golang-build/0.1/tests/run.yaml +++ b/task/golang-build/0.1/tests/run.yaml @@ -20,17 +20,6 @@ spec: value: "" - name: deleteExisting value: "true" - - name: run-lint - taskRef: - name: golangci-lint - runAfter: - - fetch-repository - workspaces: - - name: source - workspace: shared-workspace - params: - - name: package - value: github.com/tektoncd/pipeline - name: run-build taskRef: name: golang-build @@ -42,17 +31,6 @@ spec: params: - name: package value: github.com/tektoncd/pipeline - - name: run-test - taskRef: - name: golang-test - runAfter: - - fetch-repository - workspaces: - - name: source - workspace: shared-workspace - params: - - name: package - value: github.com/tektoncd/pipeline --- apiVersion: tekton.dev/v1beta1 diff --git a/task/golang-test/0.1/tests.yaml b/task/golang-test/0.1/tests.yaml deleted file mode 100644 index daf995df48..0000000000 --- a/task/golang-test/0.1/tests.yaml +++ /dev/null @@ -1,53 +0,0 @@ -apiVersion: tekton.dev/v1beta1 -kind: Task -metadata: - name: golang-test - labels: - app.kubernetes.io/version: "0.1" - annotations: - tekton.dev/pipelines.minVersion: "0.12.1" - tags: test - displayName: "golang test" -spec: - description: >- - This Task is Golang task to test Go projects. - - params: - - name: package - description: package (and its children) under test - - name: packages - description: "packages to test (default: ./...)" - default: "./..." - - name: version - description: golang version to use for tests - default: "latest" - - name: flags - description: flags to use for the test command - default: -race -cover -v - - name: GOOS - description: "running program's operating system target" - default: linux - - name: GOARCH - description: "running program's architecture target" - default: amd64 - - name: GO111MODULE - description: "value of module support" - default: auto - workspaces: - - name: source - mountPath: /workspace/src/$(params.package) - steps: - - name: unit-test - image: golang:$(params.version) - workingDir: $(workspaces.source.path) - script: | - go test $(params.flags) $(params.packages) - env: - - name: GOPATH - value: /workspace - - name: GOOS - value: "$(params.GOOS)" - - name: GOARCH - value: "$(params.GOARCH)" - - name: GO111MODULE - value: "$(params.GO111MODULE)" diff --git a/task/golang-test/0.1/tests/pre-apply-task-hook.sh b/task/golang-test/0.1/tests/pre-apply-task-hook.sh index d810d148ad..e39fb789ab 100755 --- a/task/golang-test/0.1/tests/pre-apply-task-hook.sh +++ b/task/golang-test/0.1/tests/pre-apply-task-hook.sh @@ -5,4 +5,4 @@ add_sidecar_registry ${TMPF} # Add git-clone -kubectl -n ${tns} apply -f ./git/git-clone.yaml +kubectl -n ${tns} apply -f ./task/git-clone/0.1/git-clone.yaml diff --git a/task/golang-test/0.1/tests/run.yaml b/task/golang-test/0.1/tests/run.yaml index 7bd8c9e9d1..e6751dddfa 100644 --- a/task/golang-test/0.1/tests/run.yaml +++ b/task/golang-test/0.1/tests/run.yaml @@ -20,28 +20,6 @@ spec: value: "" - name: deleteExisting value: "true" - - name: run-lint - taskRef: - name: golangci-lint - runAfter: - - fetch-repository - workspaces: - - name: source - workspace: shared-workspace - params: - - name: package - value: github.com/tektoncd/pipeline - - name: run-build - taskRef: - name: golang-build - runAfter: - - fetch-repository - workspaces: - - name: source - workspace: shared-workspace - params: - - name: package - value: github.com/tektoncd/pipeline - name: run-test taskRef: name: golang-test diff --git a/task/golangci-lint/0.1/tests/pre-apply-task-hook.sh b/task/golangci-lint/0.1/tests/pre-apply-task-hook.sh index d810d148ad..e39fb789ab 100755 --- a/task/golangci-lint/0.1/tests/pre-apply-task-hook.sh +++ b/task/golangci-lint/0.1/tests/pre-apply-task-hook.sh @@ -5,4 +5,4 @@ add_sidecar_registry ${TMPF} # Add git-clone -kubectl -n ${tns} apply -f ./git/git-clone.yaml +kubectl -n ${tns} apply -f ./task/git-clone/0.1/git-clone.yaml diff --git a/task/golangci-lint/0.1/tests/run.yaml b/task/golangci-lint/0.1/tests/run.yaml index 7bd8c9e9d1..e33c058c52 100644 --- a/task/golangci-lint/0.1/tests/run.yaml +++ b/task/golangci-lint/0.1/tests/run.yaml @@ -31,28 +31,6 @@ spec: params: - name: package value: github.com/tektoncd/pipeline - - name: run-build - taskRef: - name: golang-build - runAfter: - - fetch-repository - workspaces: - - name: source - workspace: shared-workspace - params: - - name: package - value: github.com/tektoncd/pipeline - - name: run-test - taskRef: - name: golang-test - runAfter: - - fetch-repository - workspaces: - - name: source - workspace: shared-workspace - params: - - name: package - value: github.com/tektoncd/pipeline --- apiVersion: tekton.dev/v1beta1 diff --git a/task/helm-upgrade-from-repo/0.1/tests/pre-apply-task-hook.sh b/task/helm-upgrade-from-repo/0.1/tests/pre-apply-task-hook.sh index 981275632d..93ca75c4b5 100755 --- a/task/helm-upgrade-from-repo/0.1/tests/pre-apply-task-hook.sh +++ b/task/helm-upgrade-from-repo/0.1/tests/pre-apply-task-hook.sh @@ -1,7 +1,7 @@ #!/bin/bash # Add git-clone -kubectl -n ${tns} apply -f ./git/git-clone.yaml +kubectl -n ${tns} apply -f ./task/git-clone/0.1/git-clone.yaml # Add service account kubectl -n ${tns} create serviceaccount helm-pipeline-run-sa -o yaml --dry-run=client | kubectl apply -f - diff --git a/task/helm-upgrade-from-repo/0.1/tests/run.yaml b/task/helm-upgrade-from-repo/0.1/tests/run.yaml index 6a52b70c84..55180377a8 100644 --- a/task/helm-upgrade-from-repo/0.1/tests/run.yaml +++ b/task/helm-upgrade-from-repo/0.1/tests/run.yaml @@ -34,23 +34,6 @@ spec: value: "" - name: deleteExisting value: "true" - - name: helm-upgrade-from-source - taskRef: - name: helm-upgrade-from-source - runAfter: - - fetch-repository - workspaces: - - name: source - workspace: shared-workspace - params: - - name: charts_dir - value: helm-sample-chart - - name: release_version - value: v1.0.0 - - name: release_name - value: helm-source-sample - - name: overwrite_values - value: "autoscaling.enabled=true,autoscaling.maxReplicas=3" --- apiVersion: tekton.dev/v1beta1 kind: PipelineRun diff --git a/task/helm-upgrade-from-source/0.1/tests/pre-apply-task-hook.sh b/task/helm-upgrade-from-source/0.1/tests/pre-apply-task-hook.sh index 981275632d..93ca75c4b5 100755 --- a/task/helm-upgrade-from-source/0.1/tests/pre-apply-task-hook.sh +++ b/task/helm-upgrade-from-source/0.1/tests/pre-apply-task-hook.sh @@ -1,7 +1,7 @@ #!/bin/bash # Add git-clone -kubectl -n ${tns} apply -f ./git/git-clone.yaml +kubectl -n ${tns} apply -f ./task/git-clone/0.1/git-clone.yaml # Add service account kubectl -n ${tns} create serviceaccount helm-pipeline-run-sa -o yaml --dry-run=client | kubectl apply -f - diff --git a/task/helm-upgrade-from-source/0.1/tests/run.yaml b/task/helm-upgrade-from-source/0.1/tests/run.yaml index 6a52b70c84..1712e9ccde 100644 --- a/task/helm-upgrade-from-source/0.1/tests/run.yaml +++ b/task/helm-upgrade-from-source/0.1/tests/run.yaml @@ -7,20 +7,6 @@ spec: workspaces: - name: shared-workspace tasks: - - name: helm-upgrade-from-repo - taskRef: - name: helm-upgrade-from-repo - params: - - name: helm_repo - value: https://kubernetes-charts.storage.googleapis.com - - name: chart_name - value: stable/envoy - - name: release_version - value: v1.0.0 - - name: release_name - value: helm-repo-sample - - name: overwrite_values - value: autoscaling.enabled=true,autoscaling.maxReplicas=3 - name: fetch-repository taskRef: name: git-clone diff --git a/task/jib-gradle/0.1/tests/pre-apply-task-hook.sh b/task/jib-gradle/0.1/tests/pre-apply-task-hook.sh index cf2406f8e0..aaa8b5c315 100755 --- a/task/jib-gradle/0.1/tests/pre-apply-task-hook.sh +++ b/task/jib-gradle/0.1/tests/pre-apply-task-hook.sh @@ -5,4 +5,4 @@ add_sidecar_registry ${TMPF} # Add git-clone -kubectl -n ${tns} apply -f ./git/git-clone.yaml +kubectl -n ${tns} apply -f ./task/git-clone/0.1/git-clone.yaml diff --git a/task/jib-maven/0.1/tests/pre-apply-task-hook.sh b/task/jib-maven/0.1/tests/pre-apply-task-hook.sh index cf2406f8e0..aaa8b5c315 100755 --- a/task/jib-maven/0.1/tests/pre-apply-task-hook.sh +++ b/task/jib-maven/0.1/tests/pre-apply-task-hook.sh @@ -5,4 +5,4 @@ add_sidecar_registry ${TMPF} # Add git-clone -kubectl -n ${tns} apply -f ./git/git-clone.yaml +kubectl -n ${tns} apply -f ./task/git-clone/0.1/git-clone.yaml diff --git a/task/kaniko/0.1/tests/pre-apply-task-hook.sh b/task/kaniko/0.1/tests/pre-apply-task-hook.sh index cf2406f8e0..aaa8b5c315 100755 --- a/task/kaniko/0.1/tests/pre-apply-task-hook.sh +++ b/task/kaniko/0.1/tests/pre-apply-task-hook.sh @@ -5,4 +5,4 @@ add_sidecar_registry ${TMPF} # Add git-clone -kubectl -n ${tns} apply -f ./git/git-clone.yaml +kubectl -n ${tns} apply -f ./task/git-clone/0.1/git-clone.yaml diff --git a/task/maven/0.1/tests/pre-apply-task-hook.sh b/task/maven/0.1/tests/pre-apply-task-hook.sh index 2bdaa43459..51a3a68e88 100755 --- a/task/maven/0.1/tests/pre-apply-task-hook.sh +++ b/task/maven/0.1/tests/pre-apply-task-hook.sh @@ -1,4 +1,4 @@ #!/bin/bash # Add git-clone -kubectl -n ${tns} apply -f ./git/git-clone.yaml +kubectl -n ${tns} apply -f ./task/git-clone/0.1/git-clone.yaml diff --git a/task/prettier/0.1/tests/pre-apply-task-hook.sh b/task/prettier/0.1/tests/pre-apply-task-hook.sh index 2d2fe0ef61..22c79fc1fa 100644 --- a/task/prettier/0.1/tests/pre-apply-task-hook.sh +++ b/task/prettier/0.1/tests/pre-apply-task-hook.sh @@ -1,4 +1,4 @@ #!/bin/bash # Add git-clone -kubectl -n ${tns} apply -f ./git/git-clone.yaml \ No newline at end of file +kubectl -n ${tns} apply -f ./task/git-clone/0.1/git-clone.yaml \ No newline at end of file diff --git a/task/replace-tokens/0.1/tests/pre-apply-task-hook.sh b/task/replace-tokens/0.1/tests/pre-apply-task-hook.sh index 2d2fe0ef61..22c79fc1fa 100644 --- a/task/replace-tokens/0.1/tests/pre-apply-task-hook.sh +++ b/task/replace-tokens/0.1/tests/pre-apply-task-hook.sh @@ -1,4 +1,4 @@ #!/bin/bash # Add git-clone -kubectl -n ${tns} apply -f ./git/git-clone.yaml \ No newline at end of file +kubectl -n ${tns} apply -f ./task/git-clone/0.1/git-clone.yaml \ No newline at end of file diff --git a/task/s2i/0.1/tests/pre-apply-task-hook.sh b/task/s2i/0.1/tests/pre-apply-task-hook.sh index 10268ab386..f17f4b7cb3 100755 --- a/task/s2i/0.1/tests/pre-apply-task-hook.sh +++ b/task/s2i/0.1/tests/pre-apply-task-hook.sh @@ -5,4 +5,4 @@ add_sidecar_registry ${TMPF} # Add git-clone -kubectl -n ${tns} apply -f ./git/git-clone.yaml +kubectl -n ${tns} apply -f ./task/git-clone/0.1/git-clone.yaml diff --git a/task/skopeo-copy/0.1/README.md b/task/skopeo-copy/0.1/README.md index d86bb620ef..a8afea3f7d 100644 --- a/task/skopeo-copy/0.1/README.md +++ b/task/skopeo-copy/0.1/README.md @@ -48,6 +48,8 @@ kubectl apply -f https://raw.githubusercontent.com/tektoncd/catalog/master/task/ - **srcImageURL**: The URL of the image to be copied to the `destination` registry. - **destImageURL**: The URL of the image where the image from `source` should be copied to. +- **srcTLSverify**: Verify the TLS on the src registry endpoint +- **destTLSverify**: Verify the TLS on the dest registry endpoint ## Workspace diff --git a/task/skopeo-copy/0.1/skopeo-copy.yaml b/task/skopeo-copy/0.1/skopeo-copy.yaml index 628773b5bc..7f1f05bccc 100644 --- a/task/skopeo-copy/0.1/skopeo-copy.yaml +++ b/task/skopeo-copy/0.1/skopeo-copy.yaml @@ -29,6 +29,14 @@ spec: description: URL of the image where the image from source should be copied to type: string default: "" + - name: srcTLSverify + description: Verify the TLS on the src registry endpoint + type: string + default: "true" + - name: destTLSverify + description: Verify the TLS on the dest registry endpoint + type: string + default: "true" steps: - name: skopeo-copy image: quay.io/vinamra2807/skopeo:latest @@ -46,7 +54,7 @@ spec: cmd="$cmd \ $url" done - skopeo copy $cmd + skopeo copy $cmd --src-tls-verify=$(params.srcTLSverify) --dest-tls-verify=$(params.destTLSverify) echo $cmd done < "$filename" } @@ -54,7 +62,7 @@ spec: # If single image is to be copied then, it can be passed through # params in the taskrun. if [ "$(params.srcImageURL)" != "" ] && [ "$(params.destImageURL)" != "" ] ; then - skopeo copy "$(params.srcImageURL)" "$(params.destImageURL)" + skopeo copy "$(params.srcImageURL)" "$(params.destImageURL)" --src-tls-verify=$(params.srcTLSverify) --dest-tls-verify=$(params.destTLSverify) else # If file is provided as a configmap in the workspace then multiple images can be copied. # diff --git a/task/skopeo-copy/0.1/tests/run.yaml b/task/skopeo-copy/0.1/tests/run.yaml index 867893741f..282179e818 100644 --- a/task/skopeo-copy/0.1/tests/run.yaml +++ b/task/skopeo-copy/0.1/tests/run.yaml @@ -7,7 +7,9 @@ spec: - name: srcImageURL value: docker://quay.io/temp/kubeconfigwriter:v1 - name: destImageURL - value: localhost:5000/kube:latest + value: docker://localhost:5000/kube:latest + - name: destTLSverify + value: "false" taskRef: name: skopeo-copy workspaces: diff --git a/task/upload-pypi/0.1/tests/pre-apply-task-hook.sh b/task/upload-pypi/0.1/tests/pre-apply-task-hook.sh deleted file mode 100755 index b92fbd410f..0000000000 --- a/task/upload-pypi/0.1/tests/pre-apply-task-hook.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -# Add an internal PyPI server as sidecar to the task so we can upload it directly -# from our tests without having to go to official PyPI server. -cat ${TMPF} | python -c 'import yaml,sys;data=yaml.load(sys.stdin.read());data["spec"]["sidecars"]=[{"image":"pypiserver/pypiserver:latest", "name":"server", "command":["pypi-server","-P",".","-a",".","/data/packages"], "volumeMounts":[{"name":"packages", "mountPath":"/data/packages"}]}];data["spec"]["volumes"]=[{"name":"packages", "emptyDir":{}}];print(yaml.dump(data, default_flow_style=False));' > ${TMPF} - -# Add git-clone -kubectl -n ${tns} apply -f ./git/git-clone.yaml diff --git a/task/upload-pypi/0.1/tests/run.yaml b/task/upload-pypi/0.1/tests/run.yaml deleted file mode 100644 index 6a9216ce99..0000000000 --- a/task/upload-pypi/0.1/tests/run.yaml +++ /dev/null @@ -1,65 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: pypi-secret -type: kubernetes.io/basic-auth -stringData: - username: foo - password: bar ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: shared-task-storage -spec: - resources: - requests: - storage: 500Mi - accessModes: - - ReadWriteOnce ---- -apiVersion: tekton.dev/v1beta1 -kind: Pipeline -metadata: - name: publish-package-pipeline -spec: - workspaces: - - name: shared-workspace - tasks: - - name: fetch-repository - taskRef: - name: git-clone - workspaces: - - name: output - workspace: shared-workspace - params: - - name: url - value: https://github.com/pypa/twine.git - - name: subdirectory - value: "" - - name: deleteExisting - value: "true" - - - name: upload-pypi-run - taskRef: - name: upload-pypi - workspaces: - - name: source - workspace: shared-workspace - params: - - name: TWINE_REPOSITORY_URL - value: "http://localhost:8080" - runAfter: - - fetch-repository ---- -apiVersion: tekton.dev/v1beta1 -kind: PipelineRun -metadata: - name: publish-package-pipeline-run -spec: - pipelineRef: - name: publish-package-pipeline - workspaces: - - name: shared-workspace - persistentVolumeClaim: - claimName: shared-task-storage diff --git a/test/e2e-common.sh b/test/e2e-common.sh index 0a239b13d0..84c3d07e87 100755 --- a/test/e2e-common.sh +++ b/test/e2e-common.sh @@ -28,7 +28,7 @@ source $(dirname $0)/../vendor/github.com/tektoncd/plumbing/scripts/e2e-tests.sh function add_sidecar_registry() { cp ${1} ${TMPF}.read - cat ${TMPF}.read | python -c 'import yaml,sys;data=yaml.load(sys.stdin.read());data["spec"]["sidecars"]=[{"image":"registry", "name": "registry"}];print(yaml.dump(data, default_flow_style=False));' > ${TMPF} + cat ${TMPF}.read | python -c 'import yaml,sys;data=yaml.load(sys.stdin.read(), Loader=yaml.FullLoader);data["spec"]["sidecars"]=[{"image":"registry", "name": "registry"}];print(yaml.dump(data, default_flow_style=False));' > ${TMPF} rm -f ${TMPF}.read } @@ -57,7 +57,7 @@ function test_yaml_can_install() { # Validate that all the Task CRDs in this repo are valid by creating them in a NS. readonly ns="task-ns" kubectl create ns "${ns}" || true - for runtest in $(find ${REPO_ROOT_DIR} -maxdepth 2 -name '*.yaml'); do + for runtest in $(find ${REPO_ROOT_DIR}/task -maxdepth 3 -name '*.yaml'); do skipit= for ignore in ${TEST_YAML_IGNORES};do [[ ${ignore} == $(basename $(echo ${runtest%.yaml})) ]] && skipit=True @@ -89,7 +89,10 @@ function show_failure() { } function test_task_creation() { for runtest in ${@};do - local testname=${runtest%%/*} + # remove task/ from beginning + local runtestdir=${runtest#*/} + # remove /0.1/tests from end + local testname=${runtestdir%%/*} local tns="${testname}-$$" local skipit= local maxloop=60 # 10 minutes max @@ -98,16 +101,18 @@ function test_task_creation() { [[ ${ignore} == ${testname} ]] && skipit=True done - ls ${testname}/*.yaml 2>/dev/null >/dev/null || skipit=True + # remove /tests from end + local taskdir=${runtest%/*} + ls ${taskdir}/*.yaml 2>/dev/null >/dev/null || skipit=True [[ -n ${skipit} ]] && continue kubectl create namespace ${tns} # Install the task itself first - for yaml in ${testname}/*.yaml;do + for yaml in ${taskdir}/*.yaml;do cp ${yaml} ${TMPF} - [[ -f ${testname}/tests/pre-apply-task-hook.sh ]] && source ${testname}/tests/pre-apply-task-hook.sh + [[ -f ${taskdir}/tests/pre-apply-task-hook.sh ]] && source ${taskdir}/tests/pre-apply-task-hook.sh function_exists pre-apply-task-hook && pre-apply-task-hook kubectl -n ${tns} create -f ${TMPF} done @@ -115,7 +120,7 @@ function test_task_creation() { # Install resource and run for yaml in ${runtest}/*.yaml;do cp ${yaml} ${TMPF} - [[ -f ${testname}/tests/pre-apply-taskrun-hook.sh ]] && source ${testname}/tests/pre-apply-taskrun-hook.sh + [[ -f ${taskdir}/tests/pre-apply-taskrun-hook.sh ]] && source ${taskdir}/tests/pre-apply-taskrun-hook.sh function_exists pre-apply-taskrun-hook && pre-apply-taskrun-hook kubectl -n ${tns} create -f ${TMPF} done diff --git a/test/e2e-tests.sh b/test/e2e-tests.sh index f2c1769b0e..d550e15096 100755 --- a/test/e2e-tests.sh +++ b/test/e2e-tests.sh @@ -46,12 +46,12 @@ TEST_YAML_IGNORES=${TEST_YAML_IGNORES:-""} # Allow ignoring some yaml tests, space separated, should be the basename of the # test for example "s2i" -TEST_TASKRUN_IGNORES=${TEST_TASKRUN_IGNORES:-""} +TEST_TASKRUN_IGNORES=${TEST_TASKRUN_IGNORES:-"cloudevent"} set -ex set -o pipefail test_yaml_can_install -test_task_creation */tests +test_task_creation task/*/*/tests success