Removed scenario --tail.

This commit is contained in:
Leon Radeck committed 2018-01-22 20:38:45 +01:00
1 parent 51870dadf4
commit b68c2a18ef
4 files changed
+3 -51

No files matched your search

+2 -9
View File
@@ -127,7 +127,6 @@ usage() {
--associate-alb Associate instance with existing application load balancer whos
listener is defined in variables_aws.sh. Automatically
create necessary target group and host name rule.
--tail Tail logs from instance using tmux
${bold}Other:${reset}
--version Output version information and exit
@@ -140,12 +139,8 @@ usage() {
Associate application load balancer:
> ./aws-setup.sh --instance --associate-alb
Associate instance with application load balancer while
automatically tailing important log files (tmux required):
> ./aws-setup.sh --instance --associate-alb --tail
Tail logfiles of running instance with dns name:
> ./aws-setup.sh --tail --public-dns-name ec2-x.compute.amazonaws.com
Associate instance with application load balancer:
> ./aws-setup.sh --instance --associate-alb
Create instance and use default values:
> ./aws-setup.sh --instance --force
@@ -202,7 +197,6 @@ unset options
associate_alb=false
instance=false
sub_instance=false
tail=false
# Read the options and set variables
while [[ $1 = -?* ]]; do
@@ -230,7 +224,6 @@ while [[ $1 = -?* ]]; do
--instance) instance=true ;;
--sub-instance) sub_instance=true ;;
--associate-alb) associate_alb=true ;;
--tail) tail=true ;;
--endopts) shift; break ;;
*) die "invalid option: '$1'." ;;
esac
@@ -80,7 +80,7 @@ function check_dependencies() {
function check_environment() {
if ! inside_tmux_session; then
echo "To tail instance log files, please run this script inside a tmux session. To do so enter \"tmux\" into the console and start the script from there."
echo "Please run this script inside a tmux session. To do so enter \"tmux\" into the console and start the script from there."
safeExit
fi
}
@@ -48,11 +48,6 @@ function instance_execute() {
wait_for_ssh_connection $ssh_user $public_dns_name
# if --tail option is passed then tail logfiles of instance within tmux
if $tail; then
tail_start
fi
header "Event and user creation"
port="8888"
access_token=$(get_access_token $admin_username $admin_password $public_dns_name $port)
@@ -1,36 +0,0 @@
#!/usr/bin/env bash
function tail_start(){
tail_precondition
tail_user_input
tail_execute
}
function tail_precondition(){
check_if_tmux_is_used
}
# -----------------------------------------------------------
# All these variables are needed for this scenario
# If one variable is not assigned or passed by parameter
# the user will be prompted to enter a value
# -----------------------------------------------------------
function tail_user_input(){
require_key_file
require_ssh_user
require_public_dns_name
}
function tail_execute() {
echo "Open tmux panes and start tailing log files..."
construct_ui
wait_for_ssh_connection "$ssh_user" "$public_dns_name"
open_connections "$ssh_user" "$public_dns_name"
tail_logfiles
}
function tail_logfiles(){
tmux send-keys -t 1 "clear;echo \"Waiting for file $sailing_0 to appear...\";touch $sailing_0;cat $sailing_0;tail -F -v $sailing_0" C-m
tmux send-keys -t 2 "clear;cat $sailing_out;tail -F -v $sailing_out" C-m
tmux send-keys -t 3 "clear;cat $sailing_err;tail -F -v $sailing_err" C-m
}