Compare commits

..

2 Commits

Author SHA1 Message Date
oleg e93e1f676f progress 2024-03-02 22:02:09 -05:00
oleg 46eead797f progress 2024-03-02 21:47:22 -05:00
2 changed files with 11 additions and 10 deletions
+1 -1
View File
@@ -1 +1 @@
0.6.1 0.6.3
+10 -9
View File
@@ -15,7 +15,7 @@ fi
if [ "${Version}" == "" ] if [ "${Version}" == "" ]
then then
usage Version=latest
fi fi
# ----- Settings # ----- Settings
@@ -29,8 +29,6 @@ ReleaseUsers=("cvttdist")
ReleaseDir=("/home/cvttdist/software/cvtt2") ReleaseDir=("/home/cvttdist/software/cvtt2")
# ----- Settings # ----- Settings
Location="${LocalSoftwareDir}/${Project}/${Version}/${Project}"
function rsync_load_version() { function rsync_load_version() {
for idx in "${!ReleaseHosts[@]}" for idx in "${!ReleaseHosts[@]}"
do do
@@ -39,6 +37,11 @@ function rsync_load_version() {
user=${ReleaseUsers[${idx}]} user=${ReleaseUsers[${idx}]}
rel_dir=${ReleaseDir[${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} ..." echo "Checking ${user}@${host} for ${rel_dir}/${Project}/${Version} ..."
if ssh -q -p ${port} ${user}@${host} "test -d ${rel_dir}/${Project}/${Version}" if ssh -q -p ${port} ${user}@${host} "test -d ${rel_dir}/${Project}/${Version}"
then then
@@ -67,16 +70,14 @@ function rsync_load_version() {
mkdir -p ${LocalSoftwareDir} mkdir -p ${LocalSoftwareDir}
# exists and not empty # exists and not empty
if [[ ! -d "${Location}" ]] ; then rsync_load_version
rsync_load_version
fi Location="${LocalSoftwareDir}/${Project}/${Version}/${Project}"
Cmd="cd ${ProdDir}" Cmd="cd ${ProdDir}"
Cmd="${Cmd} && rm -rf ${Project}" Cmd="${Cmd} && rm -rf ${Project}"
Cmd="${Cmd} && ln -snf ${Location} ${Project}" Cmd="${Cmd} && ln -snf ${Location} ${Project}"
echo ${Cmd} echo ${Cmd} && eval ${Cmd}
eval ${Cmd}
echo "Done: $0 $*" echo "Done: $0 $*"