Create directories during deploy

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Create directories during deploy

Gloria Palma
This post was updated on .
Hi, i have a problem, i need create directories during deploy , i try create the folder's in the BuilgConfig.groovy, but this not function.

My method (Service):

public  void createDirectories(){
        try{
            List<String> filesTrash=[
                    "web-app/NotificationFiles/",
                    "web-app/NotificationFiles/DEV/",
                    "web-app/NotificationFiles/DEV/CORP/",
                    "web-app/NotificationFiles/PROD/",
                    "web-app/NotificationFiles/PROD/CORP/",
                    "web-app/NotificationFiles/PROD/PERSONAL/",
                    "web-app/NotificationFiles/",
                    "web-app/NotificationFiles/UAT/",
                    "web-app/NotificationFiles/UAT/CORP/",
                    "web-app/NotificationFiles/UAT/PERSONAL/",
                    "web-app/RallyFiles/",
                    "web-app/RallyFiles/DEV/",
                    "web-app/RallyFiles/PROD/",
                    "web-app/RallyFiles/UAT/",
                    "web-app/SorteoFiles/",
                    "web-app/SorteoFiles/Buy/",
                    "web-app/SorteoFiles/Buy/DEV/",
                    "web-app/SorteoFiles/Buy/PROD/",
                    "web-app/SorteoFiles/Buy/UAT/",
                    "web-app/stickers/"
            ]

            filesTrash.each {
                new File(it).mkdir()
            }

        }catch (Exception ex){
            log. error(ex.getMessage())
        }
    }


But directories are not being created.