File tree Expand file tree Collapse file tree
config/profile/rhdh/plugin-infra/gitops Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ #
3+ # GitOps/Pipeline Infrastructure Setup Script
4+ #
5+
6+ set -e
7+
8+ action=" ${1:- apply} " # Default action is 'apply'
9+
10+
11+ gitops_pipelines () {
12+ kubectl " $action " -f - << EOF
13+ apiVersion: v1
14+ kind: Namespace
15+ metadata:
16+ name: orchestrator-gitops
17+ ---
18+ apiVersion: operators.coreos.com/v1
19+ kind: OperatorGroup
20+ metadata:
21+ name: orchestrator-gitops-group
22+ namespace: orchestrator-gitops
23+ spec:
24+ ---
25+ apiVersion: operators.coreos.com/v1alpha1
26+ kind: Subscription
27+ metadata:
28+ name: orchestrator-gitops-operator
29+ namespace: orchestrator-gitops
30+ spec:
31+ channel: latest
32+ installPlanApproval: Automatic
33+ name: openshift-gitops-operator
34+ source: redhat-operators
35+ sourceNamespace: openshift-marketplace
36+ ---
37+ apiVersion: operators.coreos.com/v1alpha1
38+ kind: Subscription
39+ metadata:
40+ name: openshift-pipelines-operator-rh
41+ namespace: orchestrator-gitops
42+ spec:
43+ channel: pipelines-1.17
44+ installPlanApproval: Automatic
45+ name: openshift-pipelines-operator-rh
46+ source: redhat-operators
47+ sourceNamespace: openshift-marketplace
48+ EOF
49+ }
50+
51+ # execution
52+
53+ if [ " $action " == " apply" ]; then
54+ gitops_pipelines
55+ elif [ " $action " == " delete" ]; then
56+ gitops_pipelines
57+ else
58+ echo " Action '$action ' is not supported. Use 'apply' (default) or 'delete'."
59+ exit 1
60+ fi
Original file line number Diff line number Diff line change 11#! /bin/bash
22#
3- # GitOps Infrastructure Setup Script for Orchestrator with RHDH
3+ # GitOps/Pipeline Resources Setup Script for Orchestrator with RHDH
44#
55
66set -e
77
88action=" ${1:- apply} " # Default action is 'apply'
99
10+ orchestrator_gitops_namespace () {
11+ kubectl " $action " -f - << EOF
12+ apiVersion: v1
13+ kind: Namespace
14+ metadata:
15+ name: orchestrator-gitops
16+ EOF
17+ }
18+
1019argoCD () {
1120 kubectl " $action " -f - << 'EOF '
1221apiVersion: argoproj.io/v1alpha1
@@ -447,10 +456,12 @@ EOF
447456# execution
448457
449458if [ " $action " == " apply" ]; then
459+ orchestrator_gitops_namespace
450460 argoCD
451461 tekton_tasks
452462 tekton_pipeline
453463elif [ " $action " == " delete" ]; then
464+ orchestrator_gitops_namespace
454465 argoCD
455466 tekton_tasks
456467 tekton_pipeline
You can’t perform that action at this time.
0 commit comments