-
Notifications
You must be signed in to change notification settings - Fork 9
68 lines (59 loc) · 2.55 KB
/
gitops.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: GitOps-Tasks
on:
workflow_run:
workflows:
- Deploy
types:
- completed
branches:
- main
workflow_dispatch:
jobs:
Setup:
name: GitOps Day2 Tasks
runs-on: ubuntu-latest
steps:
- name: Checkout r3dact3d/gitops external repo
uses: actions/checkout@v2
with:
repository: r3dact3d/gitops
path: gitops
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Create AWS S3 Bucket for AAP HA DB
run: |
aws s3 mb s3://${{secrets.OCP_CLUSTER_NAME}}-aap-ha-db-bucket --region ${{secrets.AWS_REGION}}
aws s3 ls | grep -i aap-ha-db-bucket
- name: Install OpenShift CLI tools
uses: redhat-actions/openshift-tools-installer@v1
with:
openshift-install: "${{secrets.OCP_CLIENT_VERSION}}"
oc: "${{secrets.OCP_CLIENT_VERSION}}"
- name: Download Artifacts from Cluster Deploy
uses: dawidd6/action-download-artifact@v2
with:
workflow: deploy.yaml
name: ocp-artifact
path: ocp-artifact
- name: Create GitOps
run: |
cp ocp-artifact/auth/kubeconfig $GITHUB_WORKSPACE/kubeconfig
export KUBECONFIG=$GITHUB_WORKSPACE/kubeconfig
oc apply -f https://raw.githubusercontent.com/r3dact3d/gitops/main/gitops-cluster/gitops-operator.yaml
oc create namespace aap
oc create secret generic s3-secret --namespace aap \
--from-literal=s3-access-key-id=${{secrets.AWS_ACCESS_KEY_ID}} \
--from-literal=s3-secret-access-key=${{secrets.AWS_SECRET_ACCESS_KEY}} \
--from-literal=s3-bucket-name=${{secrets.OCP_CLUSTER_NAME}}-aap-ha-db-bucket \
--from-literal=s3-region=${{secrets.AWS_REGION}}
oc apply -f s3-secret --namespace aap
sleep 300
oc project openshift-gitops
oc adm policy add-cluster-role-to-user cluster-admin -z openshift-gitops-argocd-application-controller
oc create -f https://raw.githubusercontent.com/r3dact3d/gitops/main/gitops-cluster/day2-app.yaml
oc create -f https://raw.githubusercontent.com/r3dact3d/gitops/main/gitops-cluster/appset-app.yaml
#oc create -f https://raw.githubusercontent.com/r3dact3d/gitops/main/gitops-cluster/cluster-onboarding-app.yaml