Skip to content

Commit

Permalink
Merge pull request #213 from stakater/more-updates
Browse files Browse the repository at this point in the history
update pipeline docs
  • Loading branch information
rasheedamir authored Feb 2, 2024
2 parents 9a0bee2 + 5251eb7 commit 09389b2
Show file tree
Hide file tree
Showing 11 changed files with 97 additions and 78 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ The create environment task utilizes [Tronador](https://docs.stakater.com/tronad
secretName: git-pat-creds
```
**Notice** that we added another **workspace repo-token** to the pipeline run. This workspace utilizes the git-pat-creds secret that we previously created and mounts it to the create-environment task.
**Notice** that we added another **workspace, repo-token** to the pipeline run. This workspace utilizes the git-pat-creds secret that we previously created and mounts it to the create-environment task.
!!! note
Remember to add the remote task in the annotations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ You have already created a PipelineRun in the previous tutorial. Let's now add a
!!! note
Remember to add the remote task in the annotations
![Kube-linting](images/kube-linting-annotation.png)
1. Create a pull request with you changes. This should trigger the pipeline in the build namespace.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

### Create PipelineRun with Unit Test Task

You have already created a PipelineRun in the previous tutorial. Let's now add another task `unit-test` to it.
You have already created a PipelineRun in the previous tutorial. Let's now add another task [`unit-test`](https://github.com/stakater-tekton-catalog/unit-test) to it.

1. Open up the PipelineRun file you created in the previous tutorial.
1. Now edit the file so the YAML becomes like the one given below.
Expand All @@ -27,30 +27,33 @@ You have already created a PipelineRun in the previous tutorial. Let's now add a
annotations:
pipelinesascode.tekton.dev/on-event: "[pull_request]" # Trigger the pipelineRun on push events on branch main
pipelinesascode.tekton.dev/on-target-branch: "main"
pipelinesascode.tekton.dev/task: "[git-clone, https://raw.githubusercontent.com/stakater/tekton-catalog/main/stakater-create-git-tag/rendered/stakater-create-git-tag-0.0.7.yaml, https://raw.githubusercontent.com/stakater/tekton-catalog/main/stakater-create-environment/rendered/stakater-create-environment-0.0.16.yaml,https://raw.githubusercontent.com/stakater/tekton-catalog/main/stakater-code-linting/rendered/stakater-code-linting-0.0.3.yaml,
https://raw.githubusercontent.com/stakater/tekton-catalog/main/stakater-kube-linting/rendered/stakater-kube-linting-0.0.6.yaml,
https://raw.githubusercontent.com/stakater/tekton-catalog/main/stakater-unit-test/rendered/stakater-unit-test-0.0.5.yaml]"
pipelinesascode.tekton.dev/task: "[git-clone,
https://raw.githubusercontent.com/stakater-tekton-catalog/create-git-tag/0.0.12/task/stakater-create-git-tag/stakater-create-git-tag.yaml,
https://raw.githubusercontent.com/stakater-tekton-catalog/create-environment/0.0.16/task/stakater-create-environment/stakater-create-environment.yaml,
https://raw.githubusercontent.com/stakater-tekton-catalog/code-linting-mvn/0.0.4/task/stakater-code-linting/stakater-code-linting.yaml,
https://raw.githubusercontent.com/stakater-tekton-catalog/kube-linting/0.0.7/task/stakater-kube-linting/stakater-kube-linting.yaml,
https://raw.githubusercontent.com/stakater-tekton-catalog/unit-test/0.0.6/task/stakater-unit-test/stakater-unit-test.yaml]"
pipelinesascode.tekton.dev/max-keep-runs: "2" # Only remain 2 latest pipelineRuns on SAAP
spec:
params:
- name: repo_url
value: "git@github.com:<YOUR-ORG>/<YOUR-REPO-NAME>/" # Place your repo SSH URL
- name: gitrevision
- name: git_revision
value: {{revision}} # Dynamic variable to fetch branch name of the push event on your repo
- name: repo_path
value: {{repo_name}} # Dynamic varaible to fetch repo name
- name: image_registry_url
value: "<docker-registry-url>" # Place image registry URL without https://
- name: image_registry
value: "<docker-registry-url>" # Place image registry URL without https:// succeeded by your application name
- name: helm_registry
value: "<https://helm-registry-url>" # Place helm registry URL with https://
- name: pull_request_number
value: {{pull_request_number}}
pipelineSpec: # Define what parameters will be used for pipeline
params:
- name: repo_url
- name: gitrevision
- name: git_revision
- name: repo_path
- name: image_registry_url
- name: image_registry
- name: helm_registry
- name: pull_request_number
workspaces: # Mention what workspaces will be used by this pipeline to store data and used by data transferring between tasks
Expand All @@ -72,12 +75,12 @@ You have already created a PipelineRun in the previous tutorial. Let's now add a
- name: url
value: $(params.repo_url)
- name: revision
value: $(params.gitrevision)
value: $(params.git_revision)
- name: create-git-tag
runAfter:
- fetch-repository
taskRef:
name: stakater-create-git-tag-0.0.7
name: stakater-create-git-tag
kind: Task
params:
- name: PR_NUMBER
Expand All @@ -94,7 +97,7 @@ You have already created a PipelineRun in the previous tutorial. Let's now add a
- create-git-tag
taskRef:
kind: Task
name: stakater-create-environment-0.0.15
name: stakater-create-environment
params:
- name: CREATE_ON_CLUSTER
value: "true"
Expand All @@ -121,7 +124,7 @@ You have already created a PipelineRun in the previous tutorial. Let's now add a
runAfter:
- stakater-create-environment
taskRef:
name: stakater-code-linting-0.0.3
name: stakater-code-linting
kind: Task
workspaces:
- name: source
Expand All @@ -130,7 +133,7 @@ You have already created a PipelineRun in the previous tutorial. Let's now add a
runAfter:
- stakater-create-environment
taskRef:
name: stakater-kube-linting-0.0.6
name: stakater-kube-linting
kind: Task
params:
- name: FILE
Expand All @@ -147,7 +150,7 @@ You have already created a PipelineRun in the previous tutorial. Let's now add a
- code-linting
- kube-linting
taskRef:
name: stakater-unit-test-0.0.5
name: stakater-unit-test
kind: Task
workspaces:
- name: source
Expand All @@ -171,6 +174,7 @@ You have already created a PipelineRun in the previous tutorial. Let's now add a
!!! note
Remember to add the remote task in the annotations
![unit-test](images/unit-test-annotation.png)
1. Create a pull request with you changes. This should trigger the pipeline in the build namespace.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

### Create PipelineRun with Sonar Scan Task

You have already created a PipelineRun in the previous tutorial. Let's now add another task `sonar-scan` to it.
You have already created a PipelineRun in the previous tutorial. Let's now add another task [`sonar-scan`](https://github.com/stakater-tekton-catalog/sonarqube-scan) to it.

1. Open up the PipelineRun file you created in the previous tutorial.
1. Now edit the file so the YAML becomes like the one given below.
Expand All @@ -27,31 +27,34 @@ You have already created a PipelineRun in the previous tutorial. Let's now add a
annotations:
pipelinesascode.tekton.dev/on-event: "[pull_request]" # Trigger the pipelineRun on push events on branch main
pipelinesascode.tekton.dev/on-target-branch: "main"
pipelinesascode.tekton.dev/task: "[git-clone, https://raw.githubusercontent.com/stakater/tekton-catalog/main/stakater-create-git-tag/rendered/stakater-create-git-tag-0.0.7.yaml, https://raw.githubusercontent.com/stakater/tekton-catalog/main/stakater-create-environment/rendered/stakater-create-environment-0.0.16.yaml,https://raw.githubusercontent.com/stakater/tekton-catalog/main/stakater-code-linting/rendered/stakater-code-linting-0.0.3.yaml,
https://raw.githubusercontent.com/stakater/tekton-catalog/main/stakater-kube-linting/rendered/stakater-kube-linting-0.0.6.yaml,
https://raw.githubusercontent.com/stakater/tekton-catalog/main/stakater-unit-test/rendered/stakater-unit-test-0.0.5.yaml,
https://raw.githubusercontent.com/stakater/tekton-catalog/main/stakater-sonarqube-scan/rendered/stakater-sonarqube-scan-0.0.5.yaml]"
pipelinesascode.tekton.dev/task: "[git-clone,
https://raw.githubusercontent.com/stakater-tekton-catalog/create-git-tag/0.0.12/task/stakater-create-git-tag/stakater-create-git-tag.yaml,
https://raw.githubusercontent.com/stakater-tekton-catalog/create-environment/0.0.16/task/stakater-create-environment/stakater-create-environment.yaml,
https://raw.githubusercontent.com/stakater-tekton-catalog/code-linting-mvn/0.0.4/task/stakater-code-linting/stakater-code-linting.yaml,
https://raw.githubusercontent.com/stakater-tekton-catalog/kube-linting/0.0.7/task/stakater-kube-linting/stakater-kube-linting.yaml,
https://raw.githubusercontent.com/stakater-tekton-catalog/unit-test/0.0.6/task/stakater-unit-test/stakater-unit-test.yaml,
https://raw.githubusercontent.com/stakater-tekton-catalog/sonarqube-scan/0.0.13/task/stakater-sonarqube-scan/stakater-sonarqube-scan.yaml]"
pipelinesascode.tekton.dev/max-keep-runs: "2" # Only remain 2 latest pipelineRuns on SAAP
spec:
params:
- name: repo_url
value: "git@github.com:<YOUR-ORG>/<YOUR-REPO-NAME>/" # Place your repo SSH URL
- name: gitrevision
- name: git_revision
value: {{revision}} # Dynamic variable to fetch branch name of the push event on your repo
- name: repo_path
value: {{repo_name}} # Dynamic varaible to fetch repo name
- name: image_registry_url
value: "<docker-registry-url>" # Place image registry URL without https://
- name: image_registry
value: "<docker-registry-url>" # Place image registry URL without https:// succeeded by your application name
- name: helm_registry
value: "<https://helm-registry-url>" # Place helm registry URL with https://
- name: pull_request_number
value: {{pull_request_number}}
pipelineSpec: # Define what parameters will be used for pipeline
params:
- name: repo_url
- name: gitrevision
- name: git_revision
- name: repo_path
- name: image_registry_url
- name: image_registry
- name: helm_registry
- name: pull_request_number
workspaces: # Mention what workspaces will be used by this pipeline to store data and used by data transferring between tasks
Expand All @@ -73,12 +76,12 @@ You have already created a PipelineRun in the previous tutorial. Let's now add a
- name: url
value: $(params.repo_url)
- name: revision
value: $(params.gitrevision)
value: $(params.git_revision)
- name: create-git-tag
runAfter:
- fetch-repository
taskRef:
name: stakater-create-git-tag-0.0.7
name: stakater-create-git-tag
kind: Task
params:
- name: PR_NUMBER
Expand All @@ -95,7 +98,7 @@ You have already created a PipelineRun in the previous tutorial. Let's now add a
- create-git-tag
taskRef:
kind: Task
name: stakater-create-environment-0.0.15
name: stakater-create-environment
params:
- name: CREATE_ON_CLUSTER
value: "true"
Expand All @@ -122,7 +125,7 @@ You have already created a PipelineRun in the previous tutorial. Let's now add a
runAfter:
- stakater-create-environment
taskRef:
name: stakater-code-linting-0.0.3
name: stakater-code-linting
kind: Task
workspaces:
- name: source
Expand All @@ -131,7 +134,7 @@ You have already created a PipelineRun in the previous tutorial. Let's now add a
runAfter:
- stakater-create-environment
taskRef:
name: stakater-kube-linting-0.0.6
name: stakater-kube-linting
kind: Task
params:
- name: FILE
Expand All @@ -148,7 +151,7 @@ You have already created a PipelineRun in the previous tutorial. Let's now add a
- code-linting
- kube-linting
taskRef:
name: stakater-unit-test-0.0.5
name: stakater-unit-test
kind: Task
workspaces:
- name: source
Expand All @@ -157,11 +160,11 @@ You have already created a PipelineRun in the previous tutorial. Let's now add a
runAfter:
- unit-test
taskRef:
name: stakater-sonarqube-scan-0.0.5
name: stakater-sonarqube-scan
kind: Task
params:
- name: SONAR_HOST_URL
value: https://sonarqube-stakater-sonarqube.apps.tno2-ams.s9nghh76.lab.kubeapp.cloud
value: <YOUR SONARQUBE URL>
- name: SONAR_PROJECT_KEY
value: $(params.repo_path)
- name: SONAR_LOGIN
Expand All @@ -185,8 +188,11 @@ You have already created a PipelineRun in the previous tutorial. Let's now add a
secretName: git-pat-creds
```
**Notice** we have provided a parameter **SONAR_HOST_URL** to the sonar-scan task. You need to provide your SonarQube url here. You can get it from Forecastle.
!!! note
Remember to add the remote task in the annotations
![sonar-scan](images/sonar-scan-annotation.png)
1. Create a pull request with you changes. This should trigger the pipeline in the build namespace.
Expand Down
Loading

0 comments on commit 09389b2

Please sign in to comment.