harris-chris / Jot.jl

Streamlines the creation and management of AWS Lambda functions written in Julia
MIT License
41 stars 6 forks source link

Add build_args to create_local_image and get_dockerfile_build_cmd. #26

Closed doorisajar closed 2 years ago

doorisajar commented 2 years ago

This is concise at the expense of clarity, but it does the job. For example:

pairs = [Pair("--build-arg", "arg1"), Pair("--build-arg", "arg2")];
options = ["--rm", "--iidfile", "id", "--tag"];

[push!(options, e) for e in map(x -> [first(x), last(x)], pairs) |> x -> reduce(vcat, x)];

options
# 8-element Vector{String}:
#  "--rm"
#  "--iidfile"
#  "id"
#  "--tag"
#  "--build-arg"
#  "arg1"
#  "--build-arg"
#  "arg2"