https://github.com/inflectra/spira-buildserver-azure-devops
https://github.com/inflectra/spira-buildserver-azure-devops
spira
Last synced: about 16 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/inflectra/spira-buildserver-azure-devops
- Owner: Inflectra
- Created: 2021-04-18T14:23:11.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2026-02-14T10:10:26.000Z (4 months ago)
- Last Synced: 2026-03-05T07:37:08.071Z (4 months ago)
- Topics: spira
- Language: JavaScript
- Homepage:
- Size: 2.54 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Spira Extension for Azure DevOps
## Brief Overview
Auomatically create builds in SpiraTest/Team/Plan when they complete in DevOps.
### Don't have Spira?
If you do not have a Spira subscription, fear not! You can get a 30 day free trial for our flagship ALM product [SpiraPlan](http://www.inflectra.com/SpiraPlan/). No credit card needed.
### Guide Basics
This guide assumes you are familiar with Azure DevOps Pipelines and have already installed our plugin from the DevOps marketplace.
## Authenticating with Spira
In DevOps, open the project you would like to have builds sync with Spira. Go to Project Settings > Pipelines > Service Connections
Under Service connections, click the "New service connection" button and click "SpiraPlan Configuration." Under connection name, put something helpful like `SpiraPlan Fred Bloggs`
For SpiraPlan URL put the 'root' directory of your Spira instance, not including the end slash. For username, put the username you use to sign-in to Spira. For RSS Token, go to your user profile page in Spira, enable RSS Feeds and copy the token into DevOps. Now verify the connection by clicking "Verify connection," if you entered everything correctly, you're good to go!
## Adding the Spira Build Task
Now in the pipeline you would like to add Spira support to, open the pipeline's YAML file and in the assistant to the right, search "Spira" and select "Export data to Spira" Select the service connection name you put in earlier, enter the ID of the project in Spira you would like your results sent to, the ID of the release you would like the builds to be associated with, and the base url of your DevOps instance (like https://dev.azure.com/fabrikam or https://fabrikam.visualstudio.com)
The other fields are used internally by the plugin and should be left as-is - DO NOT CHANGE THEM. Click "Add" and add the `condition: succeededOrFailed()` above `inputs` in the YAML snippet. This makes sure that the Spira task can access the current build status.
Now move the `spira-build-task` YAML Snippet to the end of the file so that it's executed last. This will make sure that the final result of the build gets recorded in Spira.
Here is an example YAML file:
```YAML
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- script: |
npm install
npm test
displayName: 'npm install and test'
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testRunner: JUnit
testResultsFiles: '**/junitresults-*.xml'
- task: spira-build-task@0
condition: succeededOrFailed()
inputs:
connectedService: 'SpiraPlan Fred Bloggs'
project: '2'
releaseId: '20'
baseUrl: 'https://dev.azure.com/inflectra'
buildNumber: '$(Build.BuildNumber)'
buildStatus: '$(Agent.JobStatus)'
buildId: '$(Build.BuildId)'
sourceVersion: '$(Build.SourceVersion)'
projectName: '$(System.TeamProject)'
```
If everything had been configured correctly a new build in DevOps will create a new build in Spira!
## Developer Setup
### Prerequisites
Install the TFS Cross Platform Command Line Interface (tfx-cli):
```bash
npm install -g tfx-cli
```
### Building and Packaging
1. Install dependencies:
```bash
npm install
```
2. Build the bundled task:
```bash
npm run build
```
3. Package the extension:
```bash
tfx extension create
```
### Version Management
Update version numbers in these files before packaging:
1. **Extension version** in `vss-extension.json`:
```json
"version": "1.1"
```
2. **Task version** in `BuildTaskFolder/task.json`:
```json
"version": {
"Major": "0",
"Minor": "2",
"Patch": "1"
}
```
3. **Package version** in `package.json`:
```json
"version": "1.1.0"
```