-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #211 from stakater/new-docs
Update docs
- Loading branch information
Showing
9 changed files
with
84 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,20 +38,20 @@ Let's walk you through creating a Tekton `PipelineRun` using a `Pipeline-as-Code | |
params: | ||
- name: repo_url | ||
value: "[email protected]:<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:// | ||
value: {{repo_name}} # Dynamic variable to fetch repo name | ||
- 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:// | ||
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 | ||
workspaces: # Mention what workspaces will be used by this pipeline to store data and used by data transferring between tasks | ||
- name: source | ||
|
@@ -72,7 +72,7 @@ Let's walk you through creating a Tekton `PipelineRun` using a `Pipeline-as-Code | |
- name: url | ||
value: $(params.repo_url) | ||
- name: revision | ||
value: $(params.gitrevision) | ||
value: $(params.git_revision) | ||
workspaces: # Mention Workspaces configuration | ||
- name: source | ||
volumeClaimTemplate: | ||
|
@@ -82,11 +82,14 @@ Let's walk you through creating a Tekton `PipelineRun` using a `Pipeline-as-Code | |
resources: | ||
requests: | ||
storage: 1Gi | ||
- name: ssh-directory # Using ssh-directory workspace for our task to have better security | ||
- name: ssh-dibrectory # Using ssh-directory workspace for our task to have better security | ||
secret: | ||
secretName: [app-name]-ssh-creds # Created this secret earlier | ||
``` | ||
1. Provide values for `image_registry`, and helm_registry parameters. You can find the urls from [here](../../../../managed-addons/nexus/explanation/routes.md). | ||
`image_registry` url should be succeeded by your application name. Example: nexus-docker-stakater-nexus.apps.lab.kubeapp.cloud/**review-api** | ||
|
||
1. Now create a pull request on the repository with these changes. This should trigger a pipeline on your cluster. | ||
|
||
1. You can go to your tenant's build namespace and see the pipeline running. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
|
||
### Create PipelineRun with Create Git Tag Task | ||
|
||
You have already created a PipelineRun in the previous tutorial. Let's now add another task `create-git-tag` to it. | ||
You have already created a PipelineRun in the previous tutorial. Let's now add another task ['create-git-tag`](https://github.com/stakater-tekton-catalog/create-git-tag) 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. | ||
|
@@ -33,22 +33,22 @@ You have already created a PipelineRun in the previous tutorial. Let's now add a | |
params: | ||
- name: repo_url | ||
value: "[email protected]:<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:// | ||
value: {{repo_name}} # Dynamic variable to fetch repo name | ||
- 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 | ||
|
@@ -70,7 +70,7 @@ 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 | ||
|
@@ -81,7 +81,7 @@ You have already created a PipelineRun in the previous tutorial. Let's now add a | |
- name: PR_NUMBER | ||
value: $(params.pull_request_number) | ||
- name: GIT_REVISION | ||
value: $(params.gitrevision) | ||
value: $(params.git_revision) | ||
workspaces: | ||
- name: source | ||
workspace: source | ||
|
@@ -101,7 +101,11 @@ You have already created a PipelineRun in the previous tutorial. Let's now add a | |
secretName: git-ssh-creds # Created this secret earlier | ||
``` | ||
1. Provide values for image_registry_url, and helm_registry parameters. You can find the urls from [here](../../../../managed-addons/nexus/explanation/routes.md) | ||
**Notice** that we added another value to the **`pipelinesascode.tekton.dev/task`** annotation. The annotation is used by pipeline as code resolver to fetch tasks defined remotely. To explore stakater's Tekton | ||
catalog, please visit [`stakater-tekton-catalog`](https://github.com/stakater-tekton-catalog). | ||
|
||
1. Provide values for `image_registry`, and `helm_registry` parameters. You can find the urls from [here](../../../../managed-addons/nexus/explanation/routes.md) | ||
`image_registry` url should be succeeded by your application name. Example: nexus-docker-stakater-nexus.apps.lab.kubeapp.cloud/**review-api** | ||
|
||
!!! note | ||
Remember to add the remote task in the annotations | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
## Objectives | ||
|
||
- Add `code-linting` task to PipelineRun. | ||
- Add `code-linting-mvn` task to PipelineRun. | ||
- Define parameters, workspaces, and tasks within the PipelineRun for building and deploying your application. | ||
|
||
## Key Results | ||
|
@@ -14,7 +14,7 @@ | |
|
||
### Create PipelineRun with Code Linting Task | ||
|
||
You have already created a PipelineRun in the previous tutorial. Let's now add another task `code-linting` to it. | ||
You have already created a PipelineRun in the previous tutorial. Let's now add another task [`code-linting`](https://github.com/stakater-tekton-catalog/code-linting-mvn/tree/0.0.4) 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. | ||
|
@@ -27,28 +27,31 @@ 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 pullrequest 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]" | ||
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]" | ||
pipelinesascode.tekton.dev/max-keep-runs: "2" # Only remain 2 latest pipelineRuns on SAAP | ||
spec: | ||
params: | ||
- name: repo_url | ||
value: "[email protected]:<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 | ||
|
@@ -70,12 +73,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 | ||
|
@@ -92,7 +95,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" | ||
|
@@ -119,7 +122,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 | ||
|
@@ -143,6 +146,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 | ||
 | ||
1. Create a pull request with you changes. This should trigger the pipeline in the build namespace. | ||
|
Oops, something went wrong.