Create a release pipeline
Open your project, select the Releases entry and create a New pipeline.
In the dialog do not select a template and start with any Empty job.
Like build pipelines, release pipelines consist of stages, jobs and tasks. Other than build pipelines, they are usually defined using the UI instead of coding the yaml file directly. (Even though the same yaml syntax is being generated and used in the background). Give the first stage a name, e.g. `QA environment.
The stage will be generated containing one empty job. Select job to edit it and add tasks to it.
For demonstration purposes (in order to be able to intervene), we would like to add a manual task, that allows to decide if the release is to be resumed or cancelled once it has been triggered. Manual tasks require to be executed on the server in an agentless job, while the job created initially is a agent job. Therefore, we need to add a new, agentless job.
Move the job to the top location (making it the first job in the pipeline), give it a name, e.g. 'Prepare' and use the 'plus' sign to add a task to this job.
From the list of tasks, select Manual intervention and click Add.
Select the required task, give it a name, and add yourself as user to notify.
Select the Agent job to modify its settings and to add tasks to it. Especially, in the settings make sure to run it on the local agent pool, using the Agent pool dropdown.
As with the agentless job before, use the 'plus' sign to add the following tasks. All tasks are going to be "PowerShell" tasks, meaning the process to define will be the same for each task. First search for 'PowerShell' in the task list, select the PowerShell entry and click the Add button.
To define all the tasts, set the Script path to $(agentScriptsPath) followed by the name of the PowerShell script to use, e.g. $(agentScriptsPath)\Clear_Workspace.ps1 and the Arguments to the values defined shown below.
Task | Script | Arguments | Description |
---|---|---|---|
Clear Workspace | Clear_Workspace.ps1 | $(workspaceRoot) | Clear the designated workspace on the agent |
Get Sources | ISPW_Download_Container.ps1 | $(workspaceRoot) $(hostUri) $(hostPort) $(hostUser) $(hostPassword) $(hostCodePage) $(ispwConfig) $(ispwContainerName) $(ispwContainerType) $(ispwLevel) $(cliPath) | Download the sources for the components from Code Pipeline |
Get Functional Tests | Git_Clone_TTT_Repo.ps1 | $(workspaceRoot) ralphnuessecpwr/FTSDEMO_$(ispwApplication)_Functional_Tests | Clone a Git repository containing Total Test Functional Test scenarios (the second parameter points to the GitHub project and repository and will require modification) |
Run Functional Tests | TTT_Run_Functional_Tests.ps1 | $(workspaceRoot) $(cesUri) $(hostUser) $(hostPassword) $(ispwApplication) $(tttEnvironment) $(cliPath) | Execute the Functional Test scenarios |
Promote code to STG | ISPW_Operations.ps1 | ContainerOperation $(cesUrl) $(ispwConfig) assignments promote $(ispwContainerName) $(ispwLevel) $(cesToken) FTSDEMO $(ispwApplication) $(ispwServer) | Promote the code to the next level in Code Pipeline |
Define release pipeline specific variables / parameters
To make use of the variables in the variable group mainframe-pipeline-parameters and to define 'parameters', select Variables on the pipeline definition. Select Variable groups, click Link variable group and add the mainframe-pipeline-parameters.
Next select Pipeline variable and add the following variables, making them all Settable at release time.
Variable | Description |
---|---|
ispwApplication | Code Pipeline application (passed into the process by the Code Pipeline webhook) |
ispwContainerName | Code Pipeline container name (passed into the process by the Code Pipeline webhook) |
ispwContainerType | Code Pipeline container type (passed into the process by the Code Pipeline webhook) |
ispwLevel | Code Pipeline level (passed into the process by the Code Pipeline webhook) |