File tree Expand file tree Collapse file tree 4 files changed +102
-1
lines changed Expand file tree Collapse file tree 4 files changed +102
-1
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,10 @@ 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]"
20+ pipelinesascode.tekton.dev/task-10 : " [git-cli]"
1821 pipelinesascode.tekton.dev/max-keep-runs : " 5"
1922spec :
2023 pipelineRef :
2629 value : " {{ revision }}"
2730 - name : target_branch
2831 value : " {{ target_branch }}"
32+ - name : results_url
33+ value : " https://github.com/openshift-pipelines/tektoncd-results"
2934 timeouts :
3035 pipeline : " 1h0m0s"
3136 workspaces :
4853 resources :
4954 requests :
5055 storage : 50Mi
56+ - name : tekton-results-source
57+ volumeClaimTemplate :
58+ spec :
59+ accessModes :
60+ - ReadWriteOnce
61+ resources :
62+ requests :
63+ 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,44 @@ 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 : clone-downstream-tekton-results
124+ taskRef :
125+ name : git-cli
126+ runAfter :
127+ - " tekton-results-fetch-sha"
128+ params :
129+ - name : GIT_SCRIPT
130+ value : |
131+ git fetch origin "$(params.results_url)"
132+ git checkout "$(tasks.tekton-results-fetch-sha.results.tekton-results-downstream-sha)"
133+ workspaces :
134+ - name : output
135+ workspace : tekton-results-source
136+ - name : tekton-results-upstream-e2e
137+ taskRef :
138+ name : tekton-results-upstream-e2e
139+ runAfter :
140+ - " clone-downstream-tekton-results"
141+ - " plnsvc-setup"
142+ params :
143+ - name : target_branch
144+ value : $(params.target_branch)
145+ workspaces :
146+ - name : source
147+ workspace : tekton-results-source
148+ - name : kubeconfig-dir
149+ workspace : kubeconfig-dir
110150 finally :
111151 - name : destroy-cluster
112152 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+ 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+ workspaces :
10+ - name : source
11+ - name : kubeconfig-dir
12+ steps :
13+ - name : execute-tekton-results-upstream-e2e
14+ image : quay.io/redhat-pipeline-service/ci-runner:$(params.target_branch)
15+ workingDir : $(workspaces.source.path)
16+ env :
17+ - name : KUBECONFIG
18+ value : " $(workspaces.kubeconfig-dir.path)/kubeconfig"
19+ script : |
20+ #! /usr/bin/env bash
21+ export SA_TOKEN_PATH=${SA_TOKEN_PATH:-"/tmp/tekton-results/tokens"}
22+ mkdir -p ${SA_TOKEN_PATH}
23+ service_accounts=(all-namespaces-read-access single-namespace-read-access)
24+ for service_account in "${service_accounts[@]}"; do
25+ kubectl create token "$service_account" > "${SA_TOKEN_PATH}"/"$service_account"
26+ done
27+ export CGO_ENABLED=0
28+ go test -v -count=1 --tags=e2e $(workspaces.source.path)/test/e2e/...
You can’t perform that action at this time.
0 commit comments