Created
July 15, 2016 01:22
-
-
Save jmcarp/911e81b7c38dfe8c833baeb255173874 to your computer and use it in GitHub Desktop.
jumpbox
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/expect | |
| set timeout 30 | |
| set target [lindex $argv 0]; | |
| set environment [lindex $argv 1]; | |
| spawn ./trigger.sh $target $environment | |
| expect "choose a container" | |
| set lines [split $expect_out(buffer) \n] | |
| set count [llength $lines] | |
| set index [expr {$count - 3}] | |
| send $index\r | |
| interact |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #/bin/bash | |
| set -e | |
| target=${1} | |
| environment=${2} | |
| trigger=$(fly -t ${target} trigger-job -j jumpbox/container-bosh-${environment}) | |
| build=$(echo ${trigger} | sed 's/.*#\([0-9]\{1,\}\)/\1/') | |
| while ! containers=$(fly -t ${target} containers | grep "task" | grep "container-bosh-${environment}\s\{1,\}${build}\s") | |
| do | |
| sleep 1 | |
| done | |
| fly -t ${target} intercept -j jumpbox/container-bosh-${environment} -b ${build} -s jumpbox |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment