Skip to content

Commit ac84801

Browse files
xinredhatRoming22
authored andcommitted
switch to using rosa hcp to provision cluster
1 parent 8a91aef commit ac84801

31 files changed

+412
-415
lines changed

.tekton/pipeline-service-test.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ spec:
2020
pipelineRef:
2121
name: acceptance-tests
2222
params:
23+
- name: aws_region
24+
value: "us-east-1"
25+
- name: ocp_version
26+
value: "4.12.16"
2327
- name: repo_url
2428
value: "{{ repo_url }}"
2529
- name: revision
@@ -29,9 +33,6 @@ spec:
2933
timeouts:
3034
pipeline: "1h0m0s"
3135
workspaces:
32-
- name: kubeconfig-dir
33-
configMap:
34-
name: newkubeconfig
3536
- name: source
3637
volumeClaimTemplate:
3738
spec:

.tekton/pipeline-service-upgrade-test.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ metadata:
66
annotations:
77
pipelinesascode.tekton.dev/on-event: "[pull_request, push]"
88
pipelinesascode.tekton.dev/on-target-branch: "[refs/heads/*]"
9-
pipelinesascode.tekton.dev/pipeline: "[.tekton/pipeline/acceptance-tests.yaml]"
9+
pipelinesascode.tekton.dev/pipeline: "[.tekton/pipeline/upgrade-tests.yaml]"
1010
pipelinesascode.tekton.dev/task: "[.tekton/tasks/ci-runner-container-setup.yaml]"
1111
pipelinesascode.tekton.dev/task-1: "[.tekton/tasks/deploy-cluster.yaml]"
1212
pipelinesascode.tekton.dev/task-2: "[.tekton/tasks/destroy-cluster.yaml]"
@@ -21,6 +21,10 @@ spec:
2121
pipelineRef:
2222
name: upgrade-tests
2323
params:
24+
- name: ocp_version
25+
value: "4.12.16"
26+
- name: aws_region
27+
value: "us-east-1"
2428
- name: repo_url
2529
value: "{{ repo_url }}"
2630
- name: revision
@@ -30,9 +34,6 @@ spec:
3034
timeouts:
3135
pipeline: "1h0m0s"
3236
workspaces:
33-
- name: kubeconfig-dir
34-
configMap:
35-
name: newkubeconfig
3637
- name: source
3738
volumeClaimTemplate:
3839
spec:

.tekton/pipeline/acceptance-tests.yaml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ metadata:
55
name: acceptance-tests
66
spec:
77
params:
8+
- name: aws_region
89
- name: repo_url
910
- name: revision
1011
- name: target_branch
12+
- name: ocp_version
1113
timeouts:
1214
finally: "0h20m0s"
1315
workspaces:
1416
- name: source
15-
- name: kubeconfig-dir
1617
- name: shared-workspace
1718
tasks:
1819
- name: generate-cluster-name
@@ -24,11 +25,11 @@ spec:
2425
runAfter:
2526
- "clone-pipeline-service-git"
2627
params:
28+
- name: region
29+
value: $(params.aws_region)
2730
- name: target_branch
2831
value: $(params.target_branch)
2932
workspaces:
30-
- name: kubeconfig-dir
31-
workspace: kubeconfig-dir
3233
- name: source
3334
workspace: source
3435
- name: deploy-cluster
@@ -38,17 +39,15 @@ spec:
3839
- "generate-cluster-name"
3940
- "clone-pipeline-service-git"
4041
params:
41-
- name: image
42-
value: "quay.io/openshift-release-dev/ocp-release:4.12.2-x86_64"
43-
- name: region
44-
value: "us-east-1"
4542
- name: cluster-name
4643
value: "$(tasks.generate-cluster-name.results.cluster-name)"
44+
- name: ocp_version
45+
value: $(params.ocp_version)
46+
- name: region
47+
value: $(params.aws_region)
4748
- name: target_branch
4849
value: $(params.target_branch)
4950
workspaces:
50-
- name: kubeconfig-dir
51-
workspace: kubeconfig-dir
5251
- name: output
5352
workspace: shared-workspace
5453
- name: source
@@ -73,10 +72,10 @@ spec:
7372
- name: target_branch
7473
value: $(params.target_branch)
7574
workspaces:
76-
- name: source
77-
workspace: source
7875
- name: kubeconfig-dir
7976
workspace: shared-workspace
77+
- name: source
78+
workspace: source
8079
- name: plnsvc-setup
8180
taskRef:
8281
name: pipeline-service-setup
@@ -118,10 +117,10 @@ spec:
118117
params:
119118
- name: cluster-name
120119
value: "$(tasks.generate-cluster-name.results.cluster-name)"
120+
- name: region
121+
value: $(params.aws_region)
121122
- name: target_branch
122123
value: $(params.target_branch)
123124
workspaces:
124-
- name: kubeconfig-dir
125-
workspace: kubeconfig-dir
126125
- name: source
127126
workspace: source

.tekton/pipeline/stonesoup-integeration-tests.yaml

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@ spec:
77
timeouts:
88
finally: "0h20m0s"
99
params:
10+
- name: aws_region
11+
- name: ocp_version
1012
- name: repo_url
1113
- name: revision
1214
- name: repo_owner
1315
- name: target_branch
1416
workspaces:
1517
- name: source
16-
- name: kubeconfig-dir
1718
- name: shared-workspace
1819
tasks:
1920
- name: fetch-repository
2021
taskRef:
2122
name: git-clone
22-
kind: ClusterTask
2323
workspaces:
2424
- name: output
2525
workspace: source
@@ -28,26 +28,24 @@ spec:
2828
value: $(params.repo_url)
2929
- name: revision
3030
value: $(params.revision)
31-
- name: produce-cluster-name
31+
- name: generate-cluster-name
3232
runAfter:
3333
- "fetch-repository"
3434
taskRef:
3535
name: generate-cluster-name
3636
- name: deploy-cluster
3737
runAfter:
38-
- "produce-cluster-name"
38+
- "generate-cluster-name"
3939
params:
40-
- name: image
41-
value: "quay.io/openshift-release-dev/ocp-release:4.12.2-x86_64"
42-
- name: region
43-
value: "us-east-1"
4440
- name: cluster-name
45-
value: "$(tasks.produce-cluster-name.results.cluster-name)"
41+
value: "$(tasks.generate-cluster-name.results.cluster-name)"
42+
- name: ocp_version
43+
value: $(params.ocp_version)
44+
- name: region
45+
value: $(params.aws_region)
4646
- name: target_branch
4747
value: $(params.target_branch)
4848
workspaces:
49-
- name: kubeconfig-dir
50-
workspace: kubeconfig-dir
5149
- name: output
5250
workspace: shared-workspace
5351
- name: source
@@ -75,19 +73,19 @@ spec:
7573
name: stonesoup-tests
7674
finally:
7775
- name: destroy-cluster
76+
taskRef:
77+
name: destroy-cluster
7878
when:
7979
- input: "$(tasks.deploy-cluster.status)"
8080
operator: notin
8181
values: ["None"]
8282
params:
8383
- name: cluster-name
84-
value: "$(tasks.produce-cluster-name.results.cluster-name)"
84+
value: "$(tasks.generate-cluster-name.results.cluster-name)"
8585
- name: target_branch
8686
value: $(params.target_branch)
87+
- name: region
88+
value: $(params.aws_region)
8789
workspaces:
88-
- name: kubeconfig-dir
89-
workspace: kubeconfig-dir
9090
- name: source
9191
workspace: source
92-
taskRef:
93-
name: destroy-cluster

.tekton/pipeline/upgrade-tests.yaml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ metadata:
55
name: upgrade-tests
66
spec:
77
params:
8+
- name: aws_region
9+
- name: ocp_version
810
- name: repo_url
911
- name: revision
1012
- name: target_branch
1113
timeouts:
1214
finally: "0h20m0s"
1315
workspaces:
1416
- name: source
15-
- name: kubeconfig-dir
1617
- name: upgrade-shared-workspace
1718
tasks:
1819
- name: clone-pipeline-service-git
@@ -36,17 +37,15 @@ spec:
3637
- "generate-cluster-name"
3738
- "clone-pipeline-service-git"
3839
params:
39-
- name: image
40-
value: "quay.io/openshift-release-dev/ocp-release:4.12.2-x86_64"
40+
- name: ocp_version
41+
value: $(params.ocp_version)
4142
- name: region
42-
value: "us-east-1"
43+
value: $(params.aws_region)
4344
- name: cluster-name
4445
value: "$(tasks.generate-cluster-name.results.cluster-name)"
4546
- name: target_branch
4647
value: $(params.target_branch)
4748
workspaces:
48-
- name: kubeconfig-dir
49-
workspace: kubeconfig-dir
5049
- name: output
5150
workspace: upgrade-shared-workspace
5251
- name: source
@@ -193,8 +192,8 @@ spec:
193192
value: "$(tasks.generate-cluster-name.results.cluster-name)"
194193
- name: target_branch
195194
value: $(params.target_branch)
195+
- name: region
196+
value: $(params.aws_region)
196197
workspaces:
197-
- name: kubeconfig-dir
198-
workspace: kubeconfig-dir
199198
- name: source
200199
workspace: source

.tekton/stonesoup-e2e-test.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ spec:
1717
pipelineRef:
1818
name: stonesoup-integeration-tests
1919
params:
20+
- name: aws_region
21+
value: "us-east-1"
22+
- name: ocp_version
23+
value: "4.12.16"
2024
- name: repo_url
2125
value: "{{ repo_url }}"
2226
- name: revision
@@ -28,9 +32,6 @@ spec:
2832
timeouts:
2933
pipeline: "1h30m0s"
3034
workspaces:
31-
- name: kubeconfig-dir
32-
configMap:
33-
name: newkubeconfig
3435
- name: source
3536
volumeClaimTemplate:
3637
spec:

.tekton/tasks/ci-runner-container-setup.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ spec:
88
- name: target_branch
99
workspaces:
1010
- name: kubeconfig-dir
11-
- name: source
1211
description: The kubeconfig of new cluster will be stored onto the volume backing this Workspace
12+
- name: source
1313
steps:
1414
- name: create-ci-runner-container
1515
image: quay.io/redhat-pipeline-service/ci-runner:$(params.target_branch)

.tekton/tasks/deploy-cluster.yaml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,28 @@ metadata:
55
name: deploy-cluster
66
spec:
77
params:
8-
- name: image
9-
description: choose the ocp image as per your ocp cluster version requirement
8+
- name: ocp_version
9+
description: ocp cluster version that you want to provision
1010
- name: region
11-
description: aws region for cluster deployment
11+
description: ocp cluster region where you want to provision
1212
- name: cluster-name
1313
- name: target_branch
1414
workspaces:
15-
- name: kubeconfig-dir
1615
- name: source
17-
description: The kubeconfig of new cluster will be stored onto the volume backing this Workspace
1816
- name: output
1917
steps:
2018
- name: install-cluster
2119
image: quay.io/redhat-pipeline-service/ci-runner:$(params.target_branch)
2220
imagePullPolicy: Always
2321
env:
24-
- name: KUBECONFIG
25-
value: "$(workspaces.kubeconfig-dir.path)/kubeconfig"
2622
- name: CLUSTER_NAME
2723
value: "$(params.cluster-name)"
28-
- name: WORKSPACE
24+
- name: KUBECONFIG_DIR
2925
value: "$(workspaces.output.path)"
3026
- name: REGION
3127
value: "$(params.region)"
32-
- name: IMAGE
33-
value: "$(params.image)"
28+
- name: OCP_VERSION
29+
value: "$(params.ocp_version)"
3430
- name: BW_CLIENTID
3531
valueFrom:
3632
secretKeyRef:

.tekton/tasks/destroy-cluster.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,15 @@ metadata:
66
spec:
77
params:
88
- name: cluster-name
9+
- name: region
10+
description: ocp cluster region where you want to provision
911
- name: target_branch
1012
workspaces:
11-
- name: kubeconfig-dir
1213
- name: source
1314
steps:
1415
- name: destroy
1516
image: quay.io/redhat-pipeline-service/ci-runner:$(params.target_branch)
1617
env:
17-
- name: "KUBECONFIG"
18-
value: "$(workspaces.kubeconfig-dir.path)/kubeconfig"
1918
- name: CLUSTER_NAME
2019
value: "$(params.cluster-name)"
2120
- name: BW_CLIENTID
@@ -33,6 +32,8 @@ spec:
3332
secretKeyRef:
3433
name: hypershift-bitwarden
3534
key: "BW_PASSWORD"
35+
- name: REGION
36+
value: "$(params.region)"
3637
workingDir: "$(workspaces.source.path)"
3738
command:
3839
- $(workspaces.source.path)/ci/images/ci-runner/hack/bin/destroy-cluster.sh

.tekton/tasks/destroy-existing-cluster.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@ metadata:
66
spec:
77
params:
88
- name: target_branch
9+
- name: region
10+
description: ocp cluster region where you want to provision
911
workspaces:
10-
- name: kubeconfig-dir
1112
- name: source
1213
steps:
1314
- name: destroy
1415
image: quay.io/redhat-pipeline-service/ci-runner:$(params.target_branch)
1516
env:
16-
- name: "KUBECONFIG"
17-
value: "$(workspaces.kubeconfig-dir.path)/kubeconfig"
1817
- name: BW_CLIENTID
1918
valueFrom:
2019
secretKeyRef:
@@ -30,5 +29,7 @@ spec:
3029
secretKeyRef:
3130
name: hypershift-bitwarden
3231
key: "BW_PASSWORD"
32+
- name: REGION
33+
value: "$(params.region)"
3334
command:
34-
- $(workspaces.source.path)/ci/images/ci-runner/hack/bin/destroy-clusters.sh
35+
- $(workspaces.source.path)/ci/images/ci-runner/hack/bin/cleanup-expired-clusters.sh

0 commit comments

Comments
 (0)