For this demo we will create and deploy a new node, then deploy an update to the node.

Deployment
A deployment has two phases: adding content to a deployment plan and deploying the deployment plan. Deploying the deployment plan pushes the content added to the deployment plan to the destination server.

Deployment plans
A deployment plan groups together selected pieces of content to be pushed to the Destination server at the same time. Pieces of content can be added to a deployment plan manually, through Views Aggregation or with Rule actions.

Adding content manually

  1. On your source server go to node/add/article and create a new article. Give it whatever options you like and save it.
  2. Go to admin/content/node. Check the node you just created, choose the deployment plan that makes sense under 'Add to managed deployment plan' from Update Options, and click the Update button. Repeat for any other content.
  3. To deploy the plan, go to admin/structure/deploy and click the "Deploy" link, then confirm with the "Deploy" button.
  4. Run cron on your source server (as we selected the Queue API as Deployment processor in the installing Deploy guide)
  5. Edit the article you created at step 1 and save it.
  6. Repeat steps 2 and 3
  7. Run cron on your source server

Note: You can find messages about deployment at admin/reports/dblog

Automating deployment plans
Now that we deployed a node by adding content to the Deployment plan manually, let's have a look at this same usecase but by adding content to the deployment plan in more automated ways. (the goal is to make robots ;)

Views Aggregation

Make sure you went through all the steps of Installing Deploy. Instead of the Managed aggregator we'll be creating a Views aggregator (and a View).
On the source server:

  1. Enable the following module: Views deployment aggregator
  2. drush en deploy_aggregator_views
    
  3. Create a View that contains the entities your want to add to the Deployment plan (or don't and use the default Front page View).
  4. Now, create a deployment plan with Views Aggregation. Go to admin/structure/deploy/plans and click "Add".
  5. Give it a name like "Push to live server." Aggregator: Views aggregator. Fetch only: unchecked. Deployment processor: Queue API. Endpoints: the endpoint you created at Installing Deploy. Click "Continue."
  6. Select the Aggregator View you made (or select the default Front page View)
  7. No plugin to configure. Click Finish.
  8. To deploy the plan, go to admin/structure/deploy and click the "Deploy" link, then confirm with the "Deploy" button.

Note that all content that shows up in the selected View is added to the deployment plan. That also counts for new content created after creating the View and deployment plan. If it shows up in the View at the moment of deployment, it is added to the deployment plan and pushed to the destination server.

Rule Actions

We're going to add content to a deployment plan based on Rule events. Newly created and edited Articles will be added to the deployment plan automatically.

On the source server:

  1. Make sure you created a Managed aggregator like in Installing Deploy, but make sure to check 'Delete successfully deployed items' at step 9.
  2. Download the following module: Rules:
    drush dl rules
    
  3. Enable the following modules: Rules, Rules UI
  4. drush en rules rules_admin
    
  5. Go to admin/config/workflow/rules and click "Add new rule".
  6. Enter 'Content to Deployment plan' (or whatever you want to call your Rule) for the Name. Choose "After saving new content" (its listed under node) for 'React on event'. Click "Save".
  7. Click "Add event".
  8. Select "After updating existing content" (its listed under Node) for 'React on event'. Click "Add".
  9. Click "Add condition".
  10. Select "Content is of type" (its listed under Node) for 'Select the condition to add'.
  11. Make sure "node" is selected as 'Data selector', and select "Article" as Value for the content type(s) to check for. Click "Save".
  12. Click "Add action".
  13. Select "Add an entity to a managed deployment plan " (its listed under Deploy) for 'Select the action to add'.
  14. Select the Managed aggregator plan you created for 'Value' (under PLAN).
    Enter 'node' for 'Data selector' (under ENTITY). Click "Save".
  15. Create a new article at node/add/article. Give it whatever options you like and save it.
  16. Go to admin/structure/deploy and note the article you created is now in the managed aggregation plan you selected (at step 13). From now on all new and updated articles are added to the deployment plan automatically.
  17. To deploy the plan, go to admin/structure/deploy and click the "Deploy" link, then confirm with the "Deploy" button.

Note:
To automate the Deployment of the deployment plan you can add the Rule action 'Deploy a plan' (under Deploy) to your Rule. This initiates a deployment of a certain deployment plan on every Article creation / edit. Probably not recommended in most usecases.

-----------------------------------------
Old instructions copied from D6....

  1. Choose 'Live Server' from the Server select list, and enter the username and password for the user you wish your deployment to run as on the destination server. Click the Submit button.
  2. Your deployment should go through two phases - Processing deployment plan dependencies and Pushing deployment plans.
  3. You should end up at Deployment Log Details, which lists the node you just deployed and a Result of 'Success'.
  4. Go to admin/content/node on your destination server. Your node should be listed there, and if you edit the node your settings should have all been transferred properly.
  5. Now if you like you can return to this node on your source server, make some changes to the node, and go through the same process to deploy it to the destination server. Your changes should be transferred properly.

Deployment plans

You can build a deployment plan which groups together selected pieces of content to be pushed to live at the same time.

  1. First, create an empty deployment plan at Administer > Site building > Deployment (admin/build/deploy) under the Plans tab. Click the Add a New Deployment Plan link and fill in a name for the plan.
  2. Go to Administer > Content management > Content (admin/content/node) and select the items you wish to group together in the plan by checking the boxes.
  3. Select "Add to deployment plan" from the Update options dropdown list and hit the Update button.
  4. You are presented with a list of deployment plans you have created. Select the plan to add the items to and hit Submit.

Once you have set up the plan, you can return to Administer > Site building > Deployment (admin/build/deploy) and use the "push" link for a plan to push it live. You will be prompted for the destination server username and password and the process will follow as outlined above.

Comments

lakshminp’s picture

I get the White screen of death while executing step #3 of "Adding content manually" section with the latest version of Deploy module.
Update:
The patch provided at http://drupal.org/node/1445216#comment-5637066 fixes this issue.

liquidcms’s picture

I haven't used Deploy since D5/D6 days and just investigating now with D7. Wondering if i am missing something here; i seem to recall that Deploy used to present it self as an action which could be used within a VBO based View. Is this missing now? Is this not the preferred UI for Deploy? Select items to deploy.. and push.