Validates and publishes templates
npm install screwdriver-template-main
Run the template-validate
script. By default, the path ./sd-template.yaml
will be read. However, a user can specify a custom path using the env variable: SD_TEMPLATE_PATH
.
Example screwdriver.yaml
:
shared:
image: node:6
jobs:
main:
steps:
- install: npm install screwdriver-template-main
- validate: ./node_modules/.bin/template-validate
environment:
SD_TEMPLATE_PATH: ./path/to/template.yaml
Run the template-publish
script. By default, the path ./sd-template.yaml
will be read. However, a user can specify a custom path using the env variable: SD_TEMPLATE_PATH
.
Example screwdriver.yaml
with validation and publishing:
shared:
image: node:6
jobs:
# the main job is run in pull requests as well
main:
steps:
- install: npm install screwdriver-template-main
- validate: ./node_modules/.bin/template-validate
publish:
steps:
- install: npm install screwdriver-template-main
- publish: ./node_modules/.bin/template-publish
Optionally, tag a template using the template-tag
script. This must be done in the same pipeline that published the template. You'll need to add arguments for the template name, tag, and version. The version must be an exact version, not just a major or major.minor one.
Example screwdriver.yaml
with validation and publishing and tagging:
shared:
image: node:6
jobs:
# the main job is run in pull requests as well
main:
steps:
- install: npm install screwdriver-template-main
- validate: ./node_modules/.bin/template-validate
publish:
steps:
- install: npm install screwdriver-template-main
- publish: ./node_modules/.bin/template-publish
- tag: ./node_modules/.bin/template-tag --name templateName --version 1.2.3 --tag stable
Create a Screwdriver pipeline with your template repo and start the build to validate and publish it.
To update a Screwdriver template, make changes in your SCM repository and rerun the pipeline build.
npm test
Code licensed under the BSD 3-Clause license. See LICENSE file for terms.