Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
42 changes: 21 additions & 21 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Sources/Container-Compose/Commands/ComposeDown.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

import ArgumentParser
import ContainerCommands
import ContainerClient
import ContainerAPIClient
import Foundation
import Yams

Expand Down
11 changes: 6 additions & 5 deletions Sources/Container-Compose/Commands/ComposeUp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@

import ArgumentParser
import ContainerCommands
import ContainerClient
//import ContainerClient
import ContainerAPIClient
import ContainerizationExtras
import Foundation
@preconcurrency import Rainbow
Expand Down Expand Up @@ -59,7 +60,7 @@ public struct ComposeUp: AsyncParsableCommand, @unchecked Sendable {
var process: Flags.Process

@OptionGroup
var global: Flags.Global
var logging: Flags.Logging

private var cwd: String { process.cwd ?? FileManager.default.currentDirectoryPath }
var envFilePath: String { "\(cwd)/\(process.envFile.first ?? ".env")" } // Path to optional .env file
Expand Down Expand Up @@ -186,7 +187,7 @@ public struct ComposeUp: AsyncParsableCommand, @unchecked Sendable {
let containerName = "\(projectName)-\(serviceName)"

let container = try await ClientContainer.get(id: containerName)
let ip = container.networks.compactMap { try? CIDRAddress($0.address).address.description }.first
let ip = container.networks.compactMap { $0.ipv4Gateway.description }.first

return ip
}
Expand Down Expand Up @@ -319,7 +320,7 @@ public struct ComposeUp: AsyncParsableCommand, @unchecked Sendable {
}
let commands = [actualNetworkName]

var networkCreate = try Application.NetworkCreate.parse(commands + global.passThroughCommands())
let networkCreate = try Application.NetworkCreate.parse(commands + logging.passThroughCommands())

try await networkCreate.run()
print("Network '\(networkName)' created")
Expand Down Expand Up @@ -578,7 +579,7 @@ public struct ComposeUp: AsyncParsableCommand, @unchecked Sendable {
commands.append(contentsOf: ["--platform", platform])
}

let imagePull = try Application.ImagePull.parse(commands + global.passThroughCommands())
let imagePull = try Application.ImagePull.parse(commands + logging.passThroughCommands())
try await imagePull.run()
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/Container-Compose/Helper Functions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,6 @@ public struct CommandResult {
public let exitCode: Int32
}

extension NamedColor: Codable {
extension NamedColor: @retroactive Codable {

}
4 changes: 2 additions & 2 deletions Tests/Container-Compose-DynamicTests/ComposeUpTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import Testing
import Foundation
import ContainerCommands
import ContainerClient
import ContainerAPIClient
import TestHelpers
@testable import ContainerComposeCore

Expand Down Expand Up @@ -57,7 +57,7 @@ struct ComposeUpTests {

// Check Environment
let wpEnv = parseEnvToDict(wordpressContainer.configuration.initProcess.environment)
#expect(wpEnv["WORDPRESS_DB_HOST"] == String(dbContainer.networks.first!.address.split(separator: "/")[0]))
#expect(wpEnv["WORDPRESS_DB_HOST"] == dbContainer.networks.first!.ipv4Gateway.description)
#expect(wpEnv["WORDPRESS_DB_USER"] == "wordpress")
#expect(wpEnv["WORDPRESS_DB_PASSWORD"] == "wordpress")
#expect(wpEnv["WORDPRESS_DB_NAME"] == "wordpress")
Expand Down