Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
4cf5d2d
(GH-1932) Remove mkdocs file
gep13 Nov 24, 2019
d5a181b
(GH-1932) Change folder structure
gep13 Nov 24, 2019
281cce7
(GH-1932) Add Wyam Addin and Tool
gep13 Nov 24, 2019
d4ef13f
(GH-1932) Fix broken unit tests
gep13 Nov 26, 2019
028cfc5
(maint) Add .DS_Store to ignore file
gep13 Nov 26, 2019
c9d01ea
(GH-1932) Remove deleted file from sln file
gep13 Nov 26, 2019
8929bbc
(GH-1932) Update readme information about docs
gep13 Nov 26, 2019
91711a1
(GH-1932) Add Wyam Preview task
gep13 Nov 26, 2019
cd3ba4e
(GH-1932) Fix paths to image files
gep13 Nov 26, 2019
2f190d6
(GH-1932) Initial ordering of top level pages
gep13 Nov 27, 2019
fdadfb1
(GH-1932) Add missing wyam.cake file
gep13 Nov 27, 2019
748c978
(GH-1932) Add favicon for GitVersion
gep13 Nov 27, 2019
fbc5e46
(GH-1932) Add configuration for editing md files
gep13 Dec 1, 2019
39a5f0a
(GH-1932) Fix linting errors for top level pages
gep13 Dec 1, 2019
d1613f9
(GH-1932) Fix linting and ordering in usage section
gep13 Dec 1, 2019
b539646
(GH-1932) Linting and ordering of build server section
gep13 Dec 1, 2019
73a0ebc
(GH-1932) Additional formatting
gep13 Dec 1, 2019
fa5a617
(GH-1932) Linting and ordering of branching strategy
gep13 Dec 1, 2019
6a6f34a
(GH-1932) Linting and ordering of more info section
gep13 Dec 1, 2019
bcf9f41
(GH-1932) Linting and ordering versioning mode section
gep13 Dec 1, 2019
5dc4dcb
(GH-1932) Fix page navigations
gep13 Dec 1, 2019
c49c748
(GH-1932) Fix generation of API docs
gep13 Dec 1, 2019
2fda040
(GH-1932) Fix page title
gep13 Dec 1, 2019
3dbb8f5
(GH-1932) Move readme to correct location
gep13 Dec 1, 2019
f2498e0
(GH-1932) Use correct command
gep13 Dec 1, 2019
6ecec35
(GH-1932) Add config.wyam
gep13 Dec 1, 2019
4c13a43
(doc) Fix internal links
gep13 Dec 14, 2019
0207c9e
(GH-1932) Minor updates to descriptions
gep13 Dec 18, 2019
1285547
(GH-1932) Add info, warning and danger callouts
gep13 Dec 18, 2019
5120cd4
(GH-1932) First stab at publishing docs
gep13 Dec 19, 2019
3884c67
(GH-1932) Add info callout to tip
gep13 Dec 19, 2019
0510c25
(GH-1932) Fix criteria for publishing documentation
gep13 Dec 19, 2019
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
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ _NCrunch_GitVersion
GitVersion.sln.ide/
.vs/
Packages/
build/
build/*
site/
/TestResult.xml

Expand Down Expand Up @@ -123,3 +123,9 @@ src/GitVersionRubyGem/bin/GitVersion.exe
src/GitVersionRubyGem/bin/LibGit2Sharp.dll.config

!**/*.cake
.DS_Store

