Skip to content

Commit b5722d4

Browse files
author
Seth Goings
committed
feat(contrib/vagrant): auto discover DEISCTL_TUNNEL via Vagrant
1 parent 799e559 commit b5722d4

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

contrib/vagrant/config.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export SUGGEST_DEIS_TEST_DOMAIN="local3.deisapp.com"
2-
export SUGGEST_DEIS_SSH_KEY="${HOME}/.vagrant.d/insecure_private_key"
2+
export DEIS_TEST_SSH_KEY="${HOME}/.vagrant.d/insecure_private_key"
3+
export SUGGEST_DEIS_SSH_KEY="${DEIS_TEST_SSH_KEY}"
34

4-
rigger-save-vars SUGGEST_DEIS_TEST_DOMAIN SUGGEST_DEIS_SSH_KEY
5+
rigger-save-vars SUGGEST_DEIS_TEST_DOMAIN SUGGEST_DEIS_SSH_KEY DEIS_TEST_SSH_KEY

contrib/vagrant/create

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

3+
set -eo pipefail -o nounset
4+
5+
function deisctl-tunnel {
6+
local port="$(vagrant ssh-config deis-01 \
7+
| grep Port \
8+
| awk '{print $2}')"
9+
local ip="$(vagrant ssh-config deis-01 \
10+
| grep HostName \
11+
| awk '{print $2}')"
12+
echo "${ip}:${port}"
13+
}
14+
315
(
416
cd ${DEIS_ROOT}
517
vagrant up --provider virtualbox
618
)
719

8-
export DEISCTL_TUNNEL="${DEISCTL_TUNNEL:-127.0.0.1:2222}"
20+
export DEISCTL_TUNNEL="$(deisctl-tunnel)"
921
rigger-save-vars DEISCTL_TUNNEL

0 commit comments

Comments
 (0)