···1717 alias be='bundle exec'
1818 export HISTFILE="$HOME/.mksh-history"
1919 export CHEFUSER="jolson"
2020- export CHEF_ENV="browse_test"
2020+ export CHEF_ENV="browse_test" # just for .chef/config.rb
2121+ export AWS_ENV="browse_test" # just for aws cli
2122 export SSHUSER="jolson"
2223 export SSHKEY="~/.ssh/id_rsa"
2324 export PASH_CLIP="pbcopy"
+20-20
bin/MACC02VK5ECHTD7/jws-fetch
···2233date=$(date +%s)
44for r in us-east-1 us-west-2; do
55- for p in browse cgraph; do
66- for e in test stage prod; do
77- dir="/tmp/jws/${r}/${p}/${e}"
88- mkdir -p "$dir"
99- echo "Fetching ${r}/${p}/${e}"
1010- aws ec2 describe-instances --profile "${p}_${e}" --region "$r" --output text --query "Reservations[*].Instances[*].{
1111- Instance:InstanceId,
1212- Type:InstanceType,
1313- AZ:Placement.AvailabilityZone,
1414- Name:Tags[?Key==\`Name\`]|[0].Value,
1515- pubIP:PublicIpAddress,
1616- IP:PrivateIpAddress,
1717- State:State.Name,
1818- VPC:VpcId
1919- }" | sed "s/$/ ${p}_${e}/" > "$dir/$date" &
2020- # add profile to end for easy greppin'
2121- # link current for other scripts
2222- ln -fs "$dir/$date" "$dir/current"
2323- done
2424- done
55+ for p in browse cgraph; do
66+ for e in test stage prod; do
77+ dir="/tmp/jws/${r}/${p}/${e}"
88+ mkdir -p "$dir"
99+ echo "Fetching ${r}/${p}/${e}"
1010+ aws ec2 describe-instances --profile "${p}_${e}" --region "$r" --output text --query "Reservations[*].Instances[*].{
1111+ Instance:InstanceId,
1212+ Type:InstanceType,
1313+ AZ:Placement.AvailabilityZone,
1414+ Name:Tags[?Key==\`Name\`]|[0].Value,
1515+ pubIP:PublicIpAddress,
1616+ IP:PrivateIpAddress,
1717+ State:State.Name,
1818+ VPC:VpcId
1919+ }" | sed "s/$/ ${p}_${e}/" > "$dir/$date" &
2020+ # add profile to end for easy greppin'
2121+ # link current for other scripts
2222+ ln -fs "$dir/$date" "$dir/current"
2323+ done
2424+ done
2525done
26262727wait