set positional-arguments := true default: @just --list tool := "minio" docker_container_registry := "docker.pkg.github.com" docker_user_repo := "mihaigalos/docker" docker_image_version := "latest" docker_image := docker_container_registry + "/" + docker_user_repo + "/" + tool + ":" + docker_image_version build +args="": docker build {{ args }} --network=host -t {{ docker_image }} . test: _start && _stop #!/bin/bash source ../common.sh highlight "\nRunning tests in $PWD\n\n" for test in $(grep ^_test_ Justfile | cut -d':' -f1); do highlight "$test " just $test && true || err "Stopping." done _start dirname="." +args="-d": _stop #!/bin/bash source ../common.sh docker run -p 9000:9000 --name minio -e MINIO_CI_CD=1 -d {{ docker_image }} server /export && wait_docker "minio" docker run --rm --net=host -v $(realpath .mc):/root/.mc --entrypoint=mc minio/mc mb myminio/test-bucket docker run --rm --net=host -v $(realpath .mc):/root/.mc -v $(realpath .):/src --entrypoint=mc minio/mc cp /src/binary_file.tar.gz.part1 myminio/test-bucket/binary_file.tar.gz.part1 _stop dirname=".": @docker rm --force minio > /dev/null 2>&1 _test_aim_put_binary_file: #!/bin/bash test=$(basename $0) && source ../common.sh set -x sha_input=$(sha256sum test.file | cut -d' ' -f1) aim -s test.file s3://minioadmin:minioadmin@localhost:9000/test-bucket/$test sleep 3 aim -s s3://minioadmin:minioadmin@localhost:9000/test-bucket/$test $test sha_output=$(sha256sum $test | cut -d' ' -f1) [ "$sha_input" = "$sha_output" ] && ok || err "ERROR: input and output SHA256s don't match." rm $test set +x