Skip to content

Commit

Permalink
Add the ALMOctaneConnectionVerifier task - fixing the lack of decorat…
Browse files Browse the repository at this point in the history
…or injection in classic pipelines.
  • Loading branch information
stekel committed Dec 10, 2019
1 parent 03de91c commit 5952064
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 3 deletions.
12 changes: 12 additions & 0 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ mkdir pkg || goto :error
xcopy /S /Y templates\* pkg\ || goto :error
xcopy /S /Y src\* pkg\Tasks\StartTask\ || goto :error
xcopy /S /Y src\* pkg\Tasks\EndTask\ || goto :error
xcopy /S /Y src\* pkg\Tasks\ConnectionVerifier\ || goto :error

pushd .
echo.
Expand All @@ -26,6 +27,17 @@ echo EndTask is ready
echo ======================================
popd

pushd .
echo.
echo ======================================
echo Building EndTask
cd pkg\Tasks\EndTask
cmd /C "npm install && tsc || goto :error"
echo EndTask is ready
echo ======================================
popd


pushd .
echo.
echo ======================================
Expand Down
2 changes: 1 addition & 1 deletion templates/Decorators/octane-pipeline-end-decorator.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
steps:
- ${{ if eq(variables['InjectAlmOctaneTasks'], 'true') }}:
- task: ALMOctane.alm-octane-integration.octane-end-task.octane-end-task@1
- task: octane-end-task@1
condition: always()
displayName: 'ALM Octane Job End'
inputs:
Expand Down
2 changes: 1 addition & 1 deletion templates/Decorators/octane-pipeline-start-decorator.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
steps:
- ${{ if eq(variables['InjectAlmOctaneTasks'], 'true') }}:
- task: ALMOctane.alm-octane-integration.octane-start-task.octane-start-task@1
- task: octane-start-task@1
condition: always()
displayName: 'ALM Octane Job Start'
inputs:
Expand Down
35 changes: 35 additions & 0 deletions templates/Tasks/ConnectionVerifier/task.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"id": "c4fe5a36-45d1-4ecc-9ad5-6ec18a1ba0f8",
"name": "octane-connection-verifier",
"friendlyName": "ALM Octane Connection Verifier",
"description": "ALM Octane Connection Verifier",
"author": "Micro Focus",
"category": "Build",
"visibility": [
"Build",
"Release"
],
"demands": [],
"version": {
"Major": "1",
"Minor": "0",
"Patch": "0"
},
"minimumAgentVersion": "1.95.0",
"instanceNameFormat": "ALM Octane Connection Verifier",
"inputs": [
{
"name": "OctaneServiceConnection",
"type": "connectedService:OctaneServiceConnection",
"label": "Octane service/server end point",
"required": false,
"helpMarkDown": "Select the Octane endpoint to use. If needed, click on 'manage', and add a new service endpoint of type 'Octane server connection'"
}
],
"execution": {
"Node": {
"target": "task.js",
"argumentFormat": ""
}
}
}
5 changes: 5 additions & 0 deletions templates/Tasks/ConnectionVerifier/task.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
async function runTask() {
await Promise.resolve();
}

runTask().catch(err => console.error(err));
13 changes: 12 additions & 1 deletion templates/vss-extension.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifestVersion": 1,
"id": "alm-octane-integration",
"version": "0.1.3",
"version": "0.1.4",
"name": "ALM Octane Integration Extension",
"description": "An Azure DevOps extension that supplies the required entities for establishing an integration with ALM Octane.",
"publisher": "ALMOctane",
Expand Down Expand Up @@ -93,6 +93,17 @@
"name": "Tasks/EndTask"
}
},
{
"id": "octane-connection-verifier",
"description": "ALM Octane Connection Verifier",
"type": "ms.vss-distributed-task.task",
"targets": [
"ms.vss-distributed-task.tasks"
],
"properties": {
"name": "Tasks/ConnectionVerifier"
}
},
{
"id": "octane-pipeline-start-decorator",
"type": "ms.azure-pipelines.pipeline-decorator",
Expand Down

0 comments on commit 5952064

Please sign in to comment.