Skip to content

Commit

Permalink
Support for 0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
heydenb committed Oct 21, 2021
1 parent 11889ca commit 62b99b1
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 36 deletions.
17 changes: 2 additions & 15 deletions PrepareKeptnEnvTask/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,23 +292,10 @@ async function entityExists(entityType:string, input:Params, httpClient:AxiosIns

function getAPIFor(apiType:string, keptnVersion:string){
if (apiType.startsWith('project-resource')){
if (keptnVersion == '0.6'){
return '/v1';
}
else{
return '/configuration-service/v1';
}
return '/configuration-service/v1';
}
else if (apiType.startsWith('project')){
if (keptnVersion.startsWith('0.8')){
return "/controlPlane/v1"
}
else if (apiType == 'project-get'){
return '/configuration-service/v1';
}
else if (apiType == 'project-post'){
return '/v1';
}
return "/controlPlane/v1"
}
else if (apiType.startsWith('event')){
return '/v1';
Expand Down
4 changes: 2 additions & 2 deletions PrepareKeptnEnvTask/task.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
],
"demands": [],
"version": {
"Major": 1,
"Minor": 12,
"Major": 2,
"Minor": 0,
"Patch": 0
},
"groups": [
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ Bugfix in startEvaluation. Endpoint does not require evaluation in body.
Fix issue 34 by implementing delivery and generic triggered events.
* **1.3.6**
Improvement issue 35 by implementing wait for evaluation, delivery and generic triggered events.
* **1.4.0**
Support 0.9.x during project initiation. version 2 of prepare task.

Created by `Bert Van der Heyden, Inetum-RealDolmen`.
Also available via the MarketPlace: https://marketplace.visualstudio.com/items?itemName=RealdolmenDevOps.keptn-integration
Expand Down
33 changes: 17 additions & 16 deletions SendKeptnEventTask/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -537,15 +537,7 @@ async function configurationChanged(input:Params, httpClient:AxiosInstance){

function getAPIFor(apiType:string, keptnVersion:string){
if (apiType.startsWith('project')){
if (keptnVersion.startsWith('0.8')){
return "/controlPlane/v1"
}
else if (apiType == 'project-get'){
return '/configuration-service/v1';
}
else if (apiType == 'project-post'){
return '/v1';
}
return "/controlPlane/v1"
}
else if (apiType.startsWith('event')){
return '/v1';
Expand All @@ -557,13 +549,22 @@ function getAPIFor(apiType:string, keptnVersion:string){
* Helper function to parse the labels
*/
function parseLabels():any{
let labels:any = {
buildId: tl.getVariable("Build.BuildNumber"),
definition: tl.getVariable("Release.DefinitionName"),
runby: tl.getVariable("Build.QueuedBy"),
environment : tl.getVariable("Environment.Name"),
pipeline : tl.getVariable("Release.ReleaseWebURL")
};
let labels:any = {};
if (tl.getVariable("Build.BuildNumber") != undefined){
labels['buildId'] = tl.getVariable("Build.BuildNumber");
}
if (tl.getVariable("Release.DefinitionName") != undefined){
labels['definition'] = tl.getVariable("Release.DefinitionName");
}
if (tl.getVariable("Build.QueuedBy") != undefined){
labels['runby'] = tl.getVariable("Build.QueuedBy");
}
if (tl.getVariable("Release.EnvironmentName") != undefined){
labels['environment'] = tl.getVariable("Release.EnvironmentName");
}
if (tl.getVariable("Release.ReleaseWebURL") != undefined){
labels['pipeline'] = tl.getVariable("Release.ReleaseWebURL");
}

const labelsConfig: string | undefined = tl.getInput('labels');
if (labelsConfig != undefined && labelsConfig.trim().length > 0){
Expand Down
2 changes: 1 addition & 1 deletion SendKeptnEventTask/task.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 3,
"Minor": 0,
"Patch": 0
"Patch": 2
},
"groups": [
{
Expand Down
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"main": {
"vssVersion": "1.3.6",
"vssVersion": "1.4.1",
"vssId": "keptn-integration",
"vssName": "Keptn Integration"
},
Expand Down
2 changes: 1 addition & 1 deletion vss-extension.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifestVersion": 1,
"id": "keptn-integration",
"version": "1.3.6",
"version": "1.4.1",
"name": "Keptn Integration",
"description": "Integration of Keptn within your build or release pipeline.",
"publisher": "RealdolmenDevOps",
Expand Down

0 comments on commit 62b99b1

Please sign in to comment.