push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
diff --git a/bin/bma b/bin/bma
index 6144842..26965ce 100755
--- a/bin/bma
+++ b/bin/bma
@@ -13,7 +13,7 @@
#
# Assumes you have installed bash-my-aws to standard location
-for f in "${BMA_HOME:-$HOME/.bash-my-aws}"/lib/*-functions; do source $f; done
+for f in @out@/lib/*-functions; do source $f; done
# Disable awcli client side pager
#
diff --git a/scripts/build b/scripts/build
index 54a786b..37a05df 100755
--- a/scripts/build
+++ b/scripts/build
@@ -41,7 +41,7 @@ funcs_after_bma=$(compgen -A function)
exclusions=('region')
for fnc in $(echo "${funcs_before_bma}" "${funcs_after_bma}" "${exclusions}" | tr ' ' '\n' | LC_ALL=C sort | uniq -u); do
- echo "alias $fnc='\${BMA_HOME:-\$HOME/.bash-my-aws}/bin/bma $fnc'" >> "$aliases_destination"
+ echo "alias $fnc='@out@/bin/bma $fnc'" >> "$aliases_destination"
done;
diff --git a/scripts/build-completions b/scripts/build-completions
index 2b5d49b..bf86af6 100755
--- a/scripts/build-completions
+++ b/scripts/build-completions
@@ -6,7 +6,7 @@ cat <<EOF
# DO NOT MANUALLY MODIFY THIS FILE.
# Use 'scripts/build' to regenerate if required.
-bma_path="\${BMA_HOME:-\$HOME/.bash-my-aws}"
+bma_path="@out@"
EOF
# load in all the completions from scripts/completions

View File

@@ -0,0 +1,52 @@
diff --git a/test/stack-spec.sh b/test/stack-spec.sh
index f04a10c..1165953 100755
--- a/test/stack-spec.sh
+++ b/test/stack-spec.sh
@@ -72,28 +72,30 @@ describe "_bma_stack_template_arg:" "$(
)"
-[[ -d cloudformation/params ]] || mkdir -p cloudformation/params
+TEST_DIR=$(mktemp -d)
+
+[[ -d "$TEST_DIR"/cloudformation/params ]] || mkdir -p "$TEST_DIR"/cloudformation/params
# templates
touch \
- $(dirname $0)/cloudformation/great-app.json \
- $(dirname $0)/cloudformation/great-app.yml \
- $(dirname $0)/cloudformation/great-app.yaml \
+ "$TEST_DIR"/cloudformation/great-app.json \
+ "$TEST_DIR"/cloudformation/great-app.yml \
+ "$TEST_DIR"/cloudformation/great-app.yaml \
# params
[[ -d params ]] || mkdir params
touch \
- $(dirname $0)/cloudformation/great-app-params.json \
- $(dirname $0)/cloudformation/great-app-params-staging.json \
- $(dirname $0)/cloudformation/great-app-params-another-env.json \
- $(dirname $0)/cloudformation/params/great-app-params.json \
- $(dirname $0)/cloudformation/params/great-app-params-staging.json \
- $(dirname $0)/cloudformation/params/great-app-params-another-env.json
+ "$TEST_DIR"/cloudformation/great-app-params.json \
+ "$TEST_DIR"/cloudformation/great-app-params-staging.json \
+ "$TEST_DIR"/cloudformation/great-app-params-another-env.json \
+ "$TEST_DIR"/cloudformation/params/great-app-params.json \
+ "$TEST_DIR"/cloudformation/params/great-app-params-staging.json \
+ "$TEST_DIR"/cloudformation/params/great-app-params-another-env.json
-cd $(dirname $0)/cloudformation
+cd "$TEST_DIR"/cloudformation
describe "_bma_stack_args:" "$(
context "without an argument" "$(
@@ -115,3 +117,5 @@ describe "_bma_stack_args:" "$(
)"
cd -
+
+rm -rf "$TEST_DIR"

View File

@@ -0,0 +1,103 @@
{
lib,
stdenv,
makeWrapper,
awscli2,
jq,
unixtools,
fetchFromGitHub,
installShellFiles,
bashInteractive,
getopt,
python3,
}:
let
runtimeDeps = [
awscli2
jq
unixtools.column
bashInteractive
getopt
(python3.withPackages (ps: [ ps.jmespath ]))
];
in
stdenv.mkDerivation {
pname = "bash-my-aws";
version = "0-unstable-2025-01-22";
src = fetchFromGitHub {
owner = "bash-my-aws";
repo = "bash-my-aws";
rev = "d338b43cc215719c1853ec500c946db6b9caaa11";
sha256 = "sha256-PR52T6XCrakQsBOJXf0PaYpYE5oMcIz5UDA4I9B7C38=";
};
dontConfigure = true;
propagatedBuildInputs = runtimeDeps;
nativeBuildInputs = [
makeWrapper
installShellFiles
bashInteractive
];
patches = [
./0001-update-paths-to-placeholders.patch
./0002-fix-tests.patch
];
postPatch = ''
patchShebangs --build ./scripts
substituteAllInPlace ./scripts/build
substituteAllInPlace ./scripts/build-completions
substituteAllInPlace ./bin/bma
'';
buildPhase = ''
runHook preBuild
./scripts/build
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out
cp -r . $out
cat > $out/bin/bma-init <<EOF
echo source $out/aliases
EOF
chmod +x $out/bin/bma-init
installShellCompletion --bash --name bash-my-aws.bash $out/bash_completion.sh
runHook postInstall
'';
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
pushd $out
make test
popd
runHook postInstallCheck
'';
preFixup = ''
wrapProgram $out/bin/bma --prefix PATH : ${lib.makeBinPath runtimeDeps}
# make lib file executable so they are picked up by patchShebangs
chmod +x $out/lib/*
'';
meta = with lib; {
homepage = "https://bash-my-aws.org";
description = "CLI commands for AWS";
license = licenses.mit;
maintainers = with maintainers; [ tomberek ];
mainProgram = "bma";
};
}