# Wyam
config.wyam.dll
config.wyam.hash
config.wyam.packages.xml
3 changes: 3 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"MD026": false
}
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"editor.rulers": [80],
"cSpell.words": [
"commiting",
"gittools",
"gitversion"
]
}
}
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ We use Cake for our build and deployment process. The way the build / release pr
1) We build releasable artifacts on AppVeyor
1) Login to AppVeyor
1) Deploy the latest master build
![docs/img/release-1-deploy.png](docs/img/release-1-deploy.png)
![docs/input/docs/img/release-1-deploy.png](docs/input/docs/img/release-1-deploy.png)
1) Choose GitVersion release, when you press deploy it will create a *non-released* GitHub release, this *will not* create a Git tag. This step is so we can validate the release and release notes before pushing the button.
![docs/img/release-2-deploy.png](docs/img/release-2-deploy.png)
![docs/input/docs/img/release-2-deploy.png](docs/input/docs/img/release-2-deploy.png)
1) All the artifacts should upload nicely
![docs/img/release-3-deploy.png](docs/img/release-3-deploy.png)
![docs/input/docs/img/release-3-deploy.png](docs/input/docs/img/release-3-deploy.png)
1) Head over to GitHub releases, you should have a draft release, download a copy of the release notes
![docs/img/release-4-deploy.png](docs/img/release-4-deploy.png)
![docs/input/docs/img/release-4-deploy.png](docs/input/docs/img/release-4-deploy.png)
1) Edit the release and do the following:
1. Remove the build metadata from the tag and title (the + and everything after it)
2. Paste the downloaded release notes in, you can clean them up if you want otherwise there may be closed issues which were questions etc.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1>
<img src="docs/img/package_icon.svg" alt="Tree" height="100">
<img src="docs/input/docs/img/package_icon.svg" alt="Tree" height="100">
GitVersion
</h1>

Expand Down Expand Up @@ -102,7 +102,7 @@ from The Noun Project.
[how]: http://gitversion.readthedocs.org/en/latest/more-info/how-it-works/
[faq]: http://gitversion.readthedocs.org/en/latest/faq/
[who]: http://gitversion.readthedocs.org/en/latest/who/
[gv-in-action]: https://raw.github.com/GitTools/GitVersion/master/docs/img/README.png
[gv-in-action]: https://raw.github.com/GitTools/GitVersion/master/docs/input/docs/img/README.png
[dockerhub]: https://hub.docker.com/r/gittools/gitversion/
[dockerhub-badge]: https://img.shields.io/docker/pulls/gittools/gitversion.svg
[az-pipeline-task]: https://marketplace.visualstudio.com/items?itemName=GitTools.usegitversion
Expand Down
7 changes: 7 additions & 0 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@
#addin "nuget:?package=Cake.Coverlet&version=2.3.4"
#addin "nuget:?package=Cake.Docker&version=0.10.1"
#addin "nuget:?package=Cake.Gem&version=0.8.1"
#addin "nuget:?package=Cake.Git&version=0.21.0"
#addin "nuget:?package=Cake.Gitter&version=0.11.1"
#addin "nuget:?package=Cake.Incubator&version=5.1.0"
#addin "nuget:?package=Cake.Json&version=4.0.0"
#addin "nuget:?package=Cake.Kudu&version=0.10.1"
#addin "nuget:?package=Cake.Npm&version=0.17.0"
#addin "nuget:?package=Cake.Tfx&version=0.9.1"
#addin "nuget:?package=Cake.Wyam&version=2.2.9"

#addin "nuget:?package=Newtonsoft.Json&version=12.0.2"
#addin "nuget:?package=SharpZipLib&version=1.2.0"
Expand All @@ -20,6 +23,8 @@
// Install tools.
#tool "nuget:?package=NUnit.ConsoleRunner&version=3.10.0"
#tool "nuget:?package=nuget.commandline&version=5.2.0"
#tool "nuget:?package=Wyam&version=2.2.9"
#tool "nuget:?package=KuduSync.NET&version=1.5.2"

// Install .NET Core Global tools.
#tool "dotnet:?package=Codecov.Tool&version=1.7.2"
Expand All @@ -34,6 +39,7 @@
#load "./build/artifacts-test.cake"
#load "./build/docker.cake"
#load "./build/publish.cake"
#load "./build/wyam.cake"

