Skip to content

Commit 01944a2

Browse files
committed
Install awscli
1 parent 648300b commit 01944a2

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

.buildkite/hooks/pre-command

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,8 @@ if [[ "$BUILDKITE_PIPELINE_SLUG" == "elastic-agent-binary-dra" ]]; then
5656
release_manager_login
5757
fi
5858
fi
59+
60+
if [[ "$BUILDKITE_STEP_KEY" == "unit-tests-2204" ]]; then
61+
.buildkite/scripts/install-awscli.sh
62+
fi
63+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
echo "--- Install awscli"
5+
6+
DEFAULT_HOME="/usr/local"
7+
HOME=${HOME:?$DEFAULT_HOME}
8+
HOME_BIN="${HOME}/bin"
9+
AWSCLI_INSTALL_DIR="${HOME}/awscli"
10+
11+
if command -v aws
12+
then
13+
set +e
14+
echo "Found awscli."
15+
fi
16+
17+
echo "Installing awscli"
18+
19+
mkdir -p "${HOME_BIN}"
20+
mkdir -p "${AWSCLI_INSTALL_DIR}"
21+
22+
OS=$(uname -s| tr '[:upper:]' '[:lower:]')
23+
ARCH=$(uname -m| tr '[:upper:]' '[:lower:]')
24+
25+
curl "https://awscli.amazonaws.com/awscli-exe-linux-${ARCH}.zip" -o "awscliv2.zip"
26+
unzip awscliv2.zip
27+
./aws/install --bin-dir "${HOME_BIN}" --install-dir "${AWSCLI_INSTALL_DIR}"
28+

0 commit comments

Comments
 (0)