From 7807aac91110f1e8d9cc79f51f0bd3d7df6dcdfd Mon Sep 17 00:00:00 2001 From: wangyueliang Date: Mon, 29 Jan 2024 11:19:33 +0800 Subject: [PATCH] tree: drop bottlecap This was introduced as an alternative to the cosa alias, but in the end the cosa alias ended up being more popular. Let's just drop this to reduce supported paths. [upstream]e8955e17c2e23711c1f7be1b7f5250b2ba9c9518 --- bottlecap | 104 ------------------------------------------------- bottlecap-shim | 8 ---- 2 files changed, 112 deletions(-) delete mode 100755 bottlecap delete mode 100755 bottlecap-shim diff --git a/bottlecap b/bottlecap deleted file mode 100755 index 61ebdee5..00000000 --- a/bottlecap +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -# bottlecap, 'cause it's kinda like cork... get it? - -usage() { - echo "usage:" - echo "bottlecap [--dev] [--dry-run] [--runtime $runtime] [--build-dir $build_dir] [--container $container] assemblerargs..." - echo " --dev: rebuild and reinstall mantle and the build scripts before running coreos-assembler" - echo " --dry-run: do not run CoreOS Assembler; print what commands would be executed instead" - echo " --runtime: (auto) specify whether to use podman or docker. Defaults to podman if it is in \$PATH" - echo " --build-dir: Where to put build artifacts, defaults to the current directory" - echo " --container: which coreos-assembler container to use" - echo " --help: print this help message" -} - -dev=0 -dryrun=0 -help=0 -runtime="podman" -command -v podman > /dev/null || runtime="docker" -build_dir="$(pwd)" -container="quay.io/coreos-assembler/coreos-assembler" - -rc=0 -TEMP=$(getopt -o 'dr:b:c:h' --long 'dev,dry-run,runtime:,build-dir:,container:,help' -- "$@") || rc=$? -if [ "$rc" -ne 0 ]; then - 1>&2 echo "Bad arguments. getopt failed." - usage - exit 1 -fi - -eval set -- "$TEMP" - -while : -do - case "$1" in - "-d"|"--dev") - dev=1 - shift - ;; - "--dry-run") - dryrun=1 - shift - ;; - "-r"|"--runtime") - shift - runtime="$1" - shift - ;; - "-b"|"--build-dir") - shift - build_dir=$(readlink -f "$1") - shift - ;; - "-c"|"--container") - shift - container="$1" - shift - ;; - "-h"|"--help") - help=1 - shift - ;; - --) - shift - break - ;; - *) - 1>&2 echo "Error parsing args" - exit 1 - ;; - esac -done - -if [ "$help" = 1 ]; then - usage - exit 0 -fi - -script_dir=$(dirname "$(readlink -f "$0")") - -volumes="-v $build_dir:/srv " - -entrypoint="" - -if [ "$dev" = 1 ]; then - mkdir -p "$script_dir/.gocache" - volumes="$volumes -v $script_dir:/host/src " - volumes="$volumes -v $script_dir/.gocache:/root/.cache/go-build " - entrypoint="--entrypoint /host/src/bottlecap-shim" -fi - -if [ "$dryrun" = 1 ]; then - # prefix $runtime with `echo` so the command is printed rather than executed - runtime="echo $runtime" - echo "Command to be executed:" -else - set -x -fi - -# we actually want work splitting here since $volumes is multiple args -# shellcheck disable=SC2086 -$runtime run --rm -ti --device '/dev/kvm' $volumes --workdir /srv $entrypoint "$container" "$@" diff --git a/bottlecap-shim b/bottlecap-shim deleted file mode 100755 index e63c67af..00000000 --- a/bottlecap-shim +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -pushd /host/src/ || exit 1 -sudo ./build.sh make_and_makeinstall -popd || exit 1 - -exec /usr/bin/dumb-init /usr/bin/coreos-assembler "$@" -- Gitee