-
Notifications
You must be signed in to change notification settings - Fork 8
Hello World Basic Development Life Cycle
The core of composite template is a YAML based textual definition of the target environment or one of its parts.
- Open the
templates/tutorial/template.yaml
file in a YAML-enabled editor - Each template MUST have a unique identifier,
alias
, within Command Central templates list. The alias can only have alpha-numeric characters, underscores, dashes, and dots. - The
description
is optional but always useful. It should be short. - The
version
is optional but also useful
Enter the following in the initial version of the template.
alias: tutorial
description: Hello Command Central DevOps World!
version: 0.1
Save the changes you made to template.yaml
See complete template DSL (Domain Specific Language) documentation here
Import project 'templates' by running the ant templates
command:
[user@linuxbox tutorial]$ ant templates
...
BUILD SUCCESSFUL
Total time: N seconds
The ant templates
command builds the template archive build/templates/tutorial.zip
, then imports it into Command Central, overwriting any previous version of the template.
Apply the template by running the ant up
command:
[user@linuxbox tutorial]$ ant up -Dtemplates=tutorial
...
BUILD SUCCESSFUL
Total time: N seconds
The ant up
command validates input parameters and then starts the template application job. Then it monitors the execution of the created job and reports its status as the jobs runs. If the template job fails, the command fails with Build Failed error message, otherwise BUILD SUCCESSFUL
message is displayed.
You can check Command Central default log by running ant log
command
[user@linuxbox tutorial]$ ant log
...
[cc] 2018/01/04 11:56:22 INFO #1174 Begin applying composite template: tutorial
[cc] 2018/01/04 11:56:22 INFO #1174 Skipping stage: Checking migration source nodes registry...
[cc] 2018/01/04 11:56:22 INFO #1174 Skipping stage: Adding source nodes to Command Central: ...
[cc] 2018/01/04 11:56:22 INFO #1174 Skipping stage: Updating migration source nodes registry...
[cc] 2018/01/04 11:56:22 INFO #1174 Skipping stage: Preparing source machines for migration: ...
[cc] 2018/01/04 11:56:22 INFO #1174 Skipping stage: Preparing target machines for migration: ...
[cc] 2018/01/04 11:56:22 WARN #1174 No nodes will be bootstrapped!
[cc] 2018/01/04 11:56:22 INFO #1174 Updating inventory cache for nodes []
[cc] 2018/01/04 11:56:22 INFO #1174 Updating configurations cache for nodes []
[cc] 2018/01/04 11:56:22 INFO #1174 Layers to provision: []
[cc] 2018/01/04 11:56:22 INFO #1174 Updating inventory cache for nodes []
[cc] 2018/01/04 11:56:22 INFO #1174 Updating configurations cache for nodes []
[cc] 2018/01/04 11:56:22 INFO #1174 Finish applying composite template: tutorial
[cc] 2018/01/04 11:56:22 INFO #1174 Job completed: id 66 status DONE started Thu Jan 04 11:56:22 PST 2018 - Applying template tutorial
BUILD SUCCESSFUL
Make a minor change to the template, for example, add !!
to the description property
description: Hello Command Central DevOps World!!!
Save your changes.
Run ant templates up log -Dtemplates=tutorial
Here are the basic YAML rules:
- Indentation
YAML is a whitespace-indented language, meaning that indentation is used to denote structure. Items of the same indentation are considered to be siblings, while more or less indentation denotes child and parent relationships, respectively. For example:
- john:
children:
- james:
children:
- jim
- jane
- jenny:
children: []
- jeremy:
children: []
- No Tabs
Because they are universally supported, spaces are the whitespace character of choice within YAML files, and tabs are never allowed. Indenting with tabs instead of spaces within a YAML file is a common mistake for beginners, and can be very difficult to diagnose, so take special care to use the proper indentation method whenever working with YAML. To help mitigate this issue, it is highly recommended to display whitespace characters in your editor otherwise, it could be difficult to tell if the following code block is valid or not:
animals:
- Dog
- Cat
- Bird
Also, many editors have the ability to automatically replace a tab with a space. For example, in Notepad++ turn on 'Replace by space' in Settings -> Preferences -> Language.
- Case-Sensitive
While some languages—like PHP and MySQL—are case insensitive, YAML is not, so the following structure is considered valid:
key: "value 1"
Key: "value 2"
KEY: "value 3"
Congratulations! You have completed the basic composite template development lifecycle.
To continue with the next step in the tutorial project, type the following command:
[user@linuxbox tutorial]$ git checkout stage-01 -f
Switched to branch 'stage-01'
- Overview
- Project Structure and Navigation Through the Tutorial Steps
- Hello World Basic Development Life Cycle
- Using Parameters for Customization
- Bootstrapping Managed Installations
- Installing Products
- Installing Fixes
- Installing and Updating Core Products
- Creating Run time Instances
- Configuring Instances
- End 2 End Remote Test Environment Setup
- What's Next and Additional Resources