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

feat(2331): Add locked step #453

Merged
merged 2 commits into from
Mar 1, 2021
Merged
Changes from 1 commit
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
23 changes: 22 additions & 1 deletion docs/user-guide/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ toc:
- title: Template steps
url: "#template-steps"
subitem: level-2
- title: Template locked steps
url: "#template-locked-steps"
subitem: level-2
- title: Template composition
url: "#template-composition"
subitem: true
Expand Down Expand Up @@ -163,7 +166,9 @@ jobs:

This will run the command `echo skip installing` for the `install` step.

You can also replace the image defined in the template. Some template steps might rely on commands or environment invariants that your image may not have, so be careful when replacement.
Note: You cannot replace a [locked step](#template-locked-steps).

You can also replace the image defined in the template. Some template steps might rely on commands or environment invariants that your image may not have, so be careful when replacing.

Example:
```yaml
Expand Down Expand Up @@ -375,6 +380,22 @@ jobs:
```
It becomes unclear whether the user was trying to override `preinstall` or wrap `install`.

#### Template Locked Steps
You can specify steps that cannot be overwritten and must be included when using `order` by adding a `locked` key to your steps. It expects a boolean value (`true`/`false`; default is `false`).
This flag applies to any template or job that uses this template. All templates using a template with a `locked` step will also have the same locked step.

```yaml
config:
image: node:12
steps:
- preinstall: echo Installing
- install: npm install
- test:
command: npm test
locked: true
```


### Template Composition
You can also use a template in the `config` section of an `sd-template.yaml` file.

Expand Down