2019-07-19 14:56:48 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
## Make a temp dir
|
|
|
|
tempdir=$(mktemp -d update-plugin-modules.XXXXXX)
|
|
|
|
|
|
|
|
## Set paths
|
|
|
|
cd $tempdir
|
|
|
|
|
|
|
|
## Get Vault
|
|
|
|
echo "Fetching vault..."
|
|
|
|
git clone https://github.com/hashicorp/vault
|
|
|
|
|
|
|
|
for plugin in $(grep github.com/hashicorp/vault-plugin- vault/go.mod | cut -f 2 | cut -d ' ' -f 1 | cut -d '/' -f 3)
|
|
|
|
do
|
2019-07-22 16:56:13 +00:00
|
|
|
if [ -z $SKIP_MODULE_UPDATING ]
|
2019-07-19 14:56:48 +00:00
|
|
|
then
|
2019-07-22 16:56:13 +00:00
|
|
|
echo "Fetching $plugin..."
|
|
|
|
git clone https://github.com/hashicorp/$plugin
|
|
|
|
cd $plugin
|
|
|
|
rm -rf vendor
|
2019-07-25 16:38:47 +00:00
|
|
|
go get github.com/hashicorp/vault/api${API_BRANCH}
|
2019-07-22 16:56:13 +00:00
|
|
|
go mod tidy
|
|
|
|
go mod vendor
|
|
|
|
git add .
|
|
|
|
git commit --allow-empty -m "Updating vault dep"
|
|
|
|
if [ ! -z $PUSH_COMMITS ]
|
|
|
|
then
|
|
|
|
git push
|
|
|
|
fi
|
|
|
|
cd ..
|
2019-07-19 14:56:48 +00:00
|
|
|
fi
|
|
|
|
cd vault
|
2021-06-18 18:24:54 +00:00
|
|
|
go get github.com/hashicorp/$plugin@main
|
2019-07-19 14:56:48 +00:00
|
|
|
cd ..
|
|
|
|
done
|
|
|
|
|
|
|
|
cd vault
|
|
|
|
go mod tidy
|
|
|
|
rm -rf vendor
|
|
|
|
go mod vendor
|
|
|
|
git add .
|
|
|
|
git commit --allow-empty -m "Updating plugin deps"
|
2019-08-14 21:02:14 +00:00
|
|
|
if [ ! -z $PUSH_VAULT_COMMIT ]
|
2019-07-19 14:56:48 +00:00
|
|
|
then
|
|
|
|
git push
|
|
|
|
fi
|