drone-plugin-lib/internal/environ/environ.go

169 lines
7.2 KiB
Go
Raw Normal View History

2019-09-06 23:32:54 +00:00
// Copyright (c) 2019, the Drone Plugins project authors.
// Please see the AUTHORS file for details. All rights reserved.
// Use of this source code is governed by an Apache 2.0 license that can be
// found in the LICENSE file.
package environ
2019-09-09 18:06:21 +00:00
2019-09-06 23:32:54 +00:00
// List of enviornment variables set by Drone when running a step within a
// build stage.
//
// Multiple values are specified with `,` within the string. If there are
// multiple values this is to support backward compatibility with versions of
// Drone prior to the 1.0 release.
const (
2019-09-09 21:02:00 +00:00
// The following environment variables are being ignored currently
//
2019-09-09 23:16:32 +00:00
// * DRONE_COMMIT - Redundant with DRONE_COMMIT_SHA
2019-09-09 21:02:00 +00:00
// * DRONE_GIT_HTTP_URL
// * DRONE_GIT_SSH_URL
// * DRONE_REPO_NAMESPACE - Redundant to DRONE_REPO_OWNER
2019-09-09 23:54:52 +00:00
//---------------------------------------------------------------------
// Build Enviornment Variables
//---------------------------------------------------------------------
// BuildActionEnvVar corresponds to Build.Action.
BuildActionEnvVar = "DRONE_BUILD_ACTION"
// BuildCreatedEnvVar corresponds to Build.Created.
BuildCreatedEnvVar = "DRONE_BUILD_CREATED"
2019-09-10 00:03:34 +00:00
// BuildDeployToEnvVar corresponds to Build.DeployTo.
BuildDeployToEnvVar = "DRONE_DEPLOY_TO"
2019-09-09 23:54:52 +00:00
// BuildEventEnvVar corresponds to Build.Event.
BuildEventEnvVar = "DRONE_BUILD_EVENT"
2019-09-10 00:03:34 +00:00
// BuildFailedStagesEnvVar corresponds to Build.FailedStages.
BuildFailedStagesEnvVar = "DRONE_FAILED_STAGES"
// BuildFailedStepsEnvVar corresponds to Build.FailedSteps.
BuildFailedStepsEnvVar = "DRONE_FAILED_STEPS"
2019-09-09 23:54:52 +00:00
// 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"
2019-09-10 00:03:34 +00:00
// BuildPullRequestEnvVar corresponds to Build.PullRequest.
BuildPullRequestEnvVar = "DRONE_PULL_REQUEST"
2019-09-09 23:54:52 +00:00
// BuildStartedEnvVar corresponds to Build.Started.
BuildStartedEnvVar = "DRONE_BUILD_STARTED"
// BuildStatusEnvVar corresponds to Build.Status.
BuildStatusEnvVar = "DRONE_BUILD_STATUS"
// BuildSourceBranchEnvVar corresponds to Build.SourceBranch.
BuildSourceBranchEnvVar = "DRONE_SOURCE_BRANCH"
// BuildTagEnvVar corresponds to Build.Tag.
BuildTagEnvVar = "DRONE_TAG"
// BuildTargetBranchEnvVar corresponds to Build.TargetBranch.
BuildTargetBranchEnvVar = "DRONE_TARGET_BRANCH"
2019-09-09 21:02:00 +00:00
//---------------------------------------------------------------------
// Repo Enviornment Variables
//---------------------------------------------------------------------
// RepoDefaultBranchEnvVar corresponds to Repo.DefaultBranch.
RepoDefaultBranchEnvVar = "DRONE_REPO_BRANCH"
// RepoFullNameEnvVar corresponds to Repo.FullName.
RepoFullNameEnvVar = "DRONE_REPO"
// RepoLinkEnvVar corresponds to Repo.Link.
RepoLinkEnvVar = "DRONE_REPO_LINK"
// RepoNameEnvVar corresponds to Repo.Name
RepoNameEnvVar = "DRONE_REPO_NAME"
// RepoOwnerEnvVar corresponds to Repo.Owner.
RepoOwnerEnvVar = "DRONE_REPO_OWNER"
// RepoPrivateEnvVar corresponds to Repo.Private.
RepoPrivateEnvVar = "DRONE_REPO_PRIVATE"
// RepoRemoteURLEnvVar corresponds to Repo.RemoteURL.
RepoRemoteURLEnvVar = "DRONE_REMOTE_URL"
// RepoSCMEnvVar corresponds to Repo.SCM.
RepoSCMEnvVar = "DRONE_REPO_SCM"
// RepoVisibilityEnvVar corresponds to Repo.Visbility.
RepoVisibilityEnvVar = "DRONE_REPO_VISIBILITY"
2019-09-09 23:16:32 +00:00
//---------------------------------------------------------------------
// Commit Enviornment Variables
//---------------------------------------------------------------------
// CommitAfterEnvVar corresponds to Commit.After.
CommitAfterEnvVar = "DRONE_COMMIT_AFTER"
// CommitAuthorEnvVar corresponds to Commit.Author.
CommitAuthorEnvVar = "DRONE_COMMIT_AUTHOR"
// CommitAuthorAvatarEnvVar corresponds to Commit.AuthorAvatar.
CommitAuthorAvatarEnvVar = "DRONE_COMMIT_AUTHOR_AVATAR"
// CommitAuthorEmailEnvVar corresponds to Commit.AuthorEmail.
CommitAuthorEmailEnvVar = "DRONE_COMMIT_AUTHOR_EMAIL"
// CommitAuthorNameEnvVar corresponds to Commit.AuthorName.
CommitAuthorNameEnvVar = "DRONE_COMMIT_AUTHOR_NAME"
// CommitBeforeEnvVar corresponds to Commit.Before.
CommitBeforeEnvVar = "DRONE_COMMIT_BEFORE"
// CommitBranchEnvVar corresponds to Commit.Branch.
CommitBranchEnvVar = "DRONE_COMMIT_BRANCH"
// CommitLinkEnvVar corresponds to Commit.Link.
CommitLinkEnvVar = "DRONE_COMMIT_LINK"
// CommitMessageEnvVar corresponds to Commit.Message.
CommitMessageEnvVar = "DRONE_COMMIT_MESSAGE"
// CommitRefEnvVar corresponds to Commit.Ref.
CommitRefEnvVar = "DRONE_COMMIT_REF"
// CommitSHAEnvVar corresponds to Commit.SHA.
CommitSHAEnvVar = "DRONE_COMMIT_SHA"
2019-09-07 00:13:04 +00:00
//---------------------------------------------------------------------
// Stage Enviornment Variables
//---------------------------------------------------------------------
// StageArchEnvVar corresponds to Stage.Arch.
StageArchEnvVar = "DRONE_STAGE_ARCH"
// StageDependsOnEnvVar corresponds to Stage.DependsOn.
StageDependsOnEnvVar = "DRONE_STAGE_DEPENDS_ON"
// StageFinishedEnvVar corresponds to Stage.Finished.
StageFinishedEnvVar = "DRONE_STAGE_FINISHED"
// StageKindEnvVar corresponds Stage.Kind.
StageKindEnvVar = "DRONE_STAGE_KIND"
// StageMachineEnvVar corresponds to Stage.Machine.
StageMachineEnvVar = "DRONE_STAGE_MACHINE"
// StageNameEnvVar corresponds to Stage.Name.
StageNameEnvVar = "DRONE_STAGE_NAME"
// StageNumberEnvVar corresponds to Stage.Number.
StageNumberEnvVar = "DRONE_STAGE_NUMBER"
// StageOSEnvVar corresponds to Stage.OS.
StageOSEnvVar = "DRONE_STAGE_OS"
// StageStartedEnvVar corresponds to Stage.Started.
StageStartedEnvVar = "DRONE_STAGE_STARTED"
// StageStatusEnvVar corresponds to Stage.Status.
StageStatusEnvVar = "DRONE_STAGE_STATUS"
// StageTypeEnvVar corresponds to Stage.Type.
StageTypeEnvVar = "DRONE_STAGE_TYPE"
// StageVariantEnvVar corresponds to Stage.Variant.
StageVariantEnvVar = "DRONE_STAGE_VARIANT"
// StageVersionEnvVar corresponds to Stage.Version.
StageVersionEnvVar = "DRONE_STAGE_VERSION"
//---------------------------------------------------------------------
// Step Environment Variables
//---------------------------------------------------------------------
// StepNameEnvVar corresponds to Step.Name.
2019-09-06 23:32:54 +00:00
StepNameEnvVar = "DRONE_STEP_NAME"
2019-09-07 00:13:04 +00:00
// StepNumberEnvVar corresponds to Step.Number.
2019-09-06 23:32:54 +00:00
StepNumberEnvVar = "DRONE_STEP_NUMBER"
2019-09-09 21:26:56 +00:00
//---------------------------------------------------------------------
// SemVer Variables
//---------------------------------------------------------------------
// SemVerBuildEnvVar corresponds to SemVer.Build.
SemVerBuildEnvVar = "DRONE_SEMVER_BUILD"
// SemVerErrorEnvVar corresponds to SemVer.Error.
SemVerErrorEnvVar = "DRONE_SEMVER_ERROR"
// SemVerMajorEnvVar corresponds to SemVer.Major.
SemVerMajorEnvVar = "DRONE_SEMVER_MAJOR"
// SemVerMinorEnvVar corresponds to SemVer.Minor.
SemVerMinorEnvVar = "DRONE_SEMVER_MINOR"
// SemVerPatchEnvVar corresponds to SemVer.Patch.
SemVerPatchEnvVar = "DRONE_SEMVER_PATCH"
// SemVerPrereleaseEnvVar corresponds to SemVer.Prerelease
SemVerPrereleaseEnvVar = "DRONE_SEMVER_PRERELEASE"
// SemVerShortEnvVar corresponds to SemVer.Short.
SemVerShortEnvVar = "DRONE_SEMVER_SHORT"
// SemVerVersionEnvVar corresponds to SemVer.Version
SemVerVersionEnvVar = "DRONE_SEMVER"
2019-09-06 23:32:54 +00:00
)