Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Multiple pipeline templates in code completion #611

Merged
merged 4 commits into from
Aug 2, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion build/build-snippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,35 @@ const snippets: { [key: string]: Snippet } = {
body: load('taskrun.yaml'),
},
'Pipeline': {
prefix: 'Pipeline',
prefix: 'Pipeline-test',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why you rename this?

description: 'Create a Tekton Pipeline Resource',
body: load('pipeline.yaml'),
},
'Pipeline-finally': {
prefix: 'Pipeline-with-finally',
description: 'Create a Tekton Pipeline Resource with finally in spec',
body: load('pipeline-finally.yaml'),
},
'Pipeline-with-buildah-task': {
prefix: 'Pipeline-with-buildah-task',
description: 'Create a Tekton Pipeline Resource with buildah task in spec',
body: load('pipeline-with-buildah-task.yaml'),
},
'Pipeline-with-kubectl-task': {
prefix: 'Pipeline-with-kubectl-task',
description: 'Create a Tekton Pipeline Resource with kubectl task in spec',
body: load('pipeline-with-kubectl-task.yaml'),
},
'Pipeline-with-maven-task': {
prefix: 'Pipeline-with-maven-task',
description: 'Create a Tekton Pipeline Resource with maven task in spec',
body: load('pipeline-with-maven-task.yaml'),
},
'Pipeline-condition': {
prefix: 'Pipeline-with-condition',
description: 'Create a Tekton Pipeline Resource with condition in spec',
body: load('pipeline-condition.yaml'),
},
'PipelineRun': {
prefix: 'PipelineRun',
description: 'Create a Tekton PipelineRun Resource',
Expand Down
11 changes: 11 additions & 0 deletions rawsnippets/pipeline-condition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: ${1:app-deploy}
spec:
tasks:
- name: ${2:taskName}
taskRef:
name: ${3:taskRefName}
conditions:
- conditionRef: ${4:conditionRefName}
9 changes: 9 additions & 0 deletions rawsnippets/pipeline-finally.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: ${1:app-deploy}
spec:
finally:
- name: ${2:finallyName}
taskRef:
name: ${3:taskName}
9 changes: 9 additions & 0 deletions rawsnippets/pipeline-with-buildah-task.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: tekton.dev/v1beta1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better if you combine pipeline-with-buildah-task.yaml, pipeline-with-kubectl-task.yaml and pipeline-with-maven-task.yaml in to one template

kind: Pipeline
metadata:
name: ${1:app-deploy}
spec:
tasks:
- name: ${2:taskName}
taskRef:
name: ${3:buildah}
9 changes: 9 additions & 0 deletions rawsnippets/pipeline-with-kubectl-task.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: ${1:app-deploy}
spec:
tasks:
- name: ${2:taskName}
taskRef:
name: ${3:kubectl}
9 changes: 9 additions & 0 deletions rawsnippets/pipeline-with-maven-task.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: ${1:app-deploy}
spec:
tasks:
- name: ${2:taskName}
taskRef:
name: ${3:maven}
15 changes: 15 additions & 0 deletions rawsnippets/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,18 @@ spec:
- name: ${4:taskName}
taskRef:
name: ${5:build-app}
- name: ${6:taskName}
taskRef:
name: ${7:maven}
- name: ${8:taskName}
taskRef:
name: ${9:buildah}
- name: ${10:taskName}
taskRef:
name: ${11:taskRefName}
conditions:
- conditionRef: ${12:conditionRefName}
finally:
- name: ${13:finallyName}
taskRef:
name: ${14:taskName}
94 changes: 93 additions & 1 deletion snippets/tekton.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,99 @@
" tasks:",
" - name: ${4:taskName}",
" taskRef:",
" name: ${5:build-app}"
" name: ${5:build-app}",
" - name: ${6:taskName}",
" taskRef:",
" name: ${7:maven}",
" - name: ${8:taskName}",
" taskRef:",
" name: ${9:buildah}",
" - name: ${10:taskName}",
" taskRef:",
" name: ${11:taskRefName}",
" conditions:",
" - conditionRef: ${12:conditionRefName}",
" finally:",
" - name: ${13:finallyName}",
" taskRef:",
" name: ${14:taskName}"
]
},
"Pipeline-finally": {
"prefix": "Pipeline-with-finally",
"description": "Create a Tekton Pipeline Resource with finally in spec",
"body": [
"apiVersion: tekton.dev/v1beta1",
"kind: Pipeline",
"metadata:",
" name: ${1:app-deploy}",
"spec:",
" finally:",
" - name: ${2:finallyName}",
" taskRef:",
" name: ${3:taskName}"
]
},
"Pipeline-with-buildah-task": {
"prefix": "Pipeline-with-buildah-task",
"description": "Create a Tekton Pipeline Resource with buildah task in spec",
"body": [
"apiVersion: tekton.dev/v1beta1",
"kind: Pipeline",
"metadata:",
" name: ${1:app-deploy}",
"spec:",
" tasks:",
" - name: ${2:taskName}",
" taskRef:",
" name: ${3:buildah}"
]
},
"Pipeline-with-kubectl-task": {
"prefix": "Pipeline-with-kubectl-task",
"description": "Create a Tekton Pipeline Resource with kubectl task in spec",
"body": [
"apiVersion: tekton.dev/v1beta1",
"kind: Pipeline",
"metadata:",
" name: ${1:app-deploy}",
"spec:",
" tasks:",
" - name: ${2:taskName}",
" taskRef:",
" name: ${3:kubectl}"
]
},
"Pipeline-with-maven-task": {
"prefix": "Pipeline-with-maven-task",
"description": "Create a Tekton Pipeline Resource with maven task in spec",
"body": [
"apiVersion: tekton.dev/v1beta1",
"kind: Pipeline",
"metadata:",
" name: ${1:app-deploy}",
"spec:",
" tasks:",
" - name: ${2:taskName}",
" taskRef:",
" name: ${3:maven}"
]
},
"Pipeline-condition": {
"prefix": "Pipeline-with-condition",
"description": "Create a Tekton Pipeline Resource with condition in spec",
"body": [
"apiVersion: tekton.dev/v1beta1",
"kind: Pipeline",
"metadata:",
" name: ${1:app-deploy}",
"spec:",
" tasks:",
" - name: ${2:taskName}",
" taskRef:",
" name: ${3:taskRefName}",
" conditions:",
" - conditionRef: ${4:conditionRefName}"
]
},
"PipelineRun": {
Expand Down