vault/scripts/update_plugin_modules.sh
Vault Automation 58e59e67b2
Backport license: update headers to IBM Corp. into release/1.21.x+ent (#10234) (#10252)
* license: update headers to IBM Corp.
* `make proto`
* update offset because source file changed
* update licenses in files that were not included in backport

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2025-10-21 15:20:35 -06:00

52 lines
969 B
Bash
Executable File

#!/bin/sh
# Copyright IBM Corp. 2016, 2025
# SPDX-License-Identifier: BUSL-1.1
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
if [ -z $SKIP_MODULE_UPDATING ]
then
echo "Fetching $plugin..."
git clone https://github.com/hashicorp/$plugin
cd $plugin
rm -rf vendor
go get github.com/hashicorp/vault/api${API_BRANCH}
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 ..
fi
cd vault
go get github.com/hashicorp/$plugin@main
cd ..
done
cd vault
go mod tidy
rm -rf vendor
go mod vendor
git add .
git commit --allow-empty -m "Updating plugin deps"
if [ ! -z $PUSH_VAULT_COMMIT ]
then
git push
fi