colibri/Executable/Sources/Commands/BuildCommand.swift
Javier Cicchelli f8a14e46ed Improved the Build subcommand to support the building of Docker images (#11)
This PR contains the work done to support the building of Docker images in the `Build` subcommand in the executable target. So, for this purpose, the following task have been done:

- added a basic boilerplate of the `docker-compose.yml` file;
- fixed some issues found in the boilerplate of the `Dockerfile` file;
- defined the `Randomable` protocol;
- defined the `Artifact` enumeration;
- updated the `BuildProjectTask` task to support building Docker images if required;
- renamed the `BuildProjectTask` task as `BuildArtifactTask`.

Reviewed-on: #11
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2025-02-22 00:33:52 +00:00

30 lines
750 B
Swift

import ArgumentParser
import ColibriLibrary
extension Colibri {
struct Build: AsyncParsableCommand {
// MARK: Properties
static let configuration = CommandConfiguration(
commandName: "build-project",
abstract: "Build a Hummingbird app",
helpNames: .shortAndLong,
aliases: ["build"]
)
@OptionGroup var options: Options
// MARK: Functions
mutating func run() async throws {
let terminalService = TerminalService()
let buildArtifact = BuildArtifactTask(terminalService: terminalService)
try await buildArtifact(options.artifact, at: options.locationURL)
}
}
}