Skip to content

Commit

Permalink
bash_profile: Add support for building Mesos in Azure.
Browse files Browse the repository at this point in the history
Also made tfs-specific code optional. This should be refactored out
at some point down the road.
  • Loading branch information
jeffaco committed Feb 8, 2018
1 parent abaf806 commit 5c159ff
Showing 1 changed file with 38 additions and 21 deletions.
59 changes: 38 additions & 21 deletions nix/bash_profile/bash_profile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ export NO_AT_BRIDGE=1

WINDOWS_DOMAIN=REDMOND
WINDOWS_USERNAME=$USER
export TF_DIFF_COMMAND='diff -u --label "%6 / %7" "%1" "%2"'
export TF_AUTO_SAVE_CREDENTIALS=1

# Include GIT auto-completion script if it exists
# [ -f ~/.git-completion.bash ] && source ~/.git-completion.bash
Expand All @@ -45,12 +43,14 @@ PRIMARY_SYSTEM=jc64-cent7x-01

# Note: We're now picking up the development hosts from the .pbuild file

# DEVELOPMENT_LIST=(`egrep ^host: ~/.pbuild | egrep -e '[[:space:]]main$' -e '[[:space:]]main[[:space:]]' | awk '{print $3}'`)
DEVELOPMENT_LIST=( `egrep ^host: ~/.pbuild | awk '{print $3}' | sort -u` )
SYSTEM_LIST=( ${DEVELOPMENT_LIST[*]}
ostcdev-cent6-10 ostcdev64-cent6-01
)
BUILD_LIST=( `egrep ^host: ~/.pbuild | egrep 'build.*nip$' | awk '{print $3}' | sort -u` )
if [ -f ~/.pbuild ]; then
# DEVELOPMENT_LIST=(`egrep ^host: ~/.pbuild | egrep -e '[[:space:]]main$' -e '[[:space:]]main[[:space:]]' | awk '{print $3}'`)
DEVELOPMENT_LIST=( `egrep ^host: ~/.pbuild | awk '{print $3}' | sort -u` )
SYSTEM_LIST=( ${DEVELOPMENT_LIST[*]}
ostcdev-cent6-10 ostcdev64-cent6-01
)
BUILD_LIST=( `egrep ^host: ~/.pbuild | egrep 'build.*nip$' | awk '{print $3}' | sort -u` )
fi

# Random other aliases and enviornment variables

Expand Down Expand Up @@ -93,16 +93,27 @@ else
alias ls="ls -p"
fi

# Try and find teamprise (print warning if not found)
# Try and find teamprise (if found, set it up)

if [ -f /opt/teamprise/tf ]; then
export TF_DIFF_COMMAND='diff -u --label "%6 / %7" "%1" "%2"'
export TF_AUTO_SAVE_CREDENTIALS=1

if [ -d /opt/tfprox/bin ]; then
export PATH=/opt/teamprise:/opt/tfprox/bin/:$PATH
else
echo "Warning: tfprox does not exist, tf not available" >&2
fi
else
echo "Warning: tf does not exist, tf not available" >&2

# Check if tfproxy is running
if [ -x /opt/tfprox/bin/tfprox ]; then
if ! ps -aef | grep -i tfprox | grep -v grep > /dev/null; then
echo "Starting tfproxy..."
if ! sudo /opt/tfprox/bin/tfprox -b; then
echo "Fatal error: Unable to start tfproxy..."
fi
fi
fi
fi

# If Rational tools (purify & friends) are around, run initialization files
Expand Down Expand Up @@ -225,16 +236,6 @@ esac

unset S_HOSTNAME

# Check if tfproxy is running
if [ -x /opt/tfprox/bin/tfprox ]; then
if ! ps -aef | grep -i tfprox | grep -v grep > /dev/null; then
echo "Starting tfproxy..."
if ! sudo /opt/tfprox/bin/tfprox -b; then
echo "Fatal error: Unable to start tfproxy..."
fi
fi
fi

# Deal with "go" if it's installed

if [ -d /usr/local/go ]; then
Expand Down Expand Up @@ -300,11 +301,21 @@ if [ -d ~/.pyenv ]; then
eval "$(pyenv virtualenv-init -)"
fi

#
# Support for building mesos
#

if [ -d /opt/mesos-format/bin ]; then
export PATH=$PATH:/opt/mesos-format/bin
fi


#
# Functions
#

if [ -f ~/.pbuild ]; then

distribute_host()
{
if [ $HOSTNAME != "$PRIMARY_SYSTEM" ]; then
Expand Down Expand Up @@ -353,10 +364,14 @@ distribute_startup()
return 0;
}

fi

# Function: tfs_activate_license
#
# Activate a license for SCX development

if [ -f /opt/teamprise/tf ]; then

tfs_activate_license()
{
# Do the licensing ...
Expand Down Expand Up @@ -770,6 +785,8 @@ tfs_rebuild()
fi
}

fi

# Function: global_find
#
# Search for a string globally throughout a directory structure
Expand Down

0 comments on commit 5c159ff

Please sign in to comment.