Skip to content

Commit f62da67

Browse files
authored
use service accounts in provider and add 'storage-ro' scope (#971)
* use service accounts in provider and add 'storage-ro' scope * add labels
1 parent 7e4cb24 commit f62da67

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

.buildkite/vagrant-run.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

33
cd "$(dirname "${BASH_SOURCE[0]}")/.."
4-
set -euxo pipefail
4+
set -euo pipefail
55

66
box="$1"
77
exit_code=0
@@ -12,6 +12,7 @@ cleanup() {
1212
vagrant destroy -f "$box"
1313
}
1414

15+
echo --- ":vagrant: installing plugins"
1516
plugins=(vagrant-google vagrant-env vagrant-scp)
1617
for i in "${plugins[@]}"; do
1718
if ! vagrant plugin list --no-tty | grep "$i"; then
@@ -20,6 +21,7 @@ for i in "${plugins[@]}"; do
2021
done
2122

2223
trap cleanup EXIT
24+
echo --- ":vagrant: starting box $box"
2325
vagrant up "$box" --provider=google || exit_code=$?
2426

2527
if [ "$exit_code" != 0 ]; then

test/Vagrantfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,14 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
4444
g.network = server['network']
4545
g.external_ip = external_ip
4646
g.use_private_ip = use_private_ip
47+
g.service_account = server['service_account']
48+
g.labels = {
49+
"team" => "dev-infra",
50+
"type" => "vagrant"
51+
}
4752
g.scopes = [
48-
"compute-rw"
53+
"compute-rw",
54+
"storage-ro"
4955
]
5056
o.ssh.username = username
5157
o.ssh.private_key_path = ssh_key_path

test/servers.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
network: default
99
username: buildkite
1010
ssh_key_path: "~/.ssh/id_rsa"
11+
service_account: [email protected]
1112
shell_commands:
1213
- "/deploy-sourcegraph-docker/test/smoke-test.sh"
1314

test/smoke-test.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#!/usr/bin/env bash
22
set -euxfo pipefail
33

4+
configure_docker() {
5+
gcloud auth configure-docker
6+
gcloud auth configure-docker us-central1-docker.pkg.dev
7+
}
8+
49
deploy_sourcegraph() {
510
cd $(dirname "${BASH_SOURCE[0]}")/..
611
#Deploy sourcegraph
@@ -64,6 +69,7 @@ catch_errors() {
6469

6570
trap catch_errors EXIT
6671

72+
configure_docker
6773
deploy_sourcegraph
6874
test_count
6975
test_containers

0 commit comments

Comments
 (0)