Skip to content

Commit eb4e1f4

Browse files
committed
(build) added a default task for docker stage
1 parent 7a55e94 commit eb4e1f4

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

build.cake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,16 @@ Task("Publish")
160160
}
161161
});
162162

163+
Task("Publish-DockerHub")
164+
.IsDependentOn("Docker-Publish")
165+
.Finally(() =>
166+
{
167+
if (publishingError)
168+
{
169+
throw new Exception("An error occurred during the publishing of GitVersion. All publishing tasks have been attempted.");
170+
}
171+
});
172+
163173
Task("Default")
164174
.IsDependentOn("Publish")
165175
.IsDependentOn("Publish-DockerHub");

build/docker.cake

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ Task("Docker-Test")
3636
}
3737
});
3838

39-
Task("Publish-DockerHub")
40-
.WithCriteria<BuildParameters>((context, parameters) => parameters.EnabledPublishDocker, "Publish-DockerHub was disabled.")
41-
.WithCriteria<BuildParameters>((context, parameters) => !parameters.IsRunningOnMacOS, "Publish-DockerHub works only on Windows and Linux agents.")
42-
.WithCriteria<BuildParameters>((context, parameters) => parameters.IsRunningOnAzurePipeline, "Publish-DockerHub works only on AzurePipeline.")
43-
.WithCriteria<BuildParameters>((context, parameters) => parameters.IsStableRelease() || parameters.IsPreRelease(), "Publish-DockerHub works only for releases.")
39+
Task("Docker-Publish")
40+
.WithCriteria<BuildParameters>((context, parameters) => parameters.EnabledPublishDocker, "Docker-Publish was disabled.")
41+
.WithCriteria<BuildParameters>((context, parameters) => !parameters.IsRunningOnMacOS, "Docker-Publish works only on Windows and Linux agents.")
42+
.WithCriteria<BuildParameters>((context, parameters) => parameters.IsRunningOnAzurePipeline, "Docker-Publish works only on AzurePipeline.")
43+
.WithCriteria<BuildParameters>((context, parameters) => parameters.IsStableRelease() || parameters.IsPreRelease(), "Docker-Publish works only for releases.")
4444
.IsDependentOn("Docker-Test")
4545
.Does<BuildParameters>((parameters) =>
4646
{

0 commit comments

Comments
 (0)