This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BuildContext : FrostingContext | |
{ | |
public string ProjectName { get; internal set; } | |
public BuildContext(ICakeContext context) | |
: base(context) | |
{ | |
SolutionPath = context.Arguments.GetArgument("solution_path"); | |
ProjectName = context.Arguments.GetArgument("project_name"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TaskName("Default")] | |
[IsDependentOn(typeof(PublishApplication))] | |
public class DefaultTask : FrostingTask | |
{ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TaskName("Clean Solution")] | |
public sealed class CleanSolution : FrostingTask<BuildContext> | |
{ | |
public override void Run(BuildContext context) | |
{ | |
context.GitClean(context.SolutionPath); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class DockerContextExtensions | |
{ | |
const string DockerBinaryName = "docker"; | |
const string ArgumentSeparator = " "; | |
public static async Task<bool> TryBuildDockerfileAsync(this ICakeContext context, DockerBuildOptions options) | |
{ | |
var buildArgs = string.Join($"{ArgumentSeparator}--build-arg", options.BuildArguments.Select(kvp => $"{kvp.Key}={kvp.Value}")); | |
string arguments = string.IsNullOrWhiteSpace(buildArgs) | |
? string.Empty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TaskName("Build Dockerfile")] | |
[IsDependentOn(typeof(CleanSolution))] | |
public sealed class BuildDockerfile : AsyncFrostingTask<BuildContext> | |
{ | |
// Tasks can be asynchronous | |
public override async Task RunAsync(BuildContext context) | |
{ | |
var options = new DockerBuildOptions | |
{ | |
DockerfileLocation = ".", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TaskName("Build Dockerfile")] | |
[IsDependentOn(typeof(CleanSolution))] | |
public sealed class BuildDockerfile : AsyncFrostingTask<BuildContext> | |
{ | |
// Tasks can be asynchronous | |
public override async Task RunAsync(BuildContext context) | |
{ | |
var options = new DockerBuildOptions | |
{ | |
DockerfileLocation = ".", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TaskName("Publish Application")] | |
[IsDependentOn(typeof(BuildDockerfile))] | |
public sealed class PublishApplication : AsyncFrostingTask<BuildContext> | |
{ | |
// Tasks can be asynchronous | |
public override async Task RunAsync(BuildContext context) | |
{ | |
var options = new DockerBuildOptions | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: game-demo | |
data: | |
# property-like keys; each key maps to a simple value | |
player_initial_lives: "3" | |
ui_properties_file_name: "user-interface.properties" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: {{ include "servicechart.fullname" . }}-appsettings | |
namespace: {{ include "servicechart.namespace" . }} | |
data: | |
appsettings.config.json: |- | |
{{ .Files.Get "appsettings.config.json" | indent 4 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Secret | |
metadata: | |
name: {{ include "servicechart.fullname" . }}-appsettings | |
namespace: {{ include "servicechart.namespace" . }} | |
type: Opaque | |
stringData: | |
appsettings.secrets.json: |- | |
{{ .Files.Get "appsettings.secrets.json" | indent 4 }} |