Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@

`AzurePipeline` is a simple Plugin to view your current Pipeline runs


# Description

`AzurePipeline` is a plugin that displays the current status of your Azure Pipeline.
Expand All @@ -15,13 +13,14 @@ This product was not developed or approved by Azure

You have to set the following properties

- Company Name
- Project
- Access Token (with the following rights)
- Build(Read)
- Release(Read)
- Pipeline ID (get it from the URL, called definitionId)
- run Index -> starting at 0 für the current run up to 30 for the 30th run
- Company Name
- Custom URL (optional, default is "https://dev.azure.com/")
- Project
- Access Token (with the following rights)
- Build(Read)
- Release(Read)
- Pipeline ID (get it from the URL, called definitionId)
- run Index -> starting at 0 für the current run up to 30 for the 30th run

# Features

Expand All @@ -31,12 +30,10 @@ You have to set the following properties

![](screenshot.png)


# Installation

In the Release folder, you can find the file `com.buzzet.azurepipeline.streamDeckPlugin`. If you double-click this file on your machine, Stream Deck will install the plugin.


# Source code

The Sources folder contains the source code of the plugin.
23 changes: 18 additions & 5 deletions Sources/com.buzzet.azurepipeline.sdPlugin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,28 @@
var company = "";
var project = "";
var pipelineId = "";

if (settings != null && settings.hasOwnProperty('company')) {
var customURL = "https://dev.azure.com/";

if (settings != null && settings.hasOwnProperty('company')) {
company = settings["company"];
}
if (settings != null && settings.hasOwnProperty('customURL')) {
customURL = settings["customURL"];
}
if (settings != null && settings.hasOwnProperty('project')) {
project = settings["project"];
}
if (settings != null && settings.hasOwnProperty('pipelineId')) {
pipelineId = settings["pipelineId"];
}
this.OpenUrl("https://dev.azure.com/" + company + "/" + project + "/_build?definitionId=" + pipelineId)
this.OpenUrl(customURL + company + "/" + project + "/_build?definitionId=" + pipelineId)
},

onWillAppear: async function (context, settings, coordinates) {
console.log(settings)
var company = "";
var project = "";
var customURL = "https://dev.azure.com/";
// var repo = "";
var pipelineId = ""
var index = 0
Expand All @@ -56,6 +61,9 @@
if (settings != null && settings.hasOwnProperty('project')) {
project = settings["project"];
}
if (settings != null && settings.hasOwnProperty('customURL')) {
customURL = settings["customURL"];
}
// if (settings != null && settings.hasOwnProperty('repo')) {
// repo = settings["repo"];
// }
Expand All @@ -76,11 +84,11 @@
}
headers.append('Authorization', 'Basic' + btoa("abc" + ":" + accessToken))
console.log(settings)
console.log(company, project, pipelineId, index)
console.log(company, customURL, project, pipelineId, index)
while (true) {


fetch("http://dev.azure.com/" + company + "/" + project + "/_apis/pipelines/" + pipelineId + "/runs?api-version=6.0-preview.1", { method: 'GET', headers: headers }).then((response) => {
fetch(customURL + company + "/" + project + "/_apis/pipelines/" + pipelineId + "/runs?api-version=6.0-preview.1", { method: 'GET', headers: headers }).then((response) => {
return response.json()
}).then((data) => {
let value = data.value;
Expand Down Expand Up @@ -216,6 +224,11 @@
var newValue = jsonPayload.setCompany;
settingsCache['company'] = newValue
}
if (jsonPayload.hasOwnProperty('setCustomURL')) {

var newValue = jsonPayload.setCustomURL;
settingsCache['customURL'] = newValue
}
if (jsonPayload.hasOwnProperty('setProject')) {

var newValue = jsonPayload.setProject;
Expand Down
2 changes: 1 addition & 1 deletion Sources/com.buzzet.azurepipeline.sdPlugin/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"Icon": "keyIcon",
"URL": "https://github.com/Buzzet/streamdeck-azure-pipeline",
"PropertyInspectorPath": "shellyControll.html",
"Version": "1.1",
"Version": "1.2",
"OS": [
{
"Platform": "mac",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
<input id="companyField" oninput="sendValueToPlugin(event.target.value, 'setCompany')">
</div>
</div>
<div type="field" class="sdpi-item">
<div class="sdpi-item-label">Custom URL</div>
<div class="sdpi-item-value field">
<input id="customURLField" oninput="sendValueToPlugin(event.target.value, 'setCustomURL')">
</div>
</div>
<div type="field" class="sdpi-item">
<div class="sdpi-item-label">Project</div>
<div class="sdpi-item-value field">
Expand Down Expand Up @@ -57,6 +63,7 @@
}
settings = jsonObj.actionInfo.payload.settings;
document.getElementById('companyField').value = settings.company || ''
document.getElementById('customURLField').value = settings.customURL || ''
document.getElementById('projectField').value = settings.project || ''
document.getElementById('accessTokenField').value = settings.accessToken || ''
document.getElementById('pipelineIdField').value = settings.pipelineId || ''
Expand All @@ -74,7 +81,6 @@
$SD.api.sendToPlugin(uuid, pluginAction, payload);
}
}

</script>

</body>
Expand Down