You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 21 Next »

  •  

Setup   
I had a lot of trouble with online recipes not matching the version of Capistrano I had. I settled on Capistrano v2.15.5 since that's what the Blacklight project is using.
You'll Ruby, Capistrano, PHP, MySQL, Git, drush, and a server to run the Drupal site.

Install capistrano:

gem install capistrano
gem install capistrano-ext

Local Directory  

Your development/site building happens here. It could be on a development machine also.

Set up a git repository for the site on https://git.library.cornell.edu/ - example https://git.library.cornell.edu/featureserver_test_library_cornell_edumkdir featureserver_test_library_cornell_edu

cd featureserver_test_library_cornell_edu
git init
touch README.txt
git add README.txt
git commit -m 'first commit'
git remote add origin git@git.library.cornell.edu:featureserver_test_library_cornell_edu.git
git push -u origin master

Set up the local directory

  • featureserver_test_library_cornell_edu
    • .git
    • .gitignore
    • README.txt
    • backup/ - place for backup files
    • private_files/ - point Drupal's private file directory at this directory (later)
    • public/ - put your Drupal site here (later)

Here's what my .gitignore looks like.

Let capistrano create its default files

bash> cd featureserver_test_library_cornell_edu
bash> capify .

Now the directory looks like this:

  • featureserver_test_library_cornell_edu
    • .git
    • .gitignore
    • Capfile
    • config
      • deploy.rb
    • README.txt
    • backup/ - place for backup files
    • private_files/ - point Drupal's private file directory at this directory (later)
    • public/ - put your Drupal site here (later)

Change the default deploy.rb to add stages (eg. staging, production) and add a deploy directory containing a file for each stage.

  • featureserver_test_library_cornell_edu
    • .git
    • .gitignore
    • Capfile
    • config
      • deploy
        • staging.rb
        • production.rb
      • deploy.rb
    • README.txt
    • backup/ - place for backup files
    • private_files/ - point Drupal's private file directory at this directory (later)
    • public/ - put your Drupal site here (later)

Here are some examples for deploy.rb, staging.rb, and production.rb that work for CUL servers. You'll need to modify the URLs and paths wherever there is a TODO comment.

Now might be a good time to add all these new files into git.

bash> git add Capfile config/
bash> git commit Capfile -m 'inital version from capify'
bash> git commit config/ -m 'staging and production deploy instructions'

Next step: build the drupal site inside public/ including an installation profile we can use to build the site on a target machine.

Server Directory

Note: We currently don't have the servers set up to follow Capistrano's 'current' symlink. To work things out I've added a 'cap' directory:
/libweb/sites/<domain name>/cap
and deployed the sites there. If you add a symlink like this
/libweb/sites/<domain name>/htdocs/capcurrent -> ../cap/current/public
you can see the deployed site at
http://<domain name>/capcurrent
BUT it only works if you turn off Clean URLS
http://<domain name>/capcurrent/?q=admin/config/search/clean-urls

Here is a JIRA issue about setting up new development and deploy servers.

  • No labels