Skip to content

Commit

Permalink
Format code blocks with prettier
Browse files Browse the repository at this point in the history
This commit aims to standardize the formatting of code blocks. Most
importantly, it fixes a few cases of invalid indentation.

Most other changes are related to list indentation. Both 0 space and 2
space indentation has been used throughout the docs, while prettier
prefers 2 space indentation.
  • Loading branch information
eliasnorrby authored and tekton-robot committed Jun 5, 2021
1 parent ba25023 commit e76d413
Show file tree
Hide file tree
Showing 12 changed files with 438 additions and 442 deletions.
4 changes: 2 additions & 2 deletions docs/auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ Note: Github deprecated basic authentication with username and password. You can

- Associate the `ServiceAccount` with your `TaskRun`:

```yaml
```yaml
apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
Expand Down Expand Up @@ -463,7 +463,7 @@ Kubernetes `Secrets`.
spec:
serviceAccountName: build-bot
steps:
...
# ...
```

- Associate the `ServiceAccount` with your `PipelineRun`:
Expand Down
18 changes: 9 additions & 9 deletions docs/developers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,16 +260,16 @@ you end up with this task run status:
```yaml
apiVersion: tekton.dev/v1alpha1
kind: TaskRun
...
# ...
status:
...
# ...
taskResults:
- name: current-date-human-readable
value: |
Wed Jan 22 19:47:26 UTC 2020
- name: current-date-unix-timestamp
value: |
1579722445
- name: current-date-human-readable
value: |
Wed Jan 22 19:47:26 UTC 2020
- name: current-date-unix-timestamp
value: |
1579722445
```

Instead of hardcoding the path to the result file, the user can also use a variable. So `/tekton/results/current-date-unix-timestamp` can be replaced with: `$(results.current-date-unix-timestamp.path)`. This is more flexible if the path to result files ever changes.
Expand All @@ -294,7 +294,7 @@ apiVersion: tekton.dev/v1alpha1
kind: Pipeline
metadata:
name: sum-and-multiply-pipeline
#...
#...
tasks:
- name: sum-inputs
#...
Expand Down
16 changes: 8 additions & 8 deletions docs/enabling-ha.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ If HA is not required, you can disable it by scaling the deployment back to one
spec:
serviceAccountName: tekton-pipelines-controller
containers:
- name: tekton-pipelines-controller
...
args: [
# Other flags defined here...
"-disable-ha=true"
]
- name: tekton-pipelines-controller
# ...
args: [
# Other flags defined here...
"-disable-ha=true",
]
```

**Note:** If you set `-disable-ha=false` and run multiple replicas of the Controller, each replica will process work items separately, which will lead to unwanted behavior when creating resources (e.g., `TaskRuns`, etc.).
Expand Down Expand Up @@ -90,7 +90,7 @@ apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: tekton-pipelines-webhook
...
# ...
spec:
minReplicas: 1
```
Expand All @@ -114,7 +114,7 @@ metadata:
app.kubernetes.io/component: webhook
app.kubernetes.io/instance: default
app.kubernetes.io/part-of: tekton-pipelines
...
# ...
spec:
minAvailable: 1
selector:
Expand Down
196 changes: 98 additions & 98 deletions docs/migrating-v1alpha1-to-v1beta1.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ For example, consider the following `v1alpha1` parameters:
spec:
inputs:
params:
- name: ADDR
description: Address to curl.
type: string
- name: ADDR
description: Address to curl.
type: string

# TaskRun.yaml (v1alpha1)
spec:
inputs:
params:
- name: ADDR
value: https://example.com/foo.json
- name: ADDR
value: https://example.com/foo.json
```
The above parameters are now represented as follows in `v1beta1`:
Expand All @@ -62,15 +62,15 @@ The above parameters are now represented as follows in `v1beta1`:
# Task.yaml (v1beta1)
spec:
params:
- name: ADDR
description: Address to curl.
type: string
- name: ADDR
description: Address to curl.
type: string
# TaskRun.yaml (v1beta1)
spec:
params:
- name: ADDR
value: https://example.com/foo.json
- name: ADDR
value: https://example.com/foo.json
```

## Replacing `PipelineResources` with Tasks
Expand Down Expand Up @@ -100,32 +100,32 @@ metadata:
spec:
inputs:
resources:
- name: workspace
type: git
- name: workspace
type: git
params:
- name: pathToDockerFile
description: The path to the dockerfile to build
default: /workspace/workspace/Dockerfile
- name: pathToContext
description: The build context used by Kaniko
default: /workspace/workspace
- name: pathToDockerFile
description: The path to the dockerfile to build
default: /workspace/workspace/Dockerfile
- name: pathToContext
description: The build context used by Kaniko
default: /workspace/workspace
outputs:
resources:
- name: builtImage
type: image
- name: builtImage
type: image
steps:
- name: build-and-push
image: gcr.io/kaniko-project/executor:v0.17.1
env:
- name: "DOCKER_CONFIG"
value: "/tekton/home/.docker/"
args:
- --dockerfile=$(inputs.params.pathToDockerFile)
- --destination=$(outputs.resources.builtImage.url)
- --context=$(inputs.params.pathToContext)
- --oci-layout-path=$(inputs.resources.builtImage.path)
securityContext:
runAsUser: 0
- name: build-and-push
image: gcr.io/kaniko-project/executor:v0.17.1
env:
- name: "DOCKER_CONFIG"
value: "/tekton/home/.docker/"
args:
- --dockerfile=$(inputs.params.pathToDockerFile)
- --destination=$(outputs.resources.builtImage.url)
- --context=$(inputs.params.pathToContext)
- --oci-layout-path=$(inputs.resources.builtImage.path)
securityContext:
runAsUser: 0
```

