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.5.0 #2068

Merged
merged 19 commits into from
Aug 26, 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
32 changes: 31 additions & 1 deletion Fake.sln
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,11 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.UserInput", "src\
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.Testing.VSTest", "src\app\Fake.DotNet.Testing.VSTest\Fake.DotNet.Testing.VSTest.fsproj", "{C4C9D7EE-6A52-42F1-9E04-7C44F0EA8922}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Fake.Tools.Rsync", "src\app\Fake.Tools.Rsync\Fake.Tools.Rsync.fsproj", "{26367457-80C0-44C9-9020-56F4013C13E1}"
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Tools.Rsync", "src\app\Fake.Tools.Rsync\Fake.Tools.Rsync.fsproj", "{26367457-80C0-44C9-9020-56F4013C13E1}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Tools.Octo", "src\app\Fake.Tools.Octo\Fake.Tools.Octo.fsproj", "{F1641150-B89D-40B7-A3BE-9DC357410FDA}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.Vault", "src\app\Fake.Core.Vault\Fake.Core.Vault.fsproj", "{AAAF92C5-C40D-40B8-84BA-137DF0E98B56}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -1014,6 +1018,30 @@ Global
{26367457-80C0-44C9-9020-56F4013C13E1}.Release|x64.Build.0 = Release|Any CPU
{26367457-80C0-44C9-9020-56F4013C13E1}.Release|x86.ActiveCfg = Release|Any CPU
{26367457-80C0-44C9-9020-56F4013C13E1}.Release|x86.Build.0 = Release|Any CPU
{F1641150-B89D-40B7-A3BE-9DC357410FDA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F1641150-B89D-40B7-A3BE-9DC357410FDA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F1641150-B89D-40B7-A3BE-9DC357410FDA}.Debug|x64.ActiveCfg = Debug|Any CPU
{F1641150-B89D-40B7-A3BE-9DC357410FDA}.Debug|x64.Build.0 = Debug|Any CPU
{F1641150-B89D-40B7-A3BE-9DC357410FDA}.Debug|x86.ActiveCfg = Debug|Any CPU
{F1641150-B89D-40B7-A3BE-9DC357410FDA}.Debug|x86.Build.0 = Debug|Any CPU
{F1641150-B89D-40B7-A3BE-9DC357410FDA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F1641150-B89D-40B7-A3BE-9DC357410FDA}.Release|Any CPU.Build.0 = Release|Any CPU
{F1641150-B89D-40B7-A3BE-9DC357410FDA}.Release|x64.ActiveCfg = Release|Any CPU
{F1641150-B89D-40B7-A3BE-9DC357410FDA}.Release|x64.Build.0 = Release|Any CPU
{F1641150-B89D-40B7-A3BE-9DC357410FDA}.Release|x86.ActiveCfg = Release|Any CPU
{F1641150-B89D-40B7-A3BE-9DC357410FDA}.Release|x86.Build.0 = Release|Any CPU
{AAAF92C5-C40D-40B8-84BA-137DF0E98B56}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AAAF92C5-C40D-40B8-84BA-137DF0E98B56}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AAAF92C5-C40D-40B8-84BA-137DF0E98B56}.Debug|x64.ActiveCfg = Debug|Any CPU
{AAAF92C5-C40D-40B8-84BA-137DF0E98B56}.Debug|x64.Build.0 = Debug|Any CPU
{AAAF92C5-C40D-40B8-84BA-137DF0E98B56}.Debug|x86.ActiveCfg = Debug|Any CPU
{AAAF92C5-C40D-40B8-84BA-137DF0E98B56}.Debug|x86.Build.0 = Debug|Any CPU
{AAAF92C5-C40D-40B8-84BA-137DF0E98B56}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AAAF92C5-C40D-40B8-84BA-137DF0E98B56}.Release|Any CPU.Build.0 = Release|Any CPU
{AAAF92C5-C40D-40B8-84BA-137DF0E98B56}.Release|x64.ActiveCfg = Release|Any CPU
{AAAF92C5-C40D-40B8-84BA-137DF0E98B56}.Release|x64.Build.0 = Release|Any CPU
{AAAF92C5-C40D-40B8-84BA-137DF0E98B56}.Release|x86.ActiveCfg = Release|Any CPU
{AAAF92C5-C40D-40B8-84BA-137DF0E98B56}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -1091,6 +1119,8 @@ Global
{3B0A5EE3-6696-4EBA-BCF9-8136C7F17040} = {7BFFAE76-DEE9-417A-A79B-6A6644C4553A}
{C4C9D7EE-6A52-42F1-9E04-7C44F0EA8922} = {7BFFAE76-DEE9-417A-A79B-6A6644C4553A}
{26367457-80C0-44C9-9020-56F4013C13E1} = {901F162F-8925-4390-89C5-9EE2C343F744}
{F1641150-B89D-40B7-A3BE-9DC357410FDA} = {7BFFAE76-DEE9-417A-A79B-6A6644C4553A}
{AAAF92C5-C40D-40B8-84BA-137DF0E98B56} = {901F162F-8925-4390-89C5-9EE2C343F744}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {058A0C5E-2216-4306-8AFB-0AE28320C26A}
Expand Down
7 changes: 7 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Release Notes

