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

Release 5.4.0 #2056

Merged
merged 16 commits into from
Aug 11, 2018
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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: csharp
sudo: required
dist: trusty # Ubuntu 14.04
dotnet : 2.1.300
dotnet : 2.1.302
env:
- HOME=/home/travis APPDATA=/home/travis LocalAppData=/home/travis

Expand Down
8 changes: 8 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Release Notes

## 5.4.0 - 2018-08-11

* ENHANCEMENT: Template always uses latest version now - https://github.com/fsharp/FAKE/pull/2055
* ENHANCEMENT: Add all GITLAB environment variables - https://github.com/fsharp/FAKE/pull/2059
* ENHANCEMENT: Support naming of artifacts in TFS/VSTS - https://github.com/fsharp/FAKE/pull/2056
* BUGFIX: Use UTF8 without BOM by default - https://github.com/fsharp/FAKE/issues/2032
* BUGFIX: Improve error message when starting dotnet-cli with incorrect working directory - https://github.com/fsharp/FAKE/issues/2046

## 5.3.1 - 2018-08-06

* BUGFIX: Minor code improvements - https://github.com/fsharp/FAKE/pull/2045
Expand Down
23 changes: 2 additions & 21 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ Trace.setBuildNumber nugetVersion
// CoreTracing.setTraceListeners (CoreTracing.defaultConsoleTraceListener :: current)


