Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use local variables in Bash function. #309

Merged
merged 1 commit into from
Sep 6, 2019
Merged
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
6 changes: 3 additions & 3 deletions build-docker-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ run() {
local image_name="rustembedded/cross:${1}"

if docker pull "${image_name}"; then
cache_from_args=(--cache-from "${image_name}")
local cache_from_args=(--cache-from "${image_name}")
fi

docker build ${cache_from_args[@]} --pull -t "${image_name}" -f "${dockerfile}" .

version="$(cargo metadata --format-version 1 | jq --raw-output '.packages[] | select(.name == "cross") | .version')"
local version="$(cargo metadata --format-version 1 | jq --raw-output '.packages[] | select(.name == "cross") | .version')"

if ! [[ "${version}" =~ alpha ]] && ! [[ "${version}" =~ dev ]]; then
versioned_image_name="${image_name}-${version}"
local versioned_image_name="${image_name}-${version}"
docker tag "${image_name}" "${versioned_image_name}"
fi
}
Expand Down