Skip to content

Commit

Permalink
better way to pull
Browse files Browse the repository at this point in the history
  • Loading branch information
tomerd committed May 26, 2022
1 parent 820eb62 commit 936eb8f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Plugins/AWSLambdaPackager/Plugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,19 @@ struct AWSLambdaPackager: CommandPlugin {
print("building \"\(packageIdentity)\" in docker")
print("-------------------------------------------------------------------------")

// update the underlying docker image, if necessary
print("updating \"\(baseImage)\" docker image")
try self.execute(
executable: dockerToolPath,
arguments: ["pull", baseImage],
logLevel: .output
)

// get the build output path
let buildOutputPathCommand = "swift build -c \(buildConfiguration.rawValue) --show-bin-path"
let dockerBuildOutputPath = try self.execute(
executable: dockerToolPath,
arguments: ["run", "--rm", "--pull", "always", "-v", "\(packageDirectory.string):/workspace", "-w", "/workspace", baseImage, "bash", "-cl", buildOutputPathCommand],
arguments: ["run", "--rm", "-v", "\(packageDirectory.string):/workspace", "-w", "/workspace", baseImage, "bash", "-cl", buildOutputPathCommand],
logLevel: verboseLogging ? .debug : .silent
)
guard let buildPathOutput = dockerBuildOutputPath.split(separator: "\n").last else {
Expand Down

0 comments on commit 936eb8f

Please sign in to comment.