-
Go to OperatorHub and search for
OpenShift Pipelines
-
Install with the default settings
-
Create a user with Push/Pull access in Gogs
-
Workloads > Secrets > Create > Source Secrets
- Name = {Any name you like}
- Authentication Type = Basic Authentication
- Username = {Username of created User}
- Password = {Password of created User}
- Annotate the Secret.
- On the Secret in the console click Actions > Edit Annotations.
- set KEY to: tekton.dev/git-0
- set VALUE to: {Git Repo Host}
- Link the password to the Service Account `Running the pipeline
oc secrets link <Service Account Name> <Secret name>
oc apply -f {tekton-folder}/Pipeline -n {namespace to deploy pipeline}
oc apply -f {tekton-folder}/Tasks -n {namespace to deploy pipeline}
oc apply -f {tekton-folder}/Webhooks -n {namespace to deploy pipeline}
oc expose svc {name of EventListener Service}
-
Go to Networking > Routes
-
Copy The URL of the EventListener Route That triggers your required Pipeline
-
Go to Gogs
-
Go To the Repo you want to add a webhook to
-
Click Settings > Webhooks > Add Webhook
-
Paste EventListener Route in Payload URL
-
Click Add Webhook
We are using the Argo CD community Operator via OperatorHub
-
Go to OperatorHub and search for
Argo CD
-
Select the Operator called "Argo CD" (Not Argo CD Operator (Helm)).
-
Select which namespace to install Argo CD onto. e.g. argo
-
Click Subscribe
Ensure you are in the namespace where you have installed Argo CD
oc apply -f Argocd/ArgoCD.yaml
-
Go to Networking > Routes
-
Click on the url of the
argocd-server
Route -
Click the Login via OpenShift Button.
-
Click Manage your repositories, projects, settings
-
Click Repositories
-
Click Connect Repo using HTTPS
-
Provide, URL, Username and Passowrd
-
Click Connect
-
Click New App
-
Apply the following setting:
- Application Name = {The Name of Your App}
- Project = default
- Sync Policy = Automatic
- Repository URL = URL of the GitOps Repo
- Revision = HEAD
- Path = {Path to manifests folder e.g. manifests/app-name}
- Cluster URL = https://kubernetes.default.svc
- Namespace = {OpenShift project you want to deploy the application}
- Click Create
oc policy add-role-to-user edit system:serviceaccount:{Namespace where Argo CD is deployed}:argocd-application-controller -n {namespace where application is deployed}