Fix bash scripts

Fix bash scripts

Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
This commit is contained in:
2021-08-08 20:45:36 +02:00
parent c6c159b900
commit d59411d2cb
15 changed files with 89 additions and 64 deletions

View File

@ -1,26 +0,0 @@
#!/bin/bash
set -euo pipefail
# More info: https://github.com/GoogleContainerTools/container-diff
if (( $# < 1 || $# > 2 )); then
echo "Need 1 or 2 arguments: <img1> <img2>"
exit 1
fi
if (( $# == 1 )); then
container-diff analyze $1 --type=history 2>&1 | tee -a analyze-history.txt
container-diff analyze $1 --type=file 2>&1 | tee -a analyze-file.txt
container-diff analyze $1 --type=size 2>&1 | tee -a analyze-size.txt
container-diff analyze $1 --type=apt 2>&1 | tee -a analyze-apt.txt
container-diff analyze $1 --type=pip 2>&1 | tee -a analyze-pip.txt
fi
if (( $# == 2 )); then
container-diff diff $1 $2 --type=history 2>&1 | tee -a diff-history.txt
container-diff diff $1 $2 --type=file 2>&1 | tee -a diff-file.txt
container-diff diff $1 $2 --type=size 2>&1 | tee -a diff-size.txt
container-diff diff $1 $2 --type=apt 2>&1 | tee -a diff-apt.txt
container-diff diff $1 $2 --type=pip 2>&1 | tee -a diff-pip.txt
fi

24
tools/dockcross-builder.sh Executable file
View File

@ -0,0 +1,24 @@
#!/usr/bin/env bash
if (( $# >= 1 )); then
image=$1
build_file=build-${image%:*}
shift 1
cmake_arg=$*
echo "cmake arg: $cmake_arg"
#echo "Pulling dockcross/$image"
#docker pull dockcross/"$image"
echo "Make script dockcross-$image"
docker run --rm dockcross/"$image" > ./dockcross-"$image"
chmod +x ./dockcross-"$image"
echo "Build $build_file"
./dockcross-"$image" cmake -B "$build_file" -S . -G Ninja "$cmake_arg"
./dockcross-"$image" ninja -C "$build_file"
else
echo "Usage: ${0##*/} <docker imag (ex: linux-x64/linux-x64-clang/linux-arm64/windows-shared-x64/windows-static-x64...)> <cmake arg.>"
exit 1
fi

View File

@ -0,0 +1,27 @@
#!/usr/bin/env bash
# More info: https://github.com/GoogleContainerTools/container-diff
if (( $# < 1 || $# > 2 )); then
echo "Need 1 or 2 arguments: <img1> <img2>"
echo "For local image: daemon://<img>"
echo "For remote image: remote://<img>"
exit 1
fi
if (( $# == 1 )); then
container-diff analyze "$1" --type=history 2>&1 | tee -a analyze-history.txt
container-diff analyze "$1" --type=file 2>&1 | tee -a analyze-file.txt
container-diff analyze "$1" --type=size 2>&1 | tee -a analyze-size.txt
container-diff analyze "$1" --type=apt 2>&1 | tee -a analyze-apt.txt
container-diff analyze "$1" --type=pip 2>&1 | tee -a analyze-pip.txt
fi
if (( $# == 2 )); then
container-diff diff "$1" "$2" --type=history 2>&1 | tee -a diff-history.txt
container-diff diff "$1" "$2" --type=file 2>&1 | tee -a diff-file.txt
container-diff diff "$1" "$2" --type=size 2>&1 | tee -a diff-size.txt
container-diff diff "$1" "$2" --type=apt 2>&1 | tee -a diff-apt.txt
container-diff diff "$1" "$2" --type=pip 2>&1 | tee -a diff-pip.txt
fi