Relocated path helpers to be accessible earlier

This commit is contained in:
James Patrick 2022-05-24 18:56:59 +00:00
parent 5b8611d5d3
commit 422d8dc8a6
2 changed files with 15 additions and 15 deletions

View File

@ -0,0 +1,14 @@
export build_dir="/opt/build"
export apps_dir="/mount/data0/apps"
for build_path in $build_dir/* ; do
if [[ $build_path =~ "shared" ]]; then
continue;
fi
# get the env name from the full path.
local env_name=$(basename $build_path )
eval "export ${env_name}_build=${build_path}"
eval "export ${env_name}_app=${apps_dir}/${env_name}"
eval "export ${env_name}_logs=${apps_dir}/${env_name}/logs"
done

View File

@ -1,6 +1,6 @@
##### Aliases ##### Aliases
# Database Connection
db_envs=(cadev ildev indev ladev txdev utdev mddev) db_envs=(cadev ildev indev ladev txdev utdev mddev)
# Database Connection
for env in $db_envs ; do for env in $db_envs ; do
eval "alias psql_$env='psql -d $env -h dev.cpmixkhfrend.us-east-1.rds.amazonaws.com -p 5432 -U ${env}_owner'" eval "alias psql_$env='psql -d $env -h dev.cpmixkhfrend.us-east-1.rds.amazonaws.com -p 5432 -U ${env}_owner'"
if (( $+commands[pgcli] )); then if (( $+commands[pgcli] )); then
@ -12,17 +12,3 @@ done
alias psql_l="psql -h dev.cpmixkhfrend.us-east-1.rds.amazonaws.com -p 5432 -U greenfiling -l" alias psql_l="psql -h dev.cpmixkhfrend.us-east-1.rds.amazonaws.com -p 5432 -U greenfiling -l"
# Sign-In as limited super user. # Sign-In as limited super user.
alias psql_root="psql -d postgres -h dev.cpmixkhfrend.us-east-1.rds.amazonaws.com -p 5432 -U greenfiling" alias psql_root="psql -d postgres -h dev.cpmixkhfrend.us-east-1.rds.amazonaws.com -p 5432 -U greenfiling"
##### Conveniences
#############################################################################################################
export build_dir="/opt/build"
export apps_dir="/mount/data0/apps"
for build_path in $build_dir/^shared ; do
# get the env name from the full path.
local env_name=$(basename $build_path )
eval "export ${env_name}_build=${build_path}"
eval "export ${env_name}_app=${apps_dir}/${env_name}"
eval "export ${env_name}_logs=${apps_dir}/${env_name}/logs"
done