Book Image

Grunt Cookbook

By : Jurie-Jan Botha
Book Image

Grunt Cookbook

By: Jurie-Jan Botha

Overview of this book

<p>A web application can quickly turn into a complex orchestration of many smaller components, each one requiring its own bit of maintenance. Grunt allows you to automate all the repetitive tasks required to get everything working together by using JavaScript, the most popular programming language.</p> <p>Grunt Cookbook offers a host of easy-to-follow recipes for automating repetitive tasks in your web application's development, management, and deployment processes. This book will introduce you to methods that can be used to automate basic processes and your favorite tools. By following the recipes, you will soon be comfortable using Grunt to perform a wide array of advanced tasks in a range of different scenarios.</p>
Table of Contents (17 chapters)
Grunt Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Running commands over SSH


In this recipe, we'll make use of the sshexec task provided by the ssh (0.12.2) plugin to run commands on a remote server over the SSH network protocol.

Running commands on a remote server can become a necessity during the deployment process, and when we run commands, we'd like be sure that it is being done securely. The SSH protocol is the de facto standard to run commands on remote servers, due in part to the improved security that it provides by encrypting all data that is sent over the network.

Getting ready

In this example, we'll work with the basic project structure that we created in the Installing Grunt on a project recipe in Chapter 1, Getting Started with Grunt. Be sure to refer to it if you are not yet familiar with its contents.

In addition to the standard project setup, the following recipe will also require an existing user account on the targeted SSH-enabled server. These credentials are usually provided by the hosting service or administrator who maintains...