## 5.5.0 - 2018-08-26

* DOCS: Update core-targets.md - https://github.com/fsharp/FAKE/pull/2067
* NEW: module Fake.Tools.Octo to use Octopus Deploy - https://github.com/fsharp/FAKE/pull/2048
* NEW: module Fake.Core.Vault to store secrets - https://github.com/fsharp/FAKE/pull/2068/commits/929ec55bcb05b0d9ece0066c4d2c4f0ad2bce783
* ENHANCEMENT: Fake.BuildServer.TeamFoundation now supports secret variables - https://github.com/isaacabraham/vsts-fsharp/pull/16

## 5.4.1 - 2018-08-16

* BUGFIX: Support naming of artifacts in TFS/VSTS - https://github.com/fsharp/FAKE/pull/2060
Expand Down
2 changes: 2 additions & 0 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ let dotnetAssemblyInfos =
"Fake.Core.Tasks", "Repeating and managing Tasks"
"Fake.Core.Trace", "Core Logging functionality"
"Fake.Core.UserInput", "User input helpers"
"Fake.Core.Vault", "Encrypt secrets and prevent accidental disclosure"
"Fake.Core.Xml", "Core Xml functionality"
"Fake.Documentation.DocFx", "Documentation with DocFx"
"Fake.DotNet.AssemblyInfoFile", "Writing AssemblyInfo files"
Expand Down Expand Up @@ -277,6 +278,7 @@ let dotnetAssemblyInfos =
"Fake.Testing.SonarQube", "Analyzing your project with SonarQube"
"Fake.Tools.Git", "Running git commands"
"Fake.Tools.GitVersion", "GitVersion helper"
"Fake.Tools.Octo", "Octopus Deploy octo.exe tool helper"
"Fake.Tools.Pickles", "Convert Gherkin to HTML"
"Fake.Tools.Rsync", "Running Rsync commands"
"Fake.Tracing.NAntXml", "NAntXml"
Expand Down
2 changes: 1 addition & 1 deletion help/markdown/core-targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ Target.create "Build" (fun _ ->
Trace.trace " --- Building the app --- "
)

Target.create "Rebuild" Target.DoNothing
Target.create "Rebuild" ignore

// *** Define Dependencies ***
"Build" ==> "Rebuild"
Expand Down
56 changes: 56 additions & 0 deletions help/markdown/core-vault.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Fake.Core.Vault module

[API-Reference](apidocs/v5/fake-core-vault.html)

## Goals and non-goals

The FAKE-Vault works similar to secret variables in VSTS (in fact they were added to better support VSTS).

Context:

* [VSTS secrets as environment variables](https://stackoverflow.com/questions/50110315/vsts-secrets-as-environment-variables/50113557#50113557)
* [Secret variables are not secure](https://github.com/Microsoft/vsts-tasks/issues/4284#issuecomment-300354042)

Goals:

* Prevent accidental leakage
* Hide from environment variable listing
* Hide from process snapshots

Non-Goals:

* Complete fool-proof implementation
* Hiding variables from build script writers

## API Usage

In order to get variables into FAKE you need to encrypt them via AES. When in doubt consult the source code of `Vault.encryptVariable` or look at the `myVault.ts` implementation of the [vsts fake 5 task](https://github.com/isaacabraham/vsts-fsharp).

You need to create a json in the following format:

```json
{ "keyFile": "<Path to file of the 32 byte key, encoded as base64 and saved in utf8>",
"iv": "<base64 string of the 16 byte IV>",
"values": [
{ "secret": true,
"value": "<the raw value or the aes encrypted base64 string value when 'secret' is true>",
"name": "<name>" }
] }
```

And save it in a environment variable `FAKE_VAULT_VARIABLES` for example.

```fsharp

#r "paket:
nuget Fake.Core.Vault //"
open Fake.Core
let vault = Vault.fromFakeEnvironmentVariable()

let usage1 = vault |> Vault.get "my variable"
let usage2 = vault.Get "my other variable"
let tryUsage1 = vault |> Vault.tryGet "my variable"
let tryUsage2 = vault.TryGet "my other variable"
```

You can reference [`Fake.Core.Vault`](https://www.nuget.org/packages/Fake.Core.Vault/) in your regular project and use `Vault.encryptVariable` to simplify the creation of the json.
93 changes: 93 additions & 0 deletions help/markdown/fake-tools-octo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Automating Deployment using FAKE and Octopus Deploy

<div class="alert alert-info">
<h5>INFO</h5>
<p>This documentation is for FAKE version 5.0 or later. The old documentation can be found <a href="apidocs/v4/fake-octotools.html">here</a></p>
</div>

[Octopus Deploy](http://octopusdeploy.com/) is a great tool for simple and user-friendly release management.

[API-Reference](apidocs/v5/fake-tools-octo.html)

## Installing Octopus Deploy

You can try the cloud version of Octopus [here](https://octopus.com/cloud). Otherwise you can download it from [http://octopusdeploy.com/downloads](http://octopusdeploy.com/downloads) - and then start a [free trial](https://octopus.com/trial). Then follow the [Installation Instructions](http://octopusdeploy.com/documentation/install/octopus) to get yourself up and running.

You will also need to install and configure at least one [Tentacle](http://octopusdeploy.com/documentation/install/tentacle) which you will deploy your software and services to.

## Octo.exe CLI tool

This module is a wrapper around the [Octo.exe](https://octopus.com/docs/api-and-integration/octo.exe-command-line) CLI tool which controls Octopus Deploy API. You'll need the Octo.exe tool itself accessible to your FAKE script. Download it from [here](https://octopus.com/downloads).

### Generate an API Key

In order to communicate with the Octopus Deploy API you will need an *API key* to authenticate with.

It is a good idea to create an account in Octopus Deploy for your Continuous Integration systems (eg: [TeamCity](docs/teamcity.html)) - and then generate a new API key for that account, that can be safely used from within your build process.

![My Profile](pics/octopusdeploy/myprofile.png "My Profile")

![Generate API Key](pics/octopusdeploy/apikey.png "Generate API Key")

##Define common options

You can define a function defining shared parameters like `ToolPath` or your Octopus Deploy instance details. Then the function can be used in subsequent `Octo` calls.

```fsharp
open Fake.Tools

let setCommon (ps:Octo.Options) =
{
ps with ToolPath = "path to your octo.exe"
Server = {
ServerUrl = "Your Octopus Server URL"
ApiKey = "Your API key"
}
}
```

## Push a package

Packages can be pushed to the built-in Octopus repository with the push command:

```fsharp
open Fake.Tools

Octo.push (fun ps -> {ps with Packages = ["mypackage.nupkg"; "mypackage2.nupkg"]
Common = setCommon ps.Common})

```



## Create a Release

Octopus Deploy relies on the concept of a **release**, which should be an immutable *NuGet Package* which has been built, tested, [packaged and published](apidocs/v5/legacy/fake-nugethelper.html) from your Continuous Integration systems - which you can of course completely manage with your FAKE script.

So once you have created a project you are able to create and push a release into Octopus Deploy. This can be done through the Octopus UI, command line tool, or in our case - from a FAKE script.

```fsharp
open Fake.Tools

Octo.createRelease (fun ps -> {ps with Project = "Your Project"
Version = "latest"
Common = setCommon ps.Common
})
```


## Deploy a Release

You can automatically deploy a release when you create it, but using the optional deploy options when you create your release.

This is often a good idea when you want your FAKE build script to continue on to a second set of perhaps slower, unit tests that exercise behaviors in a more complete and perhaps integrated environment.

```fsharp
open Fake.Tools

Octo.deployRelease (fun ps -> {ps with Project = "Your Project"
DeployTo = "Staging"
Version = "latest"
Common = setCommon ps.Common
})
```
2 changes: 2 additions & 0 deletions help/templates/template.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
<li><a href="/apidocs/v5/fake-core-taskrunner.html">Tasks</a></li>
<li><a href="/core-trace.html">Trace</a></li>
<li><a href="/apidocs/v5/fake-core-userinput.html">UserInput</a></li>
<li><a href="/apidocs/v5/fake-core-vault.html">Vault</a></li>
<li><a href="/apidocs/v5/fake-core-xml.html">Xml</a></li>
</ul>
</li>
Expand Down Expand Up @@ -197,6 +198,7 @@
<ul>
<li><a href="/apidocs/v5/index.html#Fake.Tools.Git">Git</a></li>
<li><a href="/fake-tools-pickles.html">Pickles</a></li>
<li><a href="/fake-tools-octo.html">Octo</a></li>
<li><a href="/apidocs/v5/fake-tools-rsync.html">Rsync</a></li>
</ul>
</li>
Expand Down
4 changes: 3 additions & 1 deletion paket.dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version 5.176.4
version 5.176.9
content: none
// just in case we need some special nuget feature again...
//source https://ci.appveyor.com/nuget/paket
Expand Down Expand Up @@ -177,6 +177,8 @@ group netcore
nuget Mono.Cecil prerelease
nuget FSharp.Control.Reactive
nuget System.Reactive.Compatibility
nuget System.Security.Cryptography.Algorithms

// Testing
nuget Expecto >= 5.0

Expand Down
Loading