Skip to content

Commit 52a5c55

Browse files
author
artur-stolear-technosoft
committed
GH-1927 - revert to previous behaviour
minor changes to tasks names displayed in AzurePipelines (build) fix the PR build
1 parent 50289e7 commit 52a5c55

File tree

8 files changed

+16
-13
lines changed

8 files changed

+16
-13
lines changed

build/stages/artifacts-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ jobs:
1919
path: $(Build.SourcesDirectory)
2020
artifact: storage
2121
- script: dotnet cake build.cake --bootstrap && dotnet cake build.cake --target=Artifacts-Test --docker_distro=$(DISTRO) --docker_dotnetversion=$(DOTNET_VERSION)
22-
displayName: 'Docker Test Artifacts'
22+
displayName: '[Docker Test Artifacts]'

build/stages/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ steps:
77
versionSpec: '>= 2.5'
88
addToPath: true
99
- script: dotnet cake build.cake --bootstrap && dotnet cake build.cake --target=Pack
10-
displayName: 'Cake build & pack'
10+
displayName: '[Cake build & pack]'
1111
- publish: $(System.DefaultWorkingDirectory)
1212
displayName: 'Upload pipeline artifacts'
1313
condition: and(succeeded(), eq( variables['Agent.OS'], 'Windows_NT' ))

build/stages/docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
path: $(Build.SourcesDirectory)
2020
artifact: storage
2121
- script: dotnet cake build.cake --bootstrap && dotnet cake build.cake --target=Publish-DockerHub --docker_distro=$(DISTRO) --docker_dotnetversion=$(DOTNET_VERSION)
22-
displayName: 'Docker build'
22+
displayName: '[Docker build]'
2323
env:
2424
DOCKER_USERNAME: $(DOCKER_USERNAME)
2525
DOCKER_PASSWORD: $(DOCKER_PASSWORD)

build/stages/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ steps:
1313
path: $(Build.SourcesDirectory)
1414
artifact: storage
1515
- script: dotnet cake build.cake --bootstrap && dotnet cake build.cake --target=Publish
16-
displayName: 'Publish'
16+
displayName: '[Publish]'
1717
env:
1818
GITHUB_TOKEN: $(GITHUB_TOKEN)
1919
NUGET_API_KEY: $(NUGET_API_KEY)

build/stages/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ steps:
77
path: $(Build.SourcesDirectory)
88
artifact: storage
99
- script: dotnet cake build.cake --bootstrap && dotnet cake build.cake --target=Release
10-
displayName: 'Release'
10+
displayName: '[Release]'
1111
env:
12-
GITHUB_TOKEN: $(GITHUB_TOKEN)
12+
GITHUB_TOKEN: $(GITHUB_TOKEN)

build/stages/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
steps:
22
- template: common-steps.yml
33
- script: dotnet cake build.cake --bootstrap && dotnet cake build.cake --target=Test
4-
displayName: 'Run Test'
4+
displayName: '[Run Test]'
55
env:
66
ENABLED_UNIT_TESTS: $(ENABLED_UNIT_TESTS)
77
CODECOV_TOKEN: $(CODECOV_TOKEN)

build/utils/docker.cake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,14 @@ DockerContainerRunSettings GetDockerRunSettings(BuildParameters parameters)
122122
}
123123
};
124124

125+
if (parameters.IsRunningOnAzurePipeline) {
126+
settings.Env = new[]
127+
{
128+
"TF_BUILD=true",
129+
$"BUILD_SOURCEBRANCH={Context.EnvironmentVariable("BUILD_SOURCEBRANCH")}"
130+
};
131+
}
132+
125133
return settings;
126134
}
127135

src/GitVersionCore/BuildServers/AzurePipelines.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ public override string[] GenerateSetParameterMessage(string name, string value)
2727

2828
public override string GetCurrentBranch(bool usingDynamicRepos)
2929
{
30-
var pullRequestBranchName = Environment.GetEnvironmentVariable("SYSTEM_PULLREQUEST_SOURCEBRANCH");
31-
if (!string.IsNullOrWhiteSpace(pullRequestBranchName))
32-
{
33-
return pullRequestBranchName;
34-
}
3530
return Environment.GetEnvironmentVariable("BUILD_SOURCEBRANCH");
3631
}
3732

@@ -53,7 +48,7 @@ public override string GenerateSetVersionMessage(VersionVariables variables)
5348
var buildNumber = variables.FullSemVer.EndsWith("+0")
5449
? variables.FullSemVer.Substring(0, variables.FullSemVer.Length - 2)
5550
: variables.FullSemVer;
56-
51+
5752
return $"##vso[build.updatebuildnumber]{buildNumber}";
5853
}
5954

0 commit comments

Comments
 (0)