let dotnetSdk = lazy DotNet.install DotNet.Versions.Release_2_1_300
let dotnetSdk = lazy DotNet.install DotNet.Versions.Release_2_1_302
let inline dtntWorkDir wd =
DotNet.Options.lift dotnetSdk.Value
>> DotNet.Options.withWorkingDirectory wd
Expand Down Expand Up @@ -694,17 +694,6 @@ Target.create "_DotNetPackage" (fun _ ->
Environment.setEnvironVar "PackageProjectUrl" "https://github.com/fsharp/Fake"
Environment.setEnvironVar "PackageLicenseUrl" "https://github.com/fsharp/FAKE/blob/d86e9b5b8e7ebbb5a3d81c08d2e59518cf9d6da9/License.txt"

// Update template
let templateFromVersion, templateToVersion = """"defaultValue": "5.*",""", sprintf """"defaultValue": "%s",""" nugetVersion
let templateConfigFile = "src/template/fake-template/Content/.template.config/template.json"
let replaceInTemplate fromDefault toDefault =
[ templateConfigFile ]
|> Shell.replaceInFiles [ fromDefault, toDefault ]
let configContents = File.ReadAllText(templateConfigFile)
if not <| configContents.Contains templateFromVersion then
failwithf "Make sure to revert your changes in '%s' or update the build script accordingly" templateConfigFile
replaceInTemplate templateFromVersion templateToVersion

// dotnet pack
DotNet.pack (fun c ->
{ c with
Expand All @@ -716,9 +705,6 @@ Target.create "_DotNetPackage" (fun _ ->
else c.Common
} |> dtntSmpl) "Fake.sln"

// Revert template
replaceInTemplate templateToVersion templateFromVersion

// TODO: Check if we run the test in the current build!
Directory.ensure "temp"
let testZip = "temp/tests.zip"
Expand Down Expand Up @@ -809,16 +795,11 @@ Target.create "CheckReleaseSecrets" (fun _ ->


Target.create "DotNetCoreCreateDebianPackage" (fun _ ->
DotNet.restore (fun opt ->
{ opt with
Common = { opt.Common with WorkingDirectory = "src/app/fake-cli/" } |> dtntSmpl
Runtime = Some "linux-x64"}) "fake-cli.fsproj"

let runtime = "linux-x64"
let targetFramework = "netcoreapp2.1"
let args =
[
sprintf "/t:%s" "CreateDeb"
sprintf "/t:%s" "Restore;CreateDeb"
sprintf "/p:TargetFramework=%s" targetFramework
sprintf "/p:CustomTarget=%s" "CreateDeb"
sprintf "/p:RuntimeIdentifier=%s" runtime
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk" : {
"version": "2.1.300"
"version": "2.1.302"
}
}
2 changes: 1 addition & 1 deletion help/markdown/buildserver.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ Target.create "Test" (fun _ ->

## Implementing support for a build-server

Please look at the existing implementations.
Please look at the existing implementations. Please contribute new implementations to the repository. Some changes like adding new cases to the `TraceListener` module are not considered breaking changes. Using these types (using `match` on these types to be exact) outside the fake repository is not considered good practice.
2 changes: 1 addition & 1 deletion help/markdown/dotnet-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ nuget Fake.DotNet.Cli //"
open Fake.DotNet

// Lazily install DotNet SDK in the correct version if not available
let install = lazy DotNet.Install DotNet.Release_2_1_4
let install = lazy DotNet.install DotNet.Versions.Release_2_1_4

// Define general properties across various commands (with arguments)
let inline withWorkDir wd =
Expand Down
8 changes: 6 additions & 2 deletions help/markdown/fake-dotnetcore.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Just install the corresponding package for your system:

<pre>
<code class="lang-bash">
choco install fake -pre
choco install fake
</code>
</pre>

Expand All @@ -35,10 +35,14 @@ Just install the corresponding package for your system:

<pre>
<code class="lang-bash">
dotnet tool install fake-cli -g --version=5.*
dotnet tool install fake-cli -g
</code>
</pre>

- Debian package

- the .deb file can be downloaded from the [releases-page](https://github.com/fsharp/FAKE/releases)

- Others

We currently do not have packages for the various distributions, look for [other ways to install fake](fake-gettingstarted.html#Install-FAKE).
Expand Down
2 changes: 2 additions & 0 deletions src/app/Fake.BuildServer.AppVeyor/AppVeyor.fs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ module AppVeyorImportExtensions =
type ImportData with
member x.AppVeyorName =
match x with
| ImportData.BuildArtifactWithName _
| ImportData.BuildArtifact -> "buildArtifact"
| ImportData.DotNetCoverage _ -> "dotNetCoverage"
| ImportData.DotNetDupFinder -> "DotNetDupFinder"
Expand Down Expand Up @@ -292,6 +293,7 @@ module AppVeyor =
AppVeyorInternal.UploadTestResultsFile AppVeyorInternal.TestResultsType.Xunit path
| TraceData.ImportData (ImportData.Junit, path) ->
AppVeyorInternal.UploadTestResultsFile AppVeyorInternal.TestResultsType.JUnit path
| TraceData.ImportData (ImportData.BuildArtifactWithName _, path)
| TraceData.ImportData (ImportData.BuildArtifact, path) ->
AppVeyorInternal.PushArtifact (fun parms -> { parms with Path = path; FileName = Path.GetFileName path })
| TraceData.ImportData (typ, path) ->
Expand Down
122 changes: 121 additions & 1 deletion src/app/Fake.BuildServer.GitLab/GitLab.fs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module GitLabImportExtensions =
type ImportData with
member x.GitLabName =
match x with
| ImportData.BuildArtifactWithName _
| ImportData.BuildArtifact -> "buildArtifact"
| ImportData.DotNetCoverage _ -> "dotNetCoverage"
| ImportData.DotNetDupFinder -> "DotNetDupFinder"
Expand All @@ -39,10 +40,129 @@ module GitLabImportExtensions =
[<RequireQualifiedAccess>]
module GitLab =

/// https://docs.gitlab.com/ee/ci/variables/
type Environment =
static member CommitSha = Environment.environVar "CI_COMMIT_SHA"

/// The branch or tag name for which project is built
static member CommitRefName = Environment.environVar "CI_COMMIT_REF_NAME"
/// $CI_COMMIT_REF_NAME lowercased, shortened to 63 bytes, and with everything except 0-9 and a-z replaced with -.
/// No leading / trailing -.
/// Use in URLs, host names and domain names.
static member CommitRefSlug = Environment.environVar "CI_COMMIT_REF_SLUG"
/// The commit revision for which project is built
static member CommitSha = Environment.environVar "CI_COMMIT_SHA"
/// The previous latest commit present on a branch before a push request.
static member CommitBeforeSha = Environment.environVar "CI_COMMIT_BEFORE_SHA"
/// The commit tag name. Present only when building tags.
static member CommitTag = Environment.environVar "CI_COMMIT_TAG"
/// The full commit message.
static member CommitMessage = Environment.environVar "CI_COMMIT_MESSAGE"
/// The title of the commit - the full first line of the message
static member CommitTitle = Environment.environVar "CI_COMMIT_TITLE"
/// The description of the commit: the message without first line, if the title is shorter than 100 characters; full message in other case.
static member CommitDescription = Environment.environVar "CI_COMMIT_DESCRIPTION"
/// The path to CI config file. Defaults to .gitlab-ci.yml
static member ConfigPath = Environment.environVar "CI_CONFIG_PATH"
/// Whether debug tracing is enabled
static member DebugTrace = Environment.hasEnvironVar "CI_DEBUG_TRACE"
/// Authentication username of the GitLab Deploy Token, only present if the Project has one related.
static member DeployUser = Environment.environVar "CI_DEPLOY_USER"
/// Authentication password of the GitLab Deploy Token, only present if the Project has one related.
static member DeployPassword = Environment.environVar "CI_DEPLOY_PASSWORD"
/// Marks that the job is executed in a disposable environment (something that is created only for this job and disposed of/destroyed after the execution - all executors except shell and ssh). If the environment is disposable, it is set to true, otherwise it is not defined at all.
static member DisposableEnvironment = Environment.hasEnvironVar "CI_DISPOSABLE_ENVIRONMENT"
/// The name of the environment for this job
static member EnvironmentName = Environment.environVar "CI_ENVIRONMENT_NAME"
/// A simplified version of the environment name, suitable for inclusion in DNS, URLs, Kubernetes labels, etc.
static member EnvironmentSlug = Environment.environVar "CI_ENVIRONMENT_SLUG"
/// The URL of the environment for this job
static member EnvironmentUrl = Environment.environVar "CI_ENVIRONMENT_URL"
/// The unique id of the current job that GitLab CI uses internally
static member JobId = Environment.environVar "CI_JOB_ID"
/// The flag to indicate that job was manually started
static member JobManual = Environment.environVar "CI_JOB_MANUAL"
/// The name of the job as defined in .gitlab-ci.yml
static member JobName = Environment.environVar "CI_JOB_NAME"
/// The name of the stage as defined in .gitlab-ci.yml
static member JobStage = Environment.environVar "CI_JOB_STAGE"
/// Token used for authenticating with GitLab Container Registry, downloading dependent repositories, authenticate with multi-project pipelines when triggers are involved, and for downloading job artifacts
static member JobToken = Environment.environVar "CI_JOB_TOKEN"
/// Job details URL
static member JobUrl = Environment.environVar "CI_JOB_URL"
/// The URL to clone the Git repository
static member RepositoryUrl = Environment.environVar "CI_REPOSITORY_URL"
/// The description of the runner as saved in GitLab
static member RunnerDescription = Environment.environVar "CI_RUNNER_DESCRIPTION"
/// The unique id of runner being used
static member RunnerId = Environment.environVar "CI_RUNNER_ID"
/// The defined runner tags
static member RunnerTags = Environment.environVar "CI_RUNNER_TAGS"
/// GitLab Runner version that is executing the current job
static member RunnerVersion = Environment.environVar "CI_RUNNER_VERSION"
/// GitLab Runner revision that is executing the current job
static member RunnerRevision = Environment.environVar "CI_RUNNER_REVISION"
/// The OS/architecture of the GitLab Runner executable (note that this is not necessarily the same as the environment of the executor)
static member RunnerExecutableArch = Environment.environVar "CI_RUNNER_EXECUTABLE_ARCH"
/// The unique id of the current pipeline that GitLab CI uses internally
static member PipelineId = Environment.environVar "CI_PIPELINE_ID"
/// The unique id of the current pipeline scoped to project
static member PipelineIID = Environment.environVar "CI_PIPELINE_IID"
/// The flag to indicate that job was triggered
static member PipelineTriggered = Environment.hasEnvironVar "CI_PIPELINE_TRIGGERED"
/// Indicates how the pipeline was triggered. Possible options are: push, web, trigger, schedule, api, and pipeline. For pipelines created before GitLab 9.5, this will show as unknown
static member PipelineSource = Environment.environVar "CI_PIPELINE_SOURCE"
/// The full path where the repository is cloned and where the job is run
static member ProjectDir = Environment.environVar "CI_PROJECT_DIR"
/// The unique id of the current project that GitLab CI uses internally
static member ProjectId = Environment.environVar "CI_PROJECT_ID"
/// The project name that is currently being built (actually it is project folder name)
static member ProjectName = Environment.environVar "CI_PROJECT_NAME"
/// The project namespace (username or groupname) that is currently being built
static member ProjectNamespace = Environment.environVar "CI_PROJECT_NAMESPACE"
/// The namespace with project name
static member ProjectPath = Environment.environVar "CI_PROJECT_PATH"
/// $CI_PROJECT_PATH lowercased and with everything except 0-9 and a-z replaced with -. Use in URLs and domain names.
static member ProjectPathSlug = Environment.environVar "CI_PROJECT_PATH_SLUG"
/// Pipeline details URL
static member PipelineUrl = Environment.environVar "CI_PIPELINE_URL"
/// The HTTP address to access project
static member ProjectUrl = Environment.environVar "CI_PROJECT_URL"
/// The project visibility (internal, private, public)
static member ProjectVisibility = Environment.environVar "CI_PROJECT_VISIBILITY"
/// If the Container Registry is enabled it returns the address of GitLab's Container Registry
static member Registry = Environment.environVar "CI_REGISTRY"
/// If the Container Registry is enabled for the project it returns the address of the registry tied to the specific project
static member RegistryImage = Environment.environVar "CI_REGISTRY_IMAGE"
/// The password to use to push containers to the GitLab Container Registry
static member RegistryPassword = Environment.environVar "CI_REGISTRY_PASSWORD"
/// The username to use to push containers to the GitLab Container Registry
static member RegistryUser = Environment.environVar "CI_REGISTRY_USER"
/// Mark that job is executed in CI environment
static member Server = Environment.hasEnvironVar "CI_SERVER"
/// The name of CI server that is used to coordinate jobs
static member ServerName = Environment.environVar "CI_SERVER_NAME"
/// GitLab revision that is used to schedule jobs
static member ServerRevision = Environment.environVar "CI_SERVER_REVISION"
/// GitLab version that is used to schedule jobs
static member ServerVersion = Environment.environVar "CI_SERVER_VERSION"
/// Marks that the job is executed in a shared environment (something that is persisted across CI invocations like shell or ssh executor). If the environment is shared, it is set to true, otherwise it is not defined at all.
static member SharedEnvironment = Environment.hasEnvironVar "CI_SHARED_ENVIRONMENT"
/// Number of attempts to fetch sources running a job
static member GetSourcesAttempts = Environment.environVar "GET_SOURCES_ATTEMPTS"
/// Mark that job is executed in GitLab CI environment
static member GitlabCI = Environment.environVar "GITLAB_CI"
/// The email of the user who started the job
static member GitlabUserEmail = Environment.environVar "GITLAB_USER_EMAIL"
/// The id of the user who started the job
static member GitlabUserId = Environment.environVar "GITLAB_USER_ID"
/// The login username of the user who started the job
static member GitlabUserLogin = Environment.environVar "GITLAB_USER_LOGIN"
/// The real name of the user who started the job
static member GitlabUserName = Environment.environVar "GITLAB_USER_NAME"
/// The comma separated list of licensed features available for your instance and plan
static member GitlabFeatures = Environment.environVar "GITLAB_FEATURES"
/// Number of attempts to restore the cache running a job
static member RestoreCacheAttempts = Environment.environVar "RESTORE_CACHE_ATTEMPTS"

/// Implements a TraceListener for TeamCity build servers.
/// ## Parameters
Expand Down
2 changes: 2 additions & 0 deletions src/app/Fake.BuildServer.TeamCity/TeamCity.fs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module TeamCityImportExtensions =
type ImportData with
member x.TeamCityName =
match x with
| ImportData.BuildArtifactWithName _
| ImportData.BuildArtifact -> "buildArtifact"
| ImportData.DotNetCoverage _ -> "dotNetCoverage"
| ImportData.DotNetDupFinder -> "DotNetDupFinder"
Expand Down Expand Up @@ -275,6 +276,7 @@ module TeamCity =
ConsoleWriter.write false color true text
| TraceData.LogMessage(text, newLine) | TraceData.TraceMessage(text, newLine) ->
ConsoleWriter.write false color newLine text
| TraceData.ImportData (ImportData.BuildArtifactWithName _, path)
| TraceData.ImportData (ImportData.BuildArtifact, path) ->
publishArtifact path
| TraceData.ImportData (ImportData.DotNetCoverage tool, path) ->
Expand Down
2 changes: 2 additions & 0 deletions src/app/Fake.BuildServer.TeamFoundation/TeamFoundation.fs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ module TeamFoundation =
| TagStatus.Warning -> "SucceededWithIssues", "WARN"
| TagStatus.Failed -> "Failed", "ERROR"
setBuildState vsoState msg
| TraceData.ImportData (ImportData.BuildArtifactWithName name as typ, path) ->
publishArtifact typ.Name (Some name) path
| TraceData.ImportData (typ, path) ->
publishArtifact typ.Name (Some "fake-artifacts") path
| TraceData.TestOutput (test, out, err) ->
Expand Down
6 changes: 4 additions & 2 deletions src/app/Fake.Core.Process/Process.fs
Original file line number Diff line number Diff line change
Expand Up @@ -428,9 +428,11 @@ module Process =

//platformInfoAction proc.StartInfo
if String.isNullOrEmpty proc.StartInfo.WorkingDirectory |> not then
if Directory.Exists proc.StartInfo.WorkingDirectory |> not then
failwithf "Start of process %s failed. WorkingDir %s does not exist." proc.StartInfo.FileName
if Directory.Exists proc.StartInfo.WorkingDirectory |> not then
sprintf "Start of process '%s' failed. WorkingDir '%s' does not exist." proc.StartInfo.FileName
proc.StartInfo.WorkingDirectory
|> DirectoryNotFoundException
|> raise
if silent then
proc.StartInfo.RedirectStandardOutput <- true
proc.StartInfo.RedirectStandardError <- true
Expand Down
Loading