Skip to content

Commit

Permalink
fix shfmt and shellcheck errors
Browse files Browse the repository at this point in the history
  • Loading branch information
derpsteb committed Oct 27, 2023
1 parent 1df18e1 commit bac4790
Show file tree
Hide file tree
Showing 13 changed files with 1,704 additions and 1,709 deletions.
21 changes: 9 additions & 12 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
#!/usr/bin/env bash

# Could be run like this: $ ./build.sh $(git tag --sort=committerdate | tail -1)
script_path=$(realpath $0)

if [[ ! "$1" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[a-z]+)?$ ]]; then
echo "Invalid version format. Please use v0.0.0-foo"
exit 1
echo "Invalid version format. Please use v0.0.0-foo"
exit 1
fi
pseudo_version="$1"
readonly pseudo_version

docker build -t mint . -f Dockerfile
if [[ "$?" -ne 0 ]]; then
echo "Failed to build docker image"
exit 1
if ! docker build -t mint . -f Dockerfile; then
echo "Failed to build docker image"
exit 1
fi

tag=ghcr.io/edgelesssys/mint:"$pseudo_version"
docker tag mint:latest "$tag"

if [[ "$?" -eq 0 ]]; then
echo "Successfully built docker image: $tag"
if docker tag mint:latest "$tag"; then
echo "Successfully built docker image: $tag"
fi
8 changes: 3 additions & 5 deletions build/aws-sdk-java/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@
# limitations under the License.
#

test_run_dir="$MINT_RUN_CORE_DIR/aws-sdk-java"

cd "$(dirname "$(realpath "$0")")"

ant init-ivy &&
ant resolve &&
ant compile &&
ant jar
ant resolve &&
ant compile &&
ant jar

echo "$PWD"
18 changes: 9 additions & 9 deletions build/awscli/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
#

die() {
echo "$*" 1>&2
exit 1
echo "$*" 1>&2
exit 1
}

# shellcheck disable=SC2086
Expand All @@ -28,16 +28,16 @@ cd "$TMPDIR"

# Download botocore and apply @y4m4's expect 100 continue fix
(git clone --depth 1 -b 1.31.37 https://github.com/boto/botocore &&
cd botocore &&
patch -p1 < "$ROOTDIR/expect-100.patch" &&
python3 -m pip install .) ||
die "Unable to install botocore.."
cd botocore &&
patch -p1 <"$ROOTDIR/expect-100.patch" &&
python3 -m pip install .) ||
die "Unable to install botocore.."

# Download and install aws cli
(git clone --depth 1 -b 1.29.37 https://github.com/aws/aws-cli &&
cd aws-cli &&
python3 -m pip install .) ||
die "Unable to install aws-cli.."
cd aws-cli &&
python3 -m pip install .) ||
die "Unable to install aws-cli.."

# Clean-up
rm -r "$TMPDIR"
12 changes: 6 additions & 6 deletions create-data-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ data_file_map["datafile-129-MB"]="129M"

mkdir -p "$MINT_DATA_DIR"
for filename in "${!data_file_map[@]}"; do
echo "creating $MINT_DATA_DIR/$filename"
touch "$MINT_DATA_DIR/$filename"
if ! shred -n 1 -s "${data_file_map[$filename]}" "$MINT_DATA_DIR/$filename"; then
echo "unable to create data file $MINT_DATA_DIR/$filename"
exit 1
fi
echo "creating $MINT_DATA_DIR/$filename"
touch "$MINT_DATA_DIR/$filename"
if ! shred -n 1 -s "${data_file_map[$filename]}" "$MINT_DATA_DIR/$filename"; then
echo "unable to create data file $MINT_DATA_DIR/$filename"
exit 1
fi
done
Loading

0 comments on commit bac4790

Please sign in to comment.