Skip to content

Generating Assets from Templates

bpaskalev edited this page Aug 30, 2019 · 1 revision

Overview

This project uses the Travis CI continuous integration tool for generating defaults assets based on a subset of the available templates. Generated assets can be imported in Command Central and used as templates and layer definitions. All modifications of the templates, on which the assets are based, are continuously tested. Templates are converted to assets only after successfully passing the tests. Generated assets are uploaded to the sagdevops-templates-repo project.

Building Assets

If a template that is the base of an asset in the sagdevops-templates-repo proejct is updated and the update is pushed in a custom branch of this project, a Travis CI job (.travis.yml) is triggered. The Travis CI job checks the validity of the updated template by applying it in a docker container using the Command Central Docker Builder. However, assets created by the travis job are uploaded to the sagdevops-templates-repo project only when a pull request containing the updated template is created and merged in the master branch.

Currently, assets are available for the following templates:

Modifying Existing Templates

Modifying the templates used for generating assets can only be done in a custom branch of this project. If you have a custom branch in sagdevops-templates and you modify a template that is built as an asset, you can open a pull request against the master branch. If the changes are approved, the pull request will be merged into the master branch of the sagdevops-templates project. This will trigger a Travis CI job that builds the modified template as an asset.

IMPORTANT! You cannot use forks to modify the templates, on which the assets are based because of the Travis CI security restrictions documented here: https://docs.travis-ci.com/user/pull-requests#pull-requests-and-security-restrictions

Creating New Assets

If you have a custom branch in the sagdevops-templates prject you can create new templates to be built as assets. To create a new template and build it as a new asset:

  1. Create and upload a composite template and a test.sh file for the template in your sagdevops-templates custom branch. For information about creating templates, see Creating new templates. Note that you cannot use a fork of this project when creating templates for generating assets in sagdevops-templates-repo.
  2. Edit the .travis.yml file and add the template alias as a new line in the matrix: section. For example, to add a new template with alias "my-template", add the following line in the matrix: section: - T=my-template