Skip to content

Latest commit

 

History

History
79 lines (63 loc) · 2.53 KB

rsync.md

File metadata and controls

79 lines (63 loc) · 2.53 KB

Guide to be able to use rsync from your local computer. RSYNC will upload the files to the server. This is a bit more stable than FTP, which hanged now and then.

Mac OS X

The step below has to be done only once.

Migrating a project from FTPUSH to RSYNC usage

If an existing project still uses ftpush, it has to be migrated. To do this, do the following. NOTE: this will not work for the very old grunt projects, since they do not have a deploy directory yet.

  • Run npm install grunt-rsync-2 --save-dev
  • Uninstall grunt-ftpush: npm uninstall grunt-ftpush --save-dev
  • In your Gruntfile.js, change all the notions of the word ftpush to rsync.
  • Do the same in the file /util/grunt/watch.js.
  • Add a new file called rsync.js to /util/grunt, and put in the following contents:
// -------------------------------------
// rsync.js -  Grunt RSYNC way of deploying
// -------------------------------------

module.exports = {
	deploy_child: {
		files: "dist/child/",
		options: {
			host: "vps8063.xlshosting.net",
			port: "1023",
			user: "ftpsecure",
			remoteBase: "/var/www/wp-content/themes/slate-<%= package.version %>_<%= package.name %>"
		}
	},
	deploy_parent: {
		files: "dist/parent/",
		options: {
			host: "vps8063.xlshosting.net",
			port: "1023",
			user: "ftpsecure",
			remoteBase: "/var/www/wp-content/themes/slate-<%= package.version %>"
		}
	},
	init_deploy_child: {
		files: "dist/child/",
		options: {
			host: "vps8063.xlshosting.net",
			port: "1023",
			user: "ftpsecure",
			remoteBase: "/var/www/wp-content/themes/slate-<%= package.version %>_<%= projectName %>"
		}
	},

};
  • In Gruntfile.js, add the following code, right below the grunt.registerTask('develop'.... block:
  grunt.registerTask('sync', 'RSyncs the runtime (child theme) to the server.', [
	 'rsync:deploy_child', 
  ]);

  grunt.registerTask('sync2', 'RSyncs the runtime (parent theme) to the server.', [
	 'rsync:deploy_parent', 
  ]);