To be able to use Search and Insight, you will need to connect your site to the Acquia Network. The video will walk you through this process and help you get connected to the network easily.
- Install the Drupal Connector module if you did not use one of the Acquia distributions to install your site.
- From within your site, click on the link asking you to connect your site to the Acquia Network. It should appear as a nag screen on every page.
- Enter the email address and password you use to login to the Acquia Network.
- Click Next.
Your site should now be connected to the Acquia Network.
This is Step-4 of the Free Tier on-boarding process for Acquia Cloud.
This lesson describes how to drag-and-drop to deploy code and content using the Acquia Cloud UI.
- Navigate to the Acquia Cloud dashboard, and select the "Workflow" link.
- From the Dev column, click and drag the box labelled "Code", and place it onto the Stage column. A pop-up window will appear.
- Enter a commit message.
Repeat steps 2 and 3 for the "Files" and "DB" boxes in the Dev column.
You may drag-and-drop these boxes (Code, Files, DB) in either direction: from Dev to Stage; or from Stage to Dev. If you would like to deploy your code to a live server, you will need to upgrade from the Acquia Free account. You can do this by clicking the link "Upgrade now" from the "Prod" column.
This is Step-5 of the Free Tier on-boarding process for Acquia Cloud.
This overview will introduce you to Acquia's open cloud platform and this series of lessons that will show you how to best use it. If you do not already have a free Acquia Network account, you may obtain one from Acquia.
In this series, we're going to be covering CSS preprocessors. Mainly we're going to be covering Sass, along with a related library, called Compass. While not used only on Drupal sites, it's a good thing to have in your arsenal of skills, especially if you do front-end design work.
To wrap everything up, we're going to show you how to extend beyond what we've covered in just the Sass and Compass basics, with other libraries that you can use with Sass.
Sass is in a class of tools called CSS preprocessors. CSS preprocessors have been around for a while now, but they've really started to gain in popularity in the last several years. In this lesson we'll find out what a CSS preprocessor is, what the benefits of using one are, and which ones are popular today.
Additional resources
When working with your CSS you will often have instances where something should include all of the styling associated with a class, in addition to a few extras that are specific to just that item. In regular CSS you would normally put the general class on the item, and add a more specific class with the additional styling. With the Sass @extend directive, you can have the more specific class inherit the styling of another class, so that you can just use the specific class in your HTML, keeping you HTML markup nice and concise.
Functions are another form super-variable, as it were, where you do a bunch of work that is assigned to something you can print out. But in this case you aren't injecting a bunch of CSS, instead you are just printing out a nice, final value. For many things you will want to do with functions, someone else has probably already written it. Sass comes with a lot of predefined functions for you to use, and there are libraries, like Compass, which provide many more. We'll take a look at some of the functions that Sass provides for us and see a function in action, along with our mixin, side by side, to really see the difference between them.
Additional resources
A mixin is a term used for a feature of preprocesors which acts a lot like a super-variable. You can write up larger chunks of CSS and assign them to a mixin name, then when you "include" that mixin, it will inject all of that CSS into the location. This is great for setting up common ways of displaying things, or handling common problems, and then just reusing that same method throughout. You can also add arguments to your mixin so that you can tweak the output according to your use case. This takes the reusable concept of variables up a notch.
One of the big advantages to using Sass is being able to reuse code. The simplest form of this is using variables. Variables in Sass work just like they do in other scripting languages. You simply assign a value to a variable name and then you can use that variable name anywhere you like. This is super helpful for doing things like defining the hex value for the color "blue" and then you can use the name "blue" wherever you want to use that hex value. This makes it easy to update that value in one place instead of having to find every instance of it and update all of them.
Additional resources
Sass' nesting feature makes it easy to organize your CSS in a way that makes it clear which selectors are related and generally provides a cleaner, clearer stylesheet. In this lesson we'll look at nesting, how to use it, and talk about making sure you don't nest unnecessarily.
Sass has a neat way of managing comments, where you can choose to either compile the comments, or not, from your scss. We're going to take a quick look at the two comment styles, and see how they appear (or don't) in our finished, compiled CSS.
We've looked at how easy it is to set Sass and Compass up from the command line, but for folks who prefer a nice GUI application, there are a few options available. Scout is a free Sass/Compass application that works cross-platform. In this lesson, we'll get Scout set up and see how it works to watch our projects.
Notes on Installing Scout:
- On OSX, If you double-click the .dmg and you get an error message saying you can't open this because it's from an unrecognized developer, control-click on the .dmg and select "Open" from the menu, then select "Open" from the dialogue box to open the .dmg installer.
- After installing Scout, OSX may again prevent you from opening it (depending on your security preferences) when it auto-opens it after installation. Navigate to where you installed it (i.e. "Applications"), control-click on the Scout icon, select open from the menu, and select "Open" from the dialogue box once again.
- If you get an error about Java, "No Java runtime present, requesting install," see the Scout GitHub issue queue for a solution.
Additional resources
Now that we have Ruby and Sass ready to go and working, let's also get our handy dandy mixin library, Compass, installed as well. We'll be using the command line in this lesson, but it's super simple to get this installed, and then we'll create a project to make sure everything is firing correctly. We'll look at a GUI tool to do this in another lesson.
Additional resources
In order to get started with Sass, we're going to need to install it. There is really only one major prerequisite for using Sass, and that's that you will need to have Ruby installed. Ruby is a very popular language, which Sass is written in. Ruby is easy to install, and once you have it installed, you won't need to really work with Ruby directly. Some systems come with Ruby already installed, like OS X, but if you don't have Ruby installed it only takes a few minutes. In this lesson we will be installing Sass and Ruby on Windows, because Windows does not have Ruby installed for us already. Once we have Ruby installed, we'll use the command line to quickly install Sass, which is the same on all systems. Then we'll do a quick test to make sure it is working properly. There are apps that you can use to do all of this for you using a GUI, but we want to start with the fundamental pieces, and we'll cover the GUI applications in another lesson.
Additional resources
In this lesson we're going to review a lot of the special terms that are used in Sass. Different categories of features you can use with Sass have their own names, and are used in specific ways in the Sass world. We're also going to take a look at scss versus sass, and get a feel for how Sass code looks before and after compilation.
Whenever people speak about Sass, they normally also mention Compass in the same breath. It isn't always clear what the difference between these tools are. Compass is a library that adds lots of new features to your standard Sass setup. In this lesson, we'll discuss why you want to use Compass, then take a look at the Compass documentation and the main features that it provides for you.
Additional resources
In the previous lesson we discussed why you would want to use a configuration management tool. In this lesson we'll dive into how you automate the customization of new servers using the configuration management tool, Chef. Most of the work in assembling Chef recipes is already done for you. In this lesson you will be able to see how the pieces fit together; however, you will not be required to download each of the individual recipes to get everything working.
Lesson Outcomes
By the end of this lesson you will be able to describe how to add a Chef recipe to your setup, and re-provision Vagrant.
Lesson Summary
In the video, I've already setup Chef recipes, roles, and cookbooks for you. So instead of having to download all the pieces separately, you can just start with the code bundle for this lesson.
The outline provided below, however, includes each of the steps that I went through to prepare the configuration Chef recipes and roles that you're downloading.
Locating and Using Chef Cookbooks
- Locate Chef cookbooks for AMP stack, drush, and Drupal-specific PHP libraries you want pre-loaded.
- Place downloaded cookbooks into a sub-folder in your project directory. For example:
chef-recipes/cookbooks
. - Create a role file to include all of the recipes (from each of the cookbooks) you want to load. This file can be placed into its own roles sub-directory. For example:
chef-recipes/roles/lamp_stack.rb
. - Update the Vagrantfile to include:
- path to cookbooks folder
- path to roles folder
- role(s) to load for this server
- new values for any of the default settings for your recipes
- Provision the machine to enable / set-up / trigger the Chef configuration settings:
$ vagrant provision
The machine is now configured, but does not have Drupal installed. This is on purpose. You probably have a specific Drupal project you're working on.
Customizing Configuration Files to Use Chef Recipes
The role files contain a list of individual recipes, and/or roles that must be run to provision a specific type of server. Generally there are three or four parts to them.
- name
- description
- run list (recipes and roles to add)
- default settings for recipes (optional)
You should investigate the contents of the folder chef-recipes/roles
. There is a detailed README tailored to this learning series, as well as the two roles that were created for this lesson.
The Vagrantfile is well commented, this section includes a quick references of the settings that have been updated in the file.
config.vm.provision :chef_solo do |chef|
# default settings
chef.cookbooks_path = "path_to_cookbooks_folder"
chef.roles_path = "path_to_roles_folder"
# roles and recipes to load
# recipes are generally loaded from within roles
chef.add_role "name_of_role"
chef.add_recipe "name_of_recipe"
# overrides for settings in recipes
chef.json = {
"name_of_recipe" => {
"name_of_setting" => "new_value",
},
}
end
Gotchas
- If you are using these recipes for Drupal 8: the recipe provided for Drush won't work. You'll need to install Drush version 7 or greater (compatibility chart on the Drush project page).
- You will probably want to update Chef with the omnibus plugin for Vagrant if the cookbook you want to add requires a newer version of Chef. On the host machine, install the plugin:
$ vagrant plugin install vagrant-omnibus
. Note: Chef must be updated before it is "run". For this lesson, I opted to use older versions of the cookbooks. 20 hours of my life spent working on upgrades that didn't work. The later scripts provide more flexibility (e.g. install ANY version of Drush, not just 5.8), but they work well enough for our needs. - Apt will only run if the cache is older than a day. The first time the machine is provisioned, this might be a problem. You can force updating the cache with the following setting in Vagrantfile:
chef.json = { "apt" => {"compiletime" => true} }
- If you are running into problems with permissions, refer to the tips in Sharing Files Between Your Guest and Host Machine.
- Windows users will also need to download the following cookbooks, and add them to the directory you have configured for chef.cookbooks_path
- chef-handler
- chef-sugar
- iis
- windows
- xml
- yum
- yum-epel
In previous lessons you learned how to automate the setup of your Vagrant instance. We did not, however, automate the installation of Drupal. This is by design. It gives us the ability to quick create new virtual machines using standard pieces of a LAMP stack before finally installing the specific version of Drupal we want to use. In this lesson you will learn how to install Drupal from the command line using Drush. If you already know how to do this, you should review the Lesson Summary, but you are not required to watch the video as it will be entirely review for you.
Lesson Outcomes
By the end of this lesson you will be able to install Drupal via Drush from within your Vagrant instance.
Lesson Summary
The machine was configured in the previous lesson, but does not have Drupal installed. This is on purpose. You probably have a specific Drupal project you're working on. If you don't, you can use the following instructions to set up a generic instance of Drupal. Note: The Chef recipe we're using supports Drupal 6 and Drupal 7, but not Drupal 8. You'll need to update Drush first if you want to use these instructions to install Drupal 8.
$ vagrant ssh
$ cd /var/www/docroot
$ drush dl drupal
$ cd drupal-XXX
(where XXX is the version number for Drupal you've just downloaded)$ drush si standard --db-url=mysql://root:root@localhost/drupal7 --db-su=root --db-su-pw=root --site-name="Drupal on Vagrant"
(for the lessons, the MySQL database has the username root; and the password root, if you have deviated from these insecure passwords, you will need to update this line to get the site install to work).
Gotchas
This lesson assumes you want to install Drupal 7 using the Chef recipe which was given in the previous lesson. This lesson will not work if you are trying to install Drupal 8 as Drush 6 is not compatible with Drupal 8.
Everyone will use Vagrant a little differently. In this lesson, Emma shares some of her strategies for using Vagrant for her personal developer environment.
Lesson Objectives
By the end of this lesson, you will be able to describe how many Vagrant instances you will use, and why.
Lesson Summary
Emma started with one Vagrant instance per project but found that she switches tasks frequently enough that it was a problem--with only 8G RAM, it's hard to have more than one machine running at a time. Although the shut down + startup procedure only takes about five minutes, but it's still dead time. This is especially true as the shut down/start up time doesn't include pulling a fresh copy of the Git repository and updating the database. Emma recommends: grouping your projects with similar requirements into the same Vagrant instance IF you are limited by hardware resources AND you need to switch tasks frequently. Then, as needed, create new vagrant instances if you can justify the split. For example: if you need two different versions of PHP or two different servers (nginx vs. Apache).
Additional resources
You can typically upgrade your Vagrant and VirtualBox installations without any problems. Occassionally you will run into problems though. If this does happen to you, you will want to remove all Vagrant and VirtualBox software, and then re-install it. Assuming you are using Configuration Management to provision your machines, the only thing you'll lose is your database.
Lesson Summary
You will need to delete files and applications as follows for OSX:
- /Applications/VirtualBox.app
- /Applications/Vagrant.app
- /usr/bin/vagrant
- ~/.vagrant.d
- ~/VirtualBox VMs
Lesson Outcomes
By the end of this lesson, you will be able to remove relevant Vagrant from your system to prepare yourself for a clean installation.