To quickly get started with DevOps as Code, you can:

  • Use the XL CLI to generate YAML files for an existing XL Deploy and XL Release configurations and transition to managing your deployments and pipelines “as code”.
  • Use the blueprints feature to generate YAML files that you can then use to provision and deploy your applications to your infrastructure.
  • Review other resources including concepts, snippets and tutorials.

Use the XL CLI generate command

If you have existing applications and pipelines configured in XL Deploy and XL Release, you can get started with DevOps as Code by using the xl generate command to generate YAML files with details from these existing configurations. Because the resulting YAML files and syntax represent familiar constructs used in your development environment, you can use the information as a starting point to extend and expand your own YAML files, helping to bootstrap your transition to an “as code” development and release model.

  • For XL Deploy, you can generate YAML files for Applications, Infrastructure, Environments, and Configurations.
  • For XL Release, you can generate YAML files from Templates.

Generate YAML files from existing configurations

Here are a few simple XL CLI command line examples to generate YAML files from your existing configurations.

Generate a YAML file from an XL Deploy Application configuration

To generate a YAML file for an existing Application configuration from XL Deploy:

xl generate -s xl-deploy -p Applications/myapp -f tmp/myapplication.yaml

The resulting YAML file might look like:

apiVersion: xl-deploy/v1
kind: Applications
spec:
- name: Applications/App
  type: udm.Application
  lastVersion: '1.0'
  children:
  - name: '1.0'
    type: udm.DeploymentPackage
    deployables:
    - name: file
      type: file.File
      targetPath: /tmp
      file: !file artifacts/Applications/App/1.0/file/enhanced-buzz-9180-1421871254-19.webp

Generate a YAML file for an XL Deploy Infrastructure configuration

To generate a YAML file for an existing Infrastructure configuration from XL Deploy:

xl generate -s xl-deploy -p Infrastructure -f tmp/myinfra.yaml

The resulting YAML file might look like:

apiVersion: xl-deploy/v1
kind: Infrastructure
spec:
- name: Infrastructure/localhost
  type: overthere.LocalHost
  os: UNIX

Generate a YAML file for an XL Deploy Environment configuration

To generate a YAML file for an existing Infrastructure configuration from XL Deploy:

xl generate -s xl-deploy -p Environment -f tmp/myenvironment.yaml

The resulting YAML file might look like:

apiVersion: xl-deploy/v1
kind: Environments
spec:
- name: Environments/localEnv
  type: udm.Environment
  members:
  - Infrastructure/localhost

Generate a YAML file for an XL Release Template configuration

To generate a YAML file for an existing Template configuration from XL Release:

xl generate -s xl-release -p Pipeline -f /tmp/mypipeline.yaml

The resulting YAML file might look like:

apiVersion: xl-release/v1
kind: Templates
spec:
- name: MyTemplate
  type: xlrelease.Release
  scheduledStartDate: 2018-10-25T07:00:00Z
  phases:
  - name: My Phase
    type: xlrelease.Phase
    tasks:
    - name: My Task
      type: xlrelease.Task
    color: #0099CC

Resources

This section lists resources to help you get started with DevOps as Code.

Base concepts

To understand the basics of DevOps as Code, see the following topics:

  • DevOps as Code overview: Provides a brief overview of the DevOps as Code feature
  • Using the XL Command Line Interface: Describes how to install and use the CLI and provides command syntax reference information
  • Understanding the XL YAML format: Provides a reference for the declarative XL YAML file structure for each available kind for XL Deploy and XL Release
  • Using the XL wrapper script: Understand how to utilize a wrapper script to bootstrap the XL CLI commands on your Unix or Windows-based Continuous Integration (CI) servers without having to install the XL CLI executable itself. The script is also useful for sharing code or projects with your teams

YAML snippets

For a list of example YAML snippets for XL Deploy and XL Release, see:

Tutorials

Example scenarios for how to use DevOps as Code include:

Workshop

Use the interactive DevOps as Code workshop that shows you how to:

  • Install the XL CLI
  • Import and deploy a Docker application with XL Deploy
  • Import and run a pipeline with XL Release
  • Generate XL YAML files to learn about the syntax
  • Provision a container infrastructure into AWS with CloudFormation and then deploy a simple monolith application into it