example42 / puppi

Puppet module to manage applications deployments and servers local management

Home Page:http://www.example42.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

undeploy does not work for second run

k9ert opened this issue · comments

I have an issue with a second deployment of the same war (maybe a new version). The undeploy-step waits forever because the archive.sh-script does not delete the exploded war-directory (it's there from the first deployment).

This is the setup (basically from maven-project):

if ($bool_backup_enable == true) {
puppi::deploy { "${name}-Backup_existing_WAR":
priority => '30' ,
command => 'archive.sh' ,
arguments => "-b $deploy_root -t war -s move -m diff -o '$backup_rsync_options' -n $backup_retention" ,
user => 'root' ,
project => $name ,
enable => $enable ,
}
}

if ($bool_check_deploy == true) {
puppi::deploy { "${name}-Check_undeploy":
priority => '32' ,
command => 'checkwardir.sh' ,
arguments => "-a $deploy_root/$war_file" ,
user => $user ,
project => $name ,
enable => $enable ,
}
}

The archive.sh script basically only archive the stuff which is existing in the predeploy directory:

Backup and Restore functions

backup () {
mkdir -p $archivedir/$project/$tag/$backuptag
if [ $archivedir/$project/latest ] ; then
rm -f $archivedir/$project/latest
fi
ln -sf $archivedir/$project/$tag $archivedir/$project/latest

filelist=$storedir/filelist
cd $predeploydir
find . | cut -c 3- | grep -v "^$" > $filelist

if [ "$strategy" = "move" ] ; then 
    for file in $(cat $filelist) ; do
            echo "trying to move file: $file"
        mv $backuproot/$file $archivedir/$project/$tag/$backuptag/
    done

Did that ever worked? Do i miss something?

What as are you using ? TomCat ? Jboss ?
I can assure you that I usually deploy and redepploy wars via puppi::project:war without particular problems.
On Tomcat I expect that the same AS removes (undeploys) the expanded directory when the war is move.
On Jboss when war is not exploded I usually set check_wardir to false (by default is enabled).
Hope it helps

Ops s/check_wardir/check_deploy

ANy feedback on this issue? Is it a bug or a feature? :-)

Sorry for the late answer.I was not fully aware of how this works, it's a great feature :-). I have to check why this is not working for me sometimes.