Skip to content

Commit ccc45ad

Browse files
committed
fetch builder key and set env var for vagrant provider
1 parent d70d150 commit ccc45ad

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.buildkite/vagrant-run.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ cleanup() {
1313
}
1414

1515
echo --- ":vagrant: installing plugins"
16-
plugins=(vagrant-google vagrant-env vagrant-scp)
16+
plugins=("vagrant-google --plugin-version '2.7.0'" vagrant-env vagrant-scp)
1717
for i in "${plugins[@]}"; do
1818
vagrant plugin list --no-tty
1919
if ! vagrant plugin list --no-tty | grep "$i"; then
@@ -24,9 +24,16 @@ done
2424
trap cleanup EXIT
2525

2626
echo --- ":bug: fixing dotenv"
27-
echo "see Fix plugin: https://github.com/hashicorp/vagrant/issues/13550"
27+
echo "see fix: https://github.com/hashicorp/vagrant/issues/13550"
2828
sed -i -e 's/exists?/exist?/g' /var/lib/buildkite-agent/.vagrant.d/gems/3.3.8/gems/dotenv-0.11.1/lib/dotenv.rb
2929

30+
echo --- ":lock: builder account key"
31+
KEY_PATH="/tmp/e2e-builder.json"
32+
if [ ! -f ${KEY_PATH} ];
33+
gcloud secrets versions access latest --secret=e2e-builder-sa-key --quiet --project=sourcegraph-ci > "${KEY_PATH}"
34+
fi
35+
export GOOGLE_JSON_KEY_LOCATION="${KEY_PATH}"
36+
3037
echo --- ":vagrant: starting box $box"
3138
vagrant up "$box" --provider=google || exit_code=$?
3239

0 commit comments

Comments
 (0)