Search…
Bamboo
Bamboo Integration in Avo Assure

Execution using Bamboo

  1. 1.
    Log in to (Atlassian) Bamboo. The version used here is 7.1.1.
  2. 2.
    If a build plan is already created, then skip this step and navigate to the plan configuration screen. Follow these steps to create a build plan:
    1. 1.
      Click on the ‘Create’ button present on the header. Select ‘Create Plan’.
    2. 2.
      Select an existing Project or select ‘New Project’. If such an option is not present, then that means there are 0 existing Projects.
    3. 3.
      If creating a new Project, then give a desired ‘Project Name’ and a ‘Project Key’ will be auto-populated. The key can be changed but it has to unique.
    4. 4.
      Give a desired ‘Plan Name’. The plan key will be auto-populated and the key can be changed but it has to be unique.
    5. 5.
      Link any repository if needed. If not needed or unsure, then select ‘None’.
    6. 6.
      Click on ‘Configure Plan’ and click on ‘Save and continue’ on the next page.
Create Plan
3. Click on the Variables tab in the Plan Configuration screen and add the following variables: Variable name: AvoAssureUri Variable value: https://< AvoAssure URL > Variable name: AvoAssureExecutionRequestData Variable value: Paste Execution request data prepared above.
Variable Configuration
4. Click on desired stage and job (from the left-hand side panel) from where execution has to be triggered in Avo Assure. If a new plan is created without configuring stages, click on ‘Default Job’. Then click on the ‘Tasks’ tab.
Add Task Panel
5. Click on ‘Add Task’. Configuration for the task should look like this:
  1. 1.
    Select Task Type as ‘Script'.
  2. 2.
    Set the Task description as desired.
  3. 3.
    Set Interpreter as ‘Windows PowerShell’.
  4. 4.
    Select Script location as ‘Inline’.
  5. 5.
    Paste below code snippet in Script body.
1
$Uri = "${bamboo.Avo_Assure_Uri}/ExecuteTestSuite_ICE_SVN"
2
$Body = @"
3
${bamboo.Execution_Request_Data}
4
"@
5
$Headers = @{'Accept' = 'application/json'; 'Content-Type' = 'application/json'; }
6
if ('${bamboo.ICE_Name}' -ne '') {
7
$Headers.Add('x-ice-name', '${bamboo.ICE_Name}')
8
}
9
if ('${bamboo.Pool_Name}' -ne '') {
10
$Headers.Add('x-pool-name', '${bamboo.Pool_Name}')
11
}
12
if ('${bamboo.Token_Name}' -ne '') {
13
$Headers.Add('x-token-name', '${bamboo.Token_Name}')
14
}
15
if ('${bamboo.Token_Hash}' -ne '') {
16
$Headers.Add('x-token-hash', '${bamboo.Token_Hash}')
17
}
18
19
add-type @"
20
using System.Net;
21
using System.Security.Cryptography.X509Certificates;
22
public class TrustAllCertsPolicy : ICertificatePolicy {
23
public bool CheckValidationResult(
24
ServicePoint srvPoint, X509Certificate certificate,
25
WebRequest request, int certificateProblem) {
26
return true;
27
}
28
}
29
"@
30
$AllProtocols = [System.Net.SecurityProtocolType]'Tls,Tls11,Tls12'
31
[System.Net.ServicePointManager]::SecurityProtocol = $AllProtocols
32
[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy
33
34
try
35
{
36
$ResponseRaw = Invoke-WebRequest -Uri $Uri -Body $Body -Headers $Headers -Method Post -ErrorAction Stop -ContentType 'application/json'
37
$Response = $ResponseRaw.BaseResponse
38
$Msg = "Execution request to Avo Assure completed."
39
$Result = $ResponseRaw.Content
40
}
41
catch
42
{
43
$Response = $_.Exception.Response
44
$Msg = "Error while sending execution request to Avo Assure."
45
Write-Host $_.Exception
46
$Reader = New-Object System.IO.StreamReader($Response.GetResponseStream())
47
$Reader.BaseStream.Position = 0
48
$Reader.DiscardBufferedData()
49
$Result = $Reader.ReadToEnd()
50
}
51
Write-Host
52
Write-Host $Msg
53
Write-Host "Status Code: $($Response.StatusCode.value__)"
54
Write-Host "Response: $($Result)"
Copied!
6. Leave Argument, Environment Variables, and Working subdirectory fields empty.
7. Click on ‘Save’.
Script Task Configuration
6. Configuration is completed. Click on ‘Run Plan’ to start the execution.
Run Plan
7. Before starting the execution, make sure that ICE is connected.
8. Once the execution is completed, reports will be generated and can be viewed in the Avo Assure Reports plugin.
9. Bamboo will also have response data that looks like the below image. This data is available in the logs tab of the build summary.
Avo Assure Response Data
Last modified 7mo ago
Copy link