How do I deploy using Grunt?

6

I want to deploy via FTP using Grunt, I have seen some tutorials but I do not know how to configure Gruntfile.js nor the task that I should use to deploy and also if I need other resources to deploy, for example configure something on the server.

Can anyone help me?

implemented

So, I'm using the Roots project as a template for my Wordpress site, and the Gruntfile.js of this project is this: link

I do not know how to use deploy via FTP, there are tasks for everything I do in Gruntfile.js less to deploy. This is the file for my project.

I wanted to know how I use the task to deploy via FTP.

    
asked by anonymous 27.01.2015 / 22:23

2 answers

1

Try this guy:

link

Your API is highly explanatory.

Here is the plugin:

link

In general you will have to do the following in GruntFile:

 dploy: {                                    // Task
        stage: {                                // Target
            host: "ftp.myserver.com"            // Your FTP host
            user: "user"                        // Your FTP user
            pass: "secret-password"             // Your FTP secret-password
            path: {
                local: "deploy/",               // The local folder that you want to upload
                remote: "public_html/"          // Where the files from the local file will be uploaded at in your remote server
            }
        }
    
27.01.2015 / 22:39
0

Use the grunt-ftpush plugin ( link ), this plugin you can allow folders or files that will NOT be sent via FTP through the 'exclusions' parameter.

In 'src' I usually only put a './' , which means that it is pointing to the project's own (src: './') directory on your machine.

In 'dest' , you put the full path of the remote directory, for example: '/ public_html / wordpress / wp-content / themes / roots-master' .

To use 'authkey' , you have to create a .ftppass file in the directory you use to rotate the Grunt JS commands, that is, project.

In the documentation explains everything, it is in English but to know.

Good luck

    
28.01.2015 / 09:39