using Xunit;
using System.Diagnostics;
Expand Down Expand Up @@ -140,6 +146,7 @@ Task("Publish")
.IsDependentOn("Publish-NuGet")
.IsDependentOn("Publish-Chocolatey")
.IsDependentOn("Publish-Gem")
.IsDependentOn("Publish-Documentation")
.Finally(() =>
{
if (publishingError)
Expand Down
5 changes: 5 additions & 0 deletions build/utils/paths.cake
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class BuildPaths

var semVersion = version.SemVersion;

var sourceDir = (DirectoryPath)(context.Directory("./src"));
var artifactsDir = (DirectoryPath)(context.Directory("./artifacts") + context.Directory("v" + semVersion));
var artifactsBinDir = artifactsDir.Combine("bin");
var artifactsBinPortableDir = artifactsBinDir.Combine("portable");
Expand All @@ -42,6 +43,7 @@ public class BuildPaths

// Directories
var buildDirectories = new BuildDirectories(
sourceDir,
artifactsDir,
nativeDir,
buildArtifactDir,
Expand Down Expand Up @@ -86,6 +88,7 @@ public class BuildFiles

public class BuildDirectories
{
public DirectoryPath Source { get; private set; }
public DirectoryPath Artifacts { get; private set; }
public DirectoryPath Native { get; private set; }
public DirectoryPath NugetRoot { get; private set; }
Expand All @@ -100,6 +103,7 @@ public class BuildDirectories
public ICollection<DirectoryPath> ToClean { get; private set; }

public BuildDirectories(
DirectoryPath sourceDir,
DirectoryPath artifactsDir,
DirectoryPath nativeDir,
DirectoryPath buildArtifactDir,
Expand All @@ -113,6 +117,7 @@ public class BuildDirectories
DirectoryPath artifactsBinFullFx472Dir
)
{
Source = sourceDir;
Artifacts = artifactsDir;
Native = nativeDir;
BuildArtifact = buildArtifactDir;
Expand Down
160 changes: 160 additions & 0 deletions build/wyam.cake
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
Task("Clean-Documentation")
.Does(() =>
{
EnsureDirectoryExists(MakeAbsolute(Directory("artifacts/temp/_PublishedDocumentation")));
});

Task("Preview-Documentation")
.WithCriteria(() => DirectoryExists(MakeAbsolute(Directory("docs"))), "Wyam documentation directory is missing")
.Does<BuildParameters>((parameters) =>
{
Wyam(new WyamSettings
{
Recipe = "Docs",
Theme = "Samson",
OutputPath = MakeAbsolute(Directory("artifacts/Documentation")),
RootPath = MakeAbsolute(Directory("docs")),
Preview = true,
Watch = true,
ConfigurationFile = MakeAbsolute((FilePath)"config.wyam"),
PreviewVirtualDirectory = "GitVersion",
Settings = new Dictionary<string, object>
{
{ "Host", "gittools.github.io" },
{ "LinkRoot", "GitVersion" },
{ "BaseEditUrl", "https://github.com/gittools/GitVersion/tree/master/docs/input/" },
{ "SourceFiles", MakeAbsolute(parameters.Paths.Directories.Source) + "/**/{!bin,!obj,!packages,!*.Tests,}/**/*.cs" },
{ "Title", "GitVersion" },
{ "IncludeGlobalNamespace", false }
}
});
});

Task("Force-Publish-Documentation")
.IsDependentOn("Clean-Documentation")
.WithCriteria(() => DirectoryExists(MakeAbsolute(Directory("docs"))), "Wyam documentation directory is missing")
.Does<BuildParameters>((parameters) =>
{
Wyam(new WyamSettings
{
Recipe = "Docs",
Theme = "Samson",
OutputPath = MakeAbsolute(Directory("artifacts/Documentation")),
RootPath = MakeAbsolute(Directory("docs")),
ConfigurationFile = MakeAbsolute((FilePath)"config.wyam"),
PreviewVirtualDirectory = "GitVersion",
Settings = new Dictionary<string, object>
{
{ "Host", "gittools.github.io" },
{ "LinkRoot", "GitVersion" },
{ "BaseEditUrl", "https://github.com/gittools/GitVersion/tree/master/docs/input/" },
{ "SourceFiles", MakeAbsolute(parameters.Paths.Directories.Source) + "/**/{!bin,!obj,!packages,!*.Tests,}/**/*.cs" },
{ "Title", "GitVersion" },
{ "IncludeGlobalNamespace", false }
}
});

PublishDocumentation(parameters);
});

Task("Publish-Documentation")
.IsDependentOn("Clean-Documentation")
.WithCriteria(() => DirectoryExists(MakeAbsolute(Directory("docs"))), "Wyam documentation directory is missing")
.WithCriteria<BuildParameters>((context, parameters) => parameters.IsRunningOnWindows, "Publish-Documentation is ran only on Windows agents.")
.WithCriteria<BuildParameters>((context, parameters) => parameters.IsRunningOnAzurePipeline, "Publish-Documentation is ran only on AzurePipeline.")
.WithCriteria<BuildParameters>((context, parameters) => !parameters.IsPullRequest, "Publish-Documentation works only for non-PR commits.")
.Does<BuildParameters>((parameters) =>
{
// Check to see if any documentation has changed
var sourceCommit = GitLogTip("./");
Information("Source Commit Sha: {0}", sourceCommit.Sha);
var filesChanged = GitDiff("./", sourceCommit.Sha);
Information("Number of changed files: {0}", filesChanged.Count);
var docFileChanged = false;

var wyamDocsFolderDirectoryName = "docs";

foreach (var file in filesChanged)
{
var forwardSlash = '/';
Verbose("Changed File OldPath: {0}, Path: {1}", file.OldPath, file.Path);
if (file.OldPath.Contains(string.Format("{0}{1}", wyamDocsFolderDirectoryName, forwardSlash)) ||
file.Path.Contains(string.Format("{0}{1}", wyamDocsFolderDirectoryName, forwardSlash)) ||
file.Path.Contains("config.wyam"))
{
docFileChanged = true;
break;
}
}

if (docFileChanged)
{
Information("Detected that documentation files have changed, so running Wyam...");

Wyam(new WyamSettings
{
Recipe = "Docs",
Theme = "Samson",
OutputPath = MakeAbsolute(Directory("artifacts/Documentation")),
RootPath = MakeAbsolute(Directory("docs")),
ConfigurationFile = MakeAbsolute((FilePath)"config.wyam"),
PreviewVirtualDirectory = "GitVersion",
Settings = new Dictionary<string, object>
{
{ "Host", "gittools.github.io" },
{ "LinkRoot", "GitVersion" },
{ "BaseEditUrl", "https://github.com/gittools/GitVersion/tree/master/docs/input/" },
{ "SourceFiles", MakeAbsolute(parameters.Paths.Directories.Source) + "/**/{!bin,!obj,!packages,!*.Tests,}/**/*.cs" },
{ "Title", "GitVersion" },
{ "IncludeGlobalNamespace", false }
}
});

PublishDocumentation(parameters);
}
else
{
Information("No documentation has changed, so no need to generate documentation");
}
})
.OnError(exception =>
{
Error(exception.Message);
Information("Publish-Documentation Task failed, but continuing with next Task...");
publishingError = true;
});

public void PublishDocumentation(BuildParameters parameters)
{
var sourceCommit = GitLogTip("./");

var publishFolder = MakeAbsolute(Directory("artifacts/temp/_PublishedDocumentation")).Combine(DateTime.Now.ToString("yyyyMMdd_HHmmss"));
Information("Publishing Folder: {0}", publishFolder);
Information("Getting publish branch...");
GitClone("https://github.com/gittools/GitVersion", publishFolder, new GitCloneSettings{ BranchName = "gh-pages" });

Information("Sync output files...");
Kudu.Sync(MakeAbsolute(Directory("artifacts/Documentation")), publishFolder, new KuduSyncSettings {
ArgumentCustomization = args=>args.Append("--ignore").AppendQuoted(".git;CNAME")
});

if (GitHasUncommitedChanges(publishFolder))
{
Information("Stage all changes...");
GitAddAll(publishFolder);

if (GitHasStagedChanges(publishFolder))
{
Information("Commit all changes...");
GitCommit(
publishFolder,
sourceCommit.Committer.Name,
sourceCommit.Committer.Email,
string.Format("Continuous Integration Publish: {0}\r\n{1}", sourceCommit.Sha, sourceCommit.Message)
);

Information("Pushing all changes...");
GitPush(publishFolder, parameters.Credentials.GitHub.Token, "x-oauth-basic", "gh-pages");
}
}
}
1 change: 1 addition & 0 deletions config.wyam
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Pipelines["RenderPages"].Replace("WriteMetadata", new Headings(2));
21 changes: 0 additions & 21 deletions docs/build-server-support/build-server-support.md

This file was deleted.

7 changes: 0 additions & 7 deletions docs/build-server-support/build-server/appveyor.md

This file was deleted.

Loading