diff --git a/pkg/plugin/env.go b/pkg/plugin/env.go index 634a5f0..127385d 100644 --- a/pkg/plugin/env.go +++ b/pkg/plugin/env.go @@ -35,26 +35,26 @@ const ( BuildActionEnvVar = "DRONE_BUILD_ACTION" // BuildCreatedEnvVar corresponds to Build.Created. BuildCreatedEnvVar = "DRONE_BUILD_CREATED" + // BuildDeployToEnvVar corresponds to Build.DeployTo. + BuildDeployToEnvVar = "DRONE_DEPLOY_TO" // BuildEventEnvVar corresponds to Build.Event. BuildEventEnvVar = "DRONE_BUILD_EVENT" + // BuildFailedStagesEnvVar corresponds to Build.FailedStages. + BuildFailedStagesEnvVar = "DRONE_FAILED_STAGES" + // BuildFailedStepsEnvVar corresponds to Build.FailedSteps. + BuildFailedStepsEnvVar = "DRONE_FAILED_STEPS" // BuildFinishedEnvVar corresponds to Build.Finished. BuildFinishedEnvVar = "DRONE_BUILD_FINISHED" // BuildNumberEnvVar corresponds to Build.Created. BuildNumberEnvVar = "DRONE_BUILD_NUMBER" // BuildParentEnvVar corresponds to Build.Parent. BuildParentEnvVar = "DRONE_BUILD_PARENT" + // BuildPullRequestEnvVar corresponds to Build.PullRequest. + BuildPullRequestEnvVar = "DRONE_PULL_REQUEST" // BuildStartedEnvVar corresponds to Build.Started. BuildStartedEnvVar = "DRONE_BUILD_STARTED" // BuildStatusEnvVar corresponds to Build.Status. BuildStatusEnvVar = "DRONE_BUILD_STATUS" - // BuildDeployToEnvVar corresponds to Build.DeployTo. - BuildDeployToEnvVar = "DRONE_DEPLOY_TO" - // BuildFailedStagesEnvVar corresponds to Build.FailedStages. - BuildFailedStagesEnvVar = "DRONE_FAILED_STAGES" - // BuildFailedStepsEnvVar corresponds to Build.FailedSteps. - BuildFailedStepsEnvVar = "DRONE_FAILED_STEPS" - // BuildPullRequestEnvVar corresponds to Build.PullRequest. - BuildPullRequestEnvVar = "DRONE_PULL_REQUEST" // BuildSourceBranchEnvVar corresponds to Build.SourceBranch. BuildSourceBranchEnvVar = "DRONE_SOURCE_BRANCH" // BuildTagEnvVar corresponds to Build.Tag. diff --git a/pkg/plugin/types.go b/pkg/plugin/types.go index 1a811d5..caabce3 100644 --- a/pkg/plugin/types.go +++ b/pkg/plugin/types.go @@ -34,26 +34,26 @@ type ( Action string // Created time of the build. Created time.Time + // DeployTo the environment. + DeployTo string // Event that triggered the build. Event string + // FailedStages of the build. + FailedStages []string + // FailedSteps of the build. + FailedSteps []string // Finished time of the build. Finished time.Time // Number for the build. Number int // Parent build number for the build. Parent int + // PullRequest number of the build. + PullRequest int // Started time of the build. Started time.Time // Status of the build. Status string - // DeployTo the environment. - DeployTo string - // FailedStages of the build. - FailedStages []string - // FailedSteps of the build. - FailedSteps []string - // PullRequest number of the build. - PullRequest int // SourceBranch for the pull request. SourceBranch string // Tag of the build. @@ -194,17 +194,17 @@ func BuildFromEnv() Build { return Build{ Action: StringEnvVar(BuildActionEnvVar), Created: TimeEnvVar(BuildCreatedEnvVar), + DeployTo: StringEnvVar(BuildDeployToEnvVar), Event: StringEnvVar(BuildEventEnvVar), + FailedStages: StringSliceEnvVar(BuildFailedStagesEnvVar), + FailedSteps: StringSliceEnvVar(BuildFailedStepsEnvVar), Finished: TimeEnvVar(BuildFinishedEnvVar), Number: IntEnvVar(BuildNumberEnvVar), Parent: IntEnvVar(BuildParentEnvVar), - Started: TimeEnvVar(BuildStartedEnvVar), - Status: StringEnvVar(BuildStatusEnvVar), - DeployTo: StringEnvVar(BuildDeployToEnvVar), - FailedStages: StringSliceEnvVar(BuildFailedStagesEnvVar), - FailedSteps: StringSliceEnvVar(BuildFailedStepsEnvVar), PullRequest: IntEnvVar(BuildPullRequestEnvVar), SourceBranch: StringEnvVar(BuildSourceBranchEnvVar), + Started: TimeEnvVar(BuildStartedEnvVar), + Status: StringEnvVar(BuildStatusEnvVar), Tag: StringEnvVar(BuildTagEnvVar), TargetBranch: StringEnvVar(BuildTargetBranchEnvVar), }