I'm using this plugin for my Gradle: https://gradle-ssh-plugin.github.io/
I've added a new task called delete
which is supposed to delete certain folders and files. So I wrote the following:
task delete {
ssh.run {
session(remotes.web01) {
execute 'cd /var/www/html/; rm -rf *'
}
}
}
But this wouldn't do anything. When I execute ./gradlew delete
, it will just say
:delete UP-TO-DATE
BUILD SUCCESSFUL
Total time: 4.367 sec
I can't seem to figure out why my folders and files are not being deleted. Just to make sure my session run was okay, I ran execute 'cd /var/www/html/; mkdir test'
instead of what I originally had and it did create a folder called "test". And after putting some files in there, when I replaced the execute command with execute 'cd /var/www/html/; rm -rf test'
, it did delete the folder properly.
I made sure that all the folders and files' are both readable and writable.
Any idea what I'm supposed to do?