forked from KevinSnyderCodes/github-deployment-resource
-
Notifications
You must be signed in to change notification settings - Fork 0
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
c340fb1
commit cde1a4f
Showing
5 changed files
with
52 additions
and
24 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,30 @@ | ||
package resource | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
) | ||
|
||
type ConcourseMetadata struct { | ||
ATCExternalURL string `json:"atc_external_url"` | ||
BuildID string `json:"build_id"` | ||
BuildJobName string `json:"build_job_name"` | ||
BuildName string `json:"build_name"` | ||
BuildPipelineName string `json:"build_pipeline_name"` | ||
BuildTeamName string `json:"build_team_name"` | ||
BuildURL string `json:"build_url"` | ||
} | ||
|
||
func GetConcourseMetadata() ConcourseMetadata { | ||
buildURL := fmt.Sprintf("%v/teams/%v/pipelines/%v/jobs/%v/builds/%v", | ||
os.Getenv("ATC_EXTERNAL_URL"), os.Getenv("BUILD_TEAM_NAME"), os.Getenv("BUILD_PIPELINE_NAME"), os.Getenv("BUILD_JOB_NAME"), os.Getenv("BUILD_NAME")) | ||
return ConcourseMetadata{ | ||
ATCExternalURL: os.Getenv("ATC_EXTERNAL_URL"), | ||
BuildID: os.Getenv("BUILD_ID"), | ||
BuildJobName: os.Getenv("BUILD_JOB_NAME"), | ||
BuildName: os.Getenv("BUILD_NAME"), | ||
BuildPipelineName: os.Getenv("BUILD_PIPELINE_NAME"), | ||
BuildTeamName: os.Getenv("BUILD_TEAM_NAME"), | ||
BuildURL: buildURL, | ||
} | ||
} |
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