File tree Expand file tree Collapse file tree 4 files changed +104
-1
lines changed Expand file tree Collapse file tree 4 files changed +104
-1
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,9 @@ metadata:
1414 pipelinesascode.tekton.dev/task-4 : " [.tekton/tasks/generate-cluster-name.yaml]"
1515 pipelinesascode.tekton.dev/task-5 : " [.tekton/tasks/pipeline-service-setup.yaml]"
1616 pipelinesascode.tekton.dev/task-6 : " [.tekton/tasks/pipeline-service-tests.yaml]"
17- pipelinesascode.tekton.dev/task-7 : " [git-clone]"
17+ pipelinesascode.tekton.dev/task-7 : " [.tekton/tasks/tekton-results-fetch-sha.yaml]"
18+ pipelinesascode.tekton.dev/task-8 : " [.tekton/tasks/tekton-results-upstream-e2e.yaml]"
19+ pipelinesascode.tekton.dev/task-9 : " [git-clone]"
1820 pipelinesascode.tekton.dev/max-keep-runs : " 5"
1921spec :
2022 pipelineRef :
2628 value : " {{ revision }}"
2729 - name : target_branch
2830 value : " {{ target_branch }}"
31+ - name : results_url
32+ value : " https://github.com/openshift-pipelines/tektoncd-results"
2933 timeouts :
3034 pipeline : " 1h0m0s"
3135 workspaces :
4852 resources :
4953 requests :
5054 storage : 50Mi
55+ - name : tekton-results-source
56+ volumeClaimTemplate :
57+ spec :
58+ accessModes :
59+ - ReadWriteOnce
60+ resources :
61+ requests :
62+ storage : 3Gi
Original file line number Diff line number Diff line change 88 - name : repo_url
99 - name : revision
1010 - name : target_branch
11+ - name : results_url
1112 timeouts :
1213 finally : " 0h20m0s"
1314 workspaces :
1415 - name : source
16+ - name : tekton-results-source
1517 - name : kubeconfig-dir
1618 - name : shared-workspace
1719 tasks :
@@ -107,6 +109,35 @@ spec:
107109 workspace : shared-workspace
108110 - name : source
109111 workspace : source
112+ - name : tekton-results-fetch-sha
113+ taskRef :
114+ name : tekton-results-fetch-sha
115+ runAfter :
116+ - " clone-pipeline-service-git"
117+ params :
118+ - name : target_branch
119+ value : $(params.target_branch)
120+ workspaces :
121+ - name : source
122+ workspace : source
123+ - name : tekton-results-upstream-e2e
124+ taskRef :
125+ name : tekton-results-upstream-e2e
126+ runAfter :
127+ - " tekton-results-fetch-sha"
128+ - " plnsvc-setup"
129+ params :
130+ - name : target_branch
131+ value : $(params.target_branch)
132+ - name : repo_url
133+ value : " $(params.results_url)"
134+ - name : revision
135+ value : " $(tasks.tekton-results-fetch-sha.results.tekton-results-downstream-sha)"
136+ workspaces :
137+ - name : source
138+ workspace : tekton-results-source
139+ - name : kubeconfig-dir
140+ workspace : shared-workspace
110141 finally :
111142 - name : destroy-cluster
112143 taskRef :
Original file line number Diff line number Diff line change 1+ ---
2+ apiVersion : tekton.dev/v1beta1
3+ kind : Task
4+ metadata :
5+ name : tekton-results-fetch-sha
6+ spec :
7+ workspaces :
8+ - name : source
9+ params :
10+ - name : target_branch
11+ results :
12+ - name : tekton-results-downstream-sha
13+ description : Tekton Results updated SHA in Pipeline Service
14+ steps :
15+ - name : fetch-results-sha
16+ workingDir : $(workspaces.source.path)
17+ image : quay.io/openshift-pipeline/ci:latest
18+ script : |
19+ #! /usr/bin/env bash
20+ echo -n "$(yq '.images[0].newTag' $(workspaces.source.path)/operator/gitops/argocd/pipeline-service/tekton-results/base/kustomization.yaml)" | tee $(results.tekton-results-downstream-sha.path)
Original file line number Diff line number Diff line change 1+ ---
2+ apiVersion : tekton.dev/v1beta1
3+ kind : Task
4+ metadata :
5+ name : tekton-results-upstream-e2e
6+ spec :
7+ params :
8+ - name : target_branch
9+ - name : repo_url
10+ - name : revision
11+ workspaces :
12+ - name : source
13+ - name : kubeconfig-dir
14+ steps :
15+ - name : execute-tekton-results-upstream-e2e
16+ image : quay.io/redhat-pipeline-service/ci-runner:$(params.target_branch)
17+ workingDir : $(workspaces.source.path)
18+ env :
19+ - name : KUBECONFIG
20+ value : " $(workspaces.kubeconfig-dir.path)/kubeconfig"
21+ script : |
22+ #! /usr/bin/env bash
23+ cd $(workspaces.source.path)
24+ git clone --no-checkout $(params.repo_url)
25+ cd tektoncd-results
26+ git config remote.origin.fetch '+refs/heads/downstream*:refs/remotes/origin/downstream*'
27+ git fetch origin $(params.revision)
28+ git checkout $(params.revision)
29+ export SA_TOKEN_PATH=${SA_TOKEN_PATH:-"/tmp/tekton-results/tokens"}
30+ export SSL_CERT_PATH=${SSL_CERT_PATH:="/tmp/tekton-results/ssl"}
31+ mkdir -p ${SA_TOKEN_PATH} ${SSL_CERT_PATH}
32+ kubectl get secrets tekton-results-tls -n tekton-results --template='{{index .data "tls.crt"}}' | base64 -d > ${SSL_CERT_PATH}/tekton-results-cert.pem
33+ kubectl get secrets tekton-results-tls -n tekton-results --template='{{index .data "tls.key"}}' | base64 -d > ${SSL_CERT_PATH}/tekton-results-key.pem
34+ kubectl apply -f ./test/e2e/kustomize/rbac.yaml
35+ service_accounts=(all-namespaces-read-access single-namespace-read-access)
36+ for service_account in "${service_accounts[@]}"; do
37+ kubectl create token "$service_account" > "${SA_TOKEN_PATH}"/"$service_account"
38+ done
39+ export CGO_ENABLED=0
40+ go test -v -count=1 --tags=e2e ./test/e2e/...
You can’t perform that action at this time.
0 commit comments