To do the same thing with the `git` catalog `Task` and the kaniko `Task` you will need to combine them in a
Expand All @@ -140,38 +140,38 @@ metadata:
name: kaniko-pipeline
spec:
params:
- name: git-url
- name: git-revision
- name: image-name
- name: path-to-image-context
- name: path-to-dockerfile
- name: git-url
- name: git-revision
- name: image-name
- name: path-to-image-context
- name: path-to-dockerfile
workspaces:
- name: git-source
- name: git-source
tasks:
- name: fetch-from-git
taskRef:
name: git-clone
params:
- name: url
value: $(params.git-url)
- name: revision
value: $(params.git-revision)
workspaces:
- name: output
workspace: git-source
- name: build-image
taskRef:
name: kaniko
params:
- name: IMAGE
value: $(params.image-name)
- name: CONTEXT
value: $(params.path-to-image-context)
- name: DOCKERFILE
value: $(params.path-to-dockerfile)
workspaces:
- name: source
workspace: git-source
- name: fetch-from-git
taskRef:
name: git-clone
params:
- name: url
value: $(params.git-url)
- name: revision
value: $(params.git-revision)
workspaces:
- name: output
workspace: git-source
- name: build-image
taskRef:
name: kaniko
params:
- name: IMAGE
value: $(params.image-name)
- name: CONTEXT
value: $(params.path-to-image-context)
- name: DOCKERFILE
value: $(params.path-to-dockerfile)
workspaces:
- name: source
workspace: git-source
# If you want you can add a Task that uses the IMAGE_DIGEST from the kaniko task
# via $(tasks.build-image.results.IMAGE_DIGEST) - this was a feature we hadn't been
# able to fully deliver with the Image PipelineResource!
Expand Down Expand Up @@ -223,33 +223,33 @@ For example, consider the following `v1alpha1` definition:
spec:
inputs:
resources:
- name: skaffold
type: git
- name: skaffold
type: git
outputs:
resources:
- name: baked-image
type: image
- name: baked-image
type: image
# TaskRun.yaml (v1alpha1)
spec:
inputs:
resources:
- name: skaffold
resourceSpec:
type: git
params:
- name: revision
value: v0.32.0
- name: url
value: https://github.com/GoogleContainerTools/skaffold
- name: skaffold
resourceSpec:
type: git
params:
- name: revision
value: v0.32.0
- name: url
value: https://github.com/GoogleContainerTools/skaffold
outputs:
resources:
- name: baked-image
resourceSpec:
- type: image
params:
- name: url
value: gcr.io/foo/bar
- name: baked-image
resourceSpec:
- type: image
params:
- name: url
value: gcr.io/foo/bar
```

The above definition becomes the following in `v1beta1`:
Expand All @@ -259,29 +259,29 @@ The above definition becomes the following in `v1beta1`:
spec:
resources:
inputs:
- name: src-repo
type: git
- name: src-repo
type: git
outputs:
- name: baked-image
type: image
- name: baked-image
type: image
# TaskRun.yaml (v1beta1)
spec:
resources:
inputs:
- name: src-repo
resourceSpec:
type: git
params:
- name: revision
value: main
- name: url
value: https://github.com/tektoncd/pipeline
- name: src-repo
resourceSpec:
type: git
params:
- name: revision
value: main
- name: url
value: https://github.com/tektoncd/pipeline
outputs:
- name: baked-image
resourceSpec:
- type: image
params:
- name: url
value: gcr.io/foo/bar
- name: baked-image
resourceSpec:
- type: image
params:
- name: url
value: gcr.io/foo/bar
```
Loading

0 comments on commit e76d413

Please sign in to comment.