Skip to content
This repository was archived by the owner on Jul 1, 2022. It is now read-only.

Reworked documentation for GitHub pages website. #23

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.couscous
86 changes: 34 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,59 +1,51 @@
Deployotron
===========

Deployotron is a Drush command to simplify deploying new code to a
Drupal site.

There's already a lot of ways to deploy ones Drupal site, from FTPing
up the files to having Capistrano deploy the site when the build
passes in Jenkins. Deployotron aims to be simple to use, but also
usable as a part of a bigger setup.
A deployment tool does not have to be complicated to set up or use. Deployotron is a Drush command to simplify deploying new code to a Drupal site.

[![Build Status](https://travis-ci.org/reload/deployotron.png?branch=master)](https://travis-ci.org/reload/deployotron)
[![Code Coverage](https://scrutinizer-ci.com/g/reload/deployotron/badges/coverage.png?s=0f0d54845fc1c45affcc0ad8c111e40f4e40c359)](https://scrutinizer-ci.com/g/reload/deployotron/)
[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/reload/deployotron/badges/quality-score.png?s=cd9fde12be1b74734b00d59618d4eb6c1bf5bfb0)](https://scrutinizer-ci.com/g/reload/deployotron/)

Overview
========

In order to keep things simple, we're working with a few assumptions:
Getting started <a id="getting-started"></a>
===============

Get up and running with Deployotron in five easy steps:

That the code is in GIT, and that the root of the site is checked in.
1. **Commit your site to git** <br/> Deployotron expects your Drupal site to be committed to the root of your Git repository.
2. **Install Deployotron** <br/> Copy Deployotron into `sites/all/drush` and commit it. This ensures that everyone on your team is using the same version when deploying.
3. **Setup your aliases** <br/> Aliases makes Drush much more fun to use, and committing an `<sitename>aliases.drushrc.php` in `sites/all/drush` makes it easy to share them with the rest of the team. It is also the place to configure Deployotron.
4. **Clone the site on the server** <br/> Clone the site repository where you want to deploy it to. Rmember to use the same user as setup for the alias, to ensure that the permissions of the files are properly set up.
5. **Deploy!** <br/> Run `drush deploy @<alias>` from the root of your site. Deployotron will show you what actions will be executed as a part of the deployment and ask you to confirm before continuing them.
6. **(Oh no...)** <br/> Something bad happened? Run `drush omg @<alias>` to re-import the latest database dump and checkout the revision the site was at before deploying.

That you can run Drush commands and GIT on the live webserver and the
root of the site on the webserver is a git checkout, and
Overview <a id="overview"></a>
========

There are already a lot of ways to deploy a Drupal site - from rsync'ing the files to having Capistrano deploy the site when the build passes in Jenkins. Deployotron aims to be simple to use, but also usable as a part of a bigger setup.

That you've set up Drush aliases to reach the live webserver.

For everyone's sanity, we suggest having a Drush alias file in
`sites/all/drush/<short-site-alias>.aliases.drushrc.php` that defines
relevant environments (production, dev, etc.), so that everybody is
using the same settings.
In order to keep things simple Deployotron is working with a few assumptions:

And we suggest that deployotron is installed by copying it into the
`sites/all/drush` folder and committed to the site repository. This
ensures that everyone is running the exact same version of deployotron
when deploying.
* The source code for the site is in a git repository
* The root of the site is checked in in the root of the repository
* You can run Drush commands and git on the webserver your are deploying to

Setup
Setup <a id="setup"></a>
=====

Clone Deployotron into `sites/all/drush`.
Install the Deplyotron Drush commands. We suggest you copy it into `sites/all/drush` folder and committed to the site repository. This ensures that everyone is running the exact same version of Deployotron when deploying.

If you do not have an `<sitename>.aliases.drushrc.php` file containing information about your environments then create one. We suggest keepin it in the `sites/all/drush/` folder so everybody are using the same settings.

Create a `<sitename>.aliases.drushrc.php` file in the same directory,
with the definition of the different environments.
Deployotron is configured for each alias by adding an array of options in the `'deployotron'` key of the alias array (see the example later, if that didn't make any sense).

Deployotron is configured for each alias by adding an array of options
in the `'deployotron'` key of the alias array (see the example later,
if that didn't make any sense). All the double-dash options the deploy
command takes can be specified this way, and it's recommended to at
least define the `'branch'` option to select a default branch to
deploy.
All the double-dash options the deploy command takes can be specified this way, and it's recommended to at least define the `'branch'` option to select a default branch to deploy.

Initialize the environments by doing an initial git clone of the
codebase in the destination directories.
Initialize the environments by doing an initial `git clone` of the codebase in the destination directories.

Usage
Usage <a id="usage"></a>
=====

Deploying
Expand All @@ -63,12 +55,9 @@ To run the deployment, use a command like:

/var/www/site$ drush deploy @alias

To get a listing of all supported command line options, do a `drush
help deploy`.
To get a listing of all supported command line options, do a `drush help deploy`.

In order to be able to restart Apache2/Varnish, sudo needs to be set
up to allow the deploying user to restart the services. See "Sudo
setup" for details.
In order to be able to restart Apache2/Varnish, sudo needs to be set up to allow the deploying user to restart the services. See "Sudo setup" for details.

Example configuration:

Expand Down Expand Up @@ -103,28 +92,21 @@ things they should be aware.
Recovering
----------

In case everything goes to hell after a deployment, you can do another
deployment using a known good revision, or use:
In case everything goes to hell after a deployment, you can do another deployment using a known good revision, or use:

/var/www/site$ drush omg @alias
/var/www/site$ drush omg @<alias>

This will try to find recent database dumps, ask which to use and
attempt to import the database and revert the codebase to the previous
revision. It will not attempt to clear caches or restarting any
services.
This will try to find recent database dumps, ask which to use and attempt to import the database and revert the codebase to the previous revision. It will not attempt to clear caches or restarting any services.

Help
----

Running `drush deployotron-actions` will give a full list of which
commands uses which actions, and the options of all actions.
Running `drush deployotron-actions` will give a full list of which commands uses which actions, and the options of all actions.

Sudo setup
==========

To give the deploying user (`remote-user` in the alias) permission to
restart apache2/varnish, you need to configure sudo. Use the following
command to edit a sudoers.d config file:
To give the deploying user (`remote-user` in the alias) permission to restart apache2/varnish, you need to configure sudo. Use the following command to edit a `sudoers.d` config file:

sudo visudo -f /etc/sudoers.d/deployotron

Expand Down
Empty file added couscous.yml
Empty file.
47 changes: 47 additions & 0 deletions website/page.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<!DOCTYPE html>
<html>
<head>
<title>Deployotron</title>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootswatch/3.2.0/superhero/bootstrap.min.css" />
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<link href='//fonts.googleapis.com/css?family=Squada+One' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="/css/deployotron.css" />
</head>
<body data-spy="scroll" data-target=".navbar">

<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#start">Deployotron</a>
</div>
<div class="collapse navbar-collapse" id="navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="#getting-started">Getting started</a></li>
<li><a href="#setup">Setup</a></li>
<li><a href="#usage">Usage</a></li>
</ul>
</div>
</div>
</nav>

<div class="jumbotron" id="start">
<div class="container">
<img src="/img/deployotron.png"/>
<h1>Deployotron</h1>
<p>Deploy your Drupal site with Drush in 5 steps. 3 of them you will be doing anyway.</p>
</div>
</div>

<div class="container">
{{ content|raw }}
</div>

</body>
</html>
104 changes: 104 additions & 0 deletions website/public/css/deployotron.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
body {
position: relative;
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
font-weight: 200;
}


h1, h2, h3 {
font-family: 'Squada One', sans-serif;
/* White headlines makes them pop */
color: #fff;
}

h1 {
/* Increase top margin by 50% to increase separation between sections. */
margin-top: 31.5px;
}

code {
/* Use the orange color from the superhero bootswatch theme for code as well.
It makes a nice contrast to the blue.
It is also used for links but we have few of those and a lot of links. */
color: #df691a;
}

.navbar {
/* Use a lighter blue color for the navbar. */
background-color: #697683;
/* Add even lighter blue border to separate navbar and jumbotron. */
border-bottom: 1px solid #8E979F;
}

.jumbotron {
/* Readjust padding as the menu also takes up som space in the top. */
padding: 40px 0 20px;

/* Add a lighter blue border to separate jumbotron from content. */
border-bottom: 1px solid #697683;
}

.jumbotron img {
/* Align the logo to the left of the title. */
display: block;
float: left;
height: 50px;
/* The top of the logo should align with the title */
margin-top: 30px;
margin-right: 5px;
}

.jumbotron h1 {
color: #fff;
text-transform: uppercase;
}

body > .container h1:first-child {
/* Hide the first title which is in a container directly under the body
i.e. not in the jumbotron. This should be the project title from the
markdown documents. */
display: none;
}


@media screen and (min-width: 480px) {

.jumbotron img {
/* Larger screen, larger logo */
height: 150px;
margin-right: 10px;
}

}

@media screen and (min-width: 768px) {

.jumbotron {
/* Larger screen, larger elements */
padding: 64px 0 32px;
border-bottom-width: 2px;
}

.jumbotron .container {
position: relative;
}

.jumbotron img {
float: none;
/* Align the logo to the right of the title and make it pop out of
the jumbotron expand into the menu and content. */
position: absolute;
height: 325px;
top: -74px;
right: 0;
/* Position above menu z-index 1030 */
z-index: 2000;
}

.jumbotron p,
body > .container p:nth-child(2) {
/* Make room for the logo */
margin-right: 325px;
}

}
Binary file added website/public/img/deployotron.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.