94 lines
2.2 KiB
Bash
94 lines
2.2 KiB
Bash
#!/bin/bash
|
|
|
|
#wget
|
|
#export http_proxy=devproxy.bloomberg.com:82
|
|
#export https_proxy=devproxy.bloomberg.com:82
|
|
|
|
export DOCKER_HOST=tcp://0.0.0.0:2375
|
|
|
|
if [[ "$(hostname)" == "lnxmqts01" ]]; then
|
|
export SKELETON_DEPLOY=$HOME/devel/bb/skeleton_internals
|
|
fi
|
|
|
|
#export DEV_CINC=-I.
|
|
#export DEV_CPPINC=-I.
|
|
#export DEV_FINC=-I.
|
|
|
|
#I need this to run distributor locally.
|
|
#export PGPASSFILE=$HOME/.fit_pgpass
|
|
#export PGSERVICEFILE=$HOME/.fit_pg_service.conf
|
|
|
|
export IS_64BIT=yes
|
|
BBBITS=64
|
|
#PATH=/bb/build/Linux-x86_64-64/release/robolibs/stage/opt/bb/libexec/build-base/:$PATH
|
|
#export BBTAG=$(/opt/bb/bin/robolibs-current-build --tag local --bits $BBBITS) #Doesn't work on bbvpn
|
|
export ARCHCODE=amd64
|
|
export DPKG_DISTRO=unstable
|
|
export DPKG_DISTRO_DIR=$HOME/cmake-distro-dev
|
|
#export DPKG_SNAPSHOT=$(/opt/bb/bin/dpkg-distro-current-snapshot $DPKG_DISTRO) #This is slow.
|
|
|
|
export PATH=/opt/bb/bin:$PATH
|
|
|
|
getop() { # BOX
|
|
if [[ $# -ne 1 ]]; then
|
|
echo "Usage: getop <machine>"
|
|
else
|
|
local BOX="$1"
|
|
local BIN="/bb/bin/getprdwin"
|
|
$BIN -u op1 -i -s $BOX -d "op1 for $USER on $BOX"
|
|
fi
|
|
}
|
|
|
|
git-repo-setup(){
|
|
|
|
if [[ $# -ne 0 ]]; then
|
|
echo "Usage: just run inside a bbgithub repo."
|
|
return
|
|
fi
|
|
|
|
st=$(git status)
|
|
if [[ $? -ne 0 ]]; then
|
|
echo "Looks this is not a git repo."
|
|
return
|
|
fi
|
|
|
|
us=$(git remote get-url upstream 2> /dev/null)
|
|
if [[ $? -eq 0 ]]; then
|
|
echo "Upstream already exist as $us."
|
|
return
|
|
fi
|
|
|
|
url=$(git remote get-url origin)
|
|
if [[ $? -ne 0 ]]; then
|
|
echo "Origin URL is unknown."
|
|
return
|
|
fi
|
|
|
|
re="^(.*)[/:]([^/:]*)/(.*)$"
|
|
if [[ $url =~ $re ]]; then
|
|
prefix=${BASH_REMATCH[1]}
|
|
org=${BASH_REMATCH[2]}
|
|
repo=${BASH_REMATCH[3]}
|
|
else
|
|
echo "Failed to pars the repo URL."
|
|
return
|
|
fi
|
|
|
|
upstream_repo=bbgithub:$org/$repo
|
|
origin_repo=bbgithub:vkhachatrya5/$repo
|
|
|
|
git remote rm origin
|
|
echo "Setting origin=$origin_repo"
|
|
git remote add origin $origin_repo
|
|
echo "Setting upstream=$upstream_repo"
|
|
git remote add upstream $upstream_repo
|
|
git remote -v
|
|
}
|
|
|
|
git-master-refresh(){
|
|
git fetch upstream master
|
|
git co upstream/master
|
|
git br -D master
|
|
git co -b master
|
|
}
|