-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d2a1035
commit f3be086
Showing
4 changed files
with
119 additions
and
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative "extractor" | ||
require_relative "../git" | ||
|
||
module Datadog | ||
module CI | ||
module Ext | ||
module Environment | ||
# Parses user defined git data from the environment variables | ||
# User documentation: https://docs.datadoghq.com/continuous_integration/troubleshooting/#data-appears-in-test-runs-but-not-tests | ||
class UserDefinedTags < Extractor | ||
def git_repository_url | ||
env[Git::ENV_REPOSITORY_URL] | ||
end | ||
|
||
def git_commit_sha | ||
env[Git::ENV_COMMIT_SHA] | ||
end | ||
|
||
def git_branch | ||
env[Git::ENV_BRANCH] | ||
end | ||
|
||
def git_tag | ||
env[Git::ENV_TAG] | ||
end | ||
|
||
def git_commit_message | ||
env[Git::ENV_COMMIT_MESSAGE] | ||
end | ||
|
||
def git_commit_author_name | ||
env[Git::ENV_COMMIT_AUTHOR_NAME] | ||
end | ||
|
||
def git_commit_author_email | ||
env[Git::ENV_COMMIT_AUTHOR_EMAIL] | ||
end | ||
|
||
def git_commit_author_date | ||
env[Git::ENV_COMMIT_AUTHOR_DATE] | ||
end | ||
|
||
def git_commit_committer_name | ||
env[Git::ENV_COMMIT_COMMITTER_NAME] | ||
end | ||
|
||
def git_commit_committer_email | ||
env[Git::ENV_COMMIT_COMMITTER_EMAIL] | ||
end | ||
|
||
def git_commit_committer_date | ||
env[Git::ENV_COMMIT_COMMITTER_DATE] | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
module Datadog | ||
module CI | ||
module Ext | ||
module Environment | ||
class UserDefinedTags < Extractor | ||
def git_repository_url: () -> String? | ||
|
||
def git_commit_sha: () -> String? | ||
|
||
def git_branch: () -> String? | ||
|
||
def git_tag: () -> String? | ||
|
||
def git_commit_message: () -> String? | ||
|
||
def git_commit_author_name: () -> String? | ||
|
||
def git_commit_author_email: () -> String? | ||
|
||
def git_commit_author_date: () -> String? | ||
|
||
def git_commit_committer_name: () -> String? | ||
|
||
def git_commit_committer_email: () -> String? | ||
|
||
def git_commit_committer_date: () -> String? | ||
end | ||
end | ||
end | ||
end | ||
end |