In Socrates, when you connect to github, you have the ability to dynamically create components define by .yaml files. These files, alongside the code files describe your entire Socrates infrastructure.
There are 4 types of Components you can make using this type of integration:
Block (filename.block.yaml):
You must enable "Create dynamic/shared parameters" in the Settings page if you define a block with non-existing shared/dynamic parameters. Otherwise, the block will be added without.
name:Example Block# Unique name of the block as will appear in the UIlang:bash# Code language, needs to pre-exist in socratesparameters: - key:textparamvalue:a texttype:text# text parameter, not sharedsecret:true - key:boolparamvalue:truetype:bool# boolean parameter - key:multiparamvalue: - option1 - option2 - option3type:multi# multiple choice parameter and options - key:sharedparamvalue:shared textsecret:falsetype:shared - key:dynamiclang:bashvalue:| echo "::set-output result=[a,b,c]"type:dynamic# dynamic parameter and options. # Currently there is no default. to create a default, assign one to an instance.script:github:integrations/trigger_jenkins.py# EITHER thiscode:|# OR this envprescript:enabled:true# Enabled a pre-script in bashscript:| echo this is a pre scriptdesc:|# description a block created from git integrationimage:existing_icon.png# Image, if it exists
Instance (filename.instance.yaml):
name:Example Instanceblock:Example Block# Must exist either in Github or the UIschedule:0/1 * * * *# optionalparameters:# Override a specific parameter, can be any kind except shared/dynamic - key:param_namevalue:override valuedesc:| an instance created from git integrationimage:existing_icon.png
Step Flow (filename.step.yaml):
steps: - - name:Example Instance# - - two lines indicate the start of a step - name:Example Instance - - name:Example Instancename:Example Stepschedule:0/1 * * * *# optionalon_error:continue# continue / stopdesc:| a step flow created from githubimage:256.png