Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e93e1f676f | |||
| 46eead797f | |||
| a6a37edec3 |
+1
-1
@@ -1 +1 @@
|
||||
0.5.9
|
||||
0.6.3
|
||||
@@ -146,7 +146,7 @@ confirm
|
||||
|
||||
for cmd in "${cmd_arr[@]}"
|
||||
do
|
||||
echo ${cmd} && eval ${cmd}
|
||||
pwd && echo ${cmd} && eval ${cmd}
|
||||
done
|
||||
|
||||
cd ${HOME}
|
||||
|
||||
+10
-9
@@ -15,11 +15,11 @@ fi
|
||||
|
||||
if [ "${Version}" == "" ]
|
||||
then
|
||||
usage
|
||||
Version=latest
|
||||
fi
|
||||
|
||||
# ----- Settings
|
||||
LocalSoftwareDir=${HOME}/software
|
||||
LocalSoftwareDir=${HOME}/software/cvtt2
|
||||
|
||||
ProdDir=${HOME}/prod
|
||||
|
||||
@@ -29,8 +29,6 @@ ReleaseUsers=("cvttdist")
|
||||
ReleaseDir=("/home/cvttdist/software/cvtt2")
|
||||
# ----- Settings
|
||||
|
||||
Location="${LocalSoftwareDir}/${Project}/${Version}/${Project}"
|
||||
|
||||
function rsync_load_version() {
|
||||
for idx in "${!ReleaseHosts[@]}"
|
||||
do
|
||||
@@ -39,6 +37,11 @@ function rsync_load_version() {
|
||||
user=${ReleaseUsers[${idx}]}
|
||||
rel_dir=${ReleaseDir[${idx}]}
|
||||
|
||||
if [ "${Version}" == "latest" ]; then
|
||||
echo "Checking for latest version of ${Project} on ${user}@${host}:${rel_dir}"
|
||||
Version=$(ssh -q -p ${port} ${user}@${host} "ls -tr ${rel_dir}/${Project} | tail -1" )
|
||||
echo "Latest version is ${Version}"
|
||||
fi
|
||||
echo "Checking ${user}@${host} for ${rel_dir}/${Project}/${Version} ..."
|
||||
if ssh -q -p ${port} ${user}@${host} "test -d ${rel_dir}/${Project}/${Version}"
|
||||
then
|
||||
@@ -67,16 +70,14 @@ function rsync_load_version() {
|
||||
mkdir -p ${LocalSoftwareDir}
|
||||
|
||||
# exists and not empty
|
||||
if [[ ! -d "${Location}" ]] ; then
|
||||
rsync_load_version
|
||||
fi
|
||||
|
||||
Location="${LocalSoftwareDir}/${Project}/${Version}/${Project}"
|
||||
|
||||
Cmd="cd ${ProdDir}"
|
||||
|
||||
Cmd="${Cmd} && rm -rf ${Project}"
|
||||
Cmd="${Cmd} && ln -snf ${Location} ${Project}"
|
||||
|
||||
echo ${Cmd}
|
||||
eval ${Cmd}
|
||||
echo ${Cmd} && eval ${Cmd}
|
||||
|
||||
echo "Done: $0 $*"
|
||||
|
||||
Reference in New Issue
Block a user