Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added basic support for bitbuckets piplines CI #1248

Merged
merged 1 commit into from
May 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/app/FakeLib/BitbucketPipelines.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/// Contains code to configure FAKE for Bitbucket Pipelines integration
module Fake.BitbucketPipelines

/// Bitbucket Pipelines environment variables as [described](https://confluence.atlassian.com/bitbucket/environment-variables-in-bitbucket-pipelines-794502608.html)
type BitbucketPipelinesEnvironment =

/// The commit hash of a commit that kicked off the build
static member Commit = environVar "BITBUCKET_COMMIT"

/// The branch on which the build was kicked off. This value is only available on branches.
static member Branch = environVar "BITBUCKET_BRANCH"

/// The tag of a commit that kicked off the build. This value is only available on tags.
static member Tag = environVar "BITBUCKET_TAG"

/// The URL-friendly version of a repository name.
static member RepoSlug = environVar "BITBUCKET_REPO_SLUG"

/// The name of the account in which the repository lives
static member RepoOwner = environVar "BITBUCKET_REPO_OWNER"

3 changes: 3 additions & 0 deletions src/app/FakeLib/BuildServerHelper.fs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ type BuildServer =
| AppVeyor
| GitLabCI
| Bamboo
| BitbucketPipelines
| LocalBuild

/// The trace mode option.
Expand Down Expand Up @@ -88,6 +89,7 @@ let buildServer =
elif isGitlabCI then GitLabCI
elif isTFBuild then TeamFoundation
elif isBambooBuild then Bamboo
elif hasBuildParam "BITBUCKET_COMMIT" then BitbucketPipelines
else LocalBuild

/// The current build version as detected from the current build server.
Expand All @@ -103,6 +105,7 @@ let buildVersion =
| TeamFoundation -> getVersion tfBuildNumber
| Bamboo -> getVersion bambooBuildNumber
| LocalBuild -> getVersion localBuildLabel
| BitbucketPipelines -> getVersion ""

/// Is true when the current build is a local build.
let isLocalBuild = LocalBuild = buildServer
1 change: 1 addition & 0 deletions src/app/FakeLib/FakeLib.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
<Compile Include="ProcessHelper.fs" />
<Compile Include="NpmHelper.fs" />
<Compile Include="AppVeyor.fs" />
<Compile Include="BitbucketPipelines.fs" />
<Compile Include="TaskRunnerHelper.fs" />
<Compile Include="Globbing\Globbing.fs" />
<Compile Include="Globbing\FileSystem.fs" />
Expand Down