Skip to content

Commit

Permalink
Merge branch 'master' into shellcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
reitermarkus authored May 8, 2020
2 parents 5718359 + 73bcd4d commit af3b910
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 20 deletions.
6 changes: 4 additions & 2 deletions build-docker-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ run() {
local image_name="rustembedded/cross:${1}"
local cache_from_args=()

if docker image inspect "${image_name}" &>/dev/null || docker pull "${image_name}"; then
cache_from_args=(--cache-from "${image_name}")
if ! docker image inspect "${image_name}" &>/dev/null; then
if docker pull "${image_name}"; then
cache_from_args=(--cache-from "${image_name}")
fi
fi

docker build ${cache_from_args[@]+"${cache_from_args[@]}"} --pull -t "${image_name}" -f "${dockerfile}" .
Expand Down
22 changes: 6 additions & 16 deletions docker/cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,9 @@ set -x
set -euo pipefail

main() {
local version=3.16.5
local version=3.17.2

local dependencies=(
curl
g++
libssl-dev
make
zlib1g-dev
)
local dependencies=(curl)

apt-get update
local purge_list=()
Expand All @@ -28,21 +22,17 @@ main() {

pushd "${td}"

curl "https://cmake.org/files/v${version%.*}/cmake-${version}.tar.gz" | \
tar --strip-components 1 -xz
curl -sSfL "https://github.com/Kitware/CMake/releases/download/v${version}/cmake-${version}-Linux-x86_64.sh" -o cmake.sh
sh cmake.sh --skip-license --prefix=/usr/local

./bootstrap
make "-j$(nproc)"
make install

# clean up
popd

if (( ${#purge_list[@]} )); then
apt-get purge --auto-remove -y "${purge_list[@]}"
apt-get purge --assume-yes --auto-remove "${purge_list[@]}"
fi

rm -rf "${td}"
rm -rf /var/lib/apt/lists/*
rm "${0}"
}

Expand Down
1 change: 1 addition & 0 deletions docker/linux-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ main() {
local dependencies=(
cpio
sharutils
gnupg
)

local purge_list=()
Expand Down
4 changes: 2 additions & 2 deletions docker/xargo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ main() {
export CARGO_HOME=/tmp/cargo

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o rustup-init.sh
sh rustup-init.sh -y --no-modify-path
sh rustup-init.sh -y --no-modify-path --profile minimal
rm rustup-init.sh

PATH="${CARGO_HOME}/bin:${PATH}" cargo install xargo --root /usr
PATH="${CARGO_HOME}/bin:${PATH}" cargo install xargo --root /usr/local

rm -r "${RUSTUP_HOME}" "${CARGO_HOME}"

Expand Down

0 comments on commit af3b910

Please sign in to comment.