Skip to content

Commit

Permalink
Merge pull request #1248 from TWith2Sugars/bitbucket-pipeline
Browse files Browse the repository at this point in the history
Added basic support for bitbuckets piplines CI
  • Loading branch information
forki committed May 30, 2016
2 parents 47b7a16 + b6a408b commit 5d66bb5
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
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

0 comments on commit 5d66bb5

Please sign in to comment.