From the course: Learning Static Site Building with Hugo
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Upload the site content
From the course: Learning Static Site Building with Hugo
Upload the site content
- The last thing that Deployment Script needs to do is actually deploy the files. We'll write two methods to do this. One that creates any folders we need on the server and then one that uploads the files themselves. I'll start with the Create Directories For function. We get a list of local items, so what I want to do is let Directories to create coming from items.filter pull out any item from that list of items that's a directory. We'll say given the path we'll select or filter everything where the path is a directory. Now, all we need to do is returnpromise.all because we're going to do multiple operations here. We'll say directories to create.map for each directory, we need to do sftp.mkdir, make directory we'll say dir.remotepath because we know what the remote path is supposed to be already. And we will want to do it recursively, if necessary. Then after that's done, we'll say .then and this should be familiar by now. We'll do console.log created directory and just output the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
Deploy via FTP overview2m 2s
-
(Locked)
Set up Node and npm1m 40s
-
(Locked)
Connect to the server7m 21s
-
(Locked)
Collect the local files4m 51s
-
(Locked)
Remove old files from the server5m 39s
-
(Locked)
Upload the site content2m 43s
-
(Locked)
Deploy via FTP with Travis CI1m 57s
-
(Locked)
FTP next steps1m 2s
-
-
-
-