occlum/demos/golang/vault/prepare_vault.sh
Kailun Qin 0f23ddb14e Add the HashiCorp Vault demo
Signed-off-by: Kailun Qin <kailun.qin@intel.com>
2021-04-16 18:32:51 +08:00

20 lines
469 B
Bash
Executable File

#!/bin/bash
set -e
src_dir="./source_code"
vault="$src_dir/bin/vault"
if [ -f "$vault" ]; then
echo "Warning: the current working directory has Vault already downloaded and built"
exit 1
fi
# download the source code of Vault v1.7.0
wget https://github.com/hashicorp/vault/archive/refs/tags/v1.7.0.tar.gz
mkdir -p $src_dir && tar -xvzf v1.7.0.tar.gz -C $src_dir --strip-components=1
# build Vault executable
pushd $src_dir
occlum-go build -o bin/vault
popd