-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tags configured by the user to Jenkins traces (#210)
- Loading branch information
1 parent
8439795
commit d759eda
Showing
10 changed files
with
220 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/main/java/org/datadog/jenkins/plugins/datadog/model/CIGlobalTagsAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package org.datadog.jenkins.plugins.datadog.model; | ||
|
||
import hudson.model.InvisibleAction; | ||
|
||
import java.io.Serializable; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public class CIGlobalTagsAction extends InvisibleAction implements Serializable { | ||
|
||
private final Map<String, String> tags; | ||
|
||
public CIGlobalTagsAction(final Map<String, String> tags) { | ||
this.tags = tags != null ? tags : new HashMap<>(); | ||
} | ||
|
||
public Map<String, String> getTags() { | ||
return tags; | ||
} | ||
|
||
public void putAll(Map<String, String> tags) { | ||
this.tags.putAll(tags); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/test/resources/org/datadog/jenkins/plugins/datadog/listeners/testPipelineGlobalTags.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
def DD_TEST = "pipeline_tag_v2" | ||
pipeline { | ||
agent { | ||
label "testGlobalTags" | ||
} | ||
options { | ||
datadog(collectLogs: false, tags: ["pipeline_tag:${DD_TEST}", "${DD_TEST}:pipeline_tag"]) | ||
} | ||
stages { | ||
stage('Stage'){ | ||
steps { | ||
echo 'Done' | ||
} | ||
} | ||
} | ||
} |