Skip to main content

Quickstart

This quick start section provides a "Hello World" example by adding Stackforms to an existing private stack.

note

To start a new stack, we recommend using Cycloid's stack blueprint feature, which already includes all the basic file contents and a simple Stackforms configuration.

Context​

The Stackforms configuration file is bound to the stack configuration defined in the .cycloid.yml file. Let's take the following example:

.cycloid.yml
name: 'Dummy stack'
canonical: 'stack-dummy'
...
config:
default:
name: 'default'
description: 'Default pipeline usecase'
pipeline:
pipeline:
path: 'pipeline/pipeline.yml'
variables:
path: 'pipeline/variables.sample.yml'
destination: '($ .project $)/pipeline/variables-($ .environment $).yml'

As mentioned previously in the prerequisite section, each stack use-case has to be defined in the .forms.yml file. In our example, we can see one use-case (line 5) called default.

Then, as explained in the introduction section, Stackform uses a sample file to render and write variables. In the current configuration file, we defined variables.sample.yml located in the technology pipeline (line 11). Technologies will be defined in more detail in the .forms file format section.

Configuration​

Based on the context above, here is the .forms.yml file you can create in the stack git repository, next to the .cycloid.yml file.

stackforms-quickstart

.forms.yml
use_cases:
- name: default
sections:
- name: Global configuration
groups:
- name: User message
technologies: [pipeline]
vars:
- name: "Message"
description: "The message to display"
key: message
widget: simple_text
type: string
default: "hello world and especially to ($ .organization $)"

This Stackforms configuration file defines a form for the default use case (line 3) and displays a text widget where the value will be written into a variable named message in pipeline technology samples.

The result should be the following file created in your config repository:

myproject/pipeline/variables-myenv.yml
message: hello world and especially to ...