forked from kraftwagen/kraftwagen.github.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget-started.html
236 lines (212 loc) · 10 KB
/
get-started.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Kraftwagen - Get started</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Kraftwagen is a set of Drupal Tools for a everything in code and install profile / drush make based workflow.">
<meta name="author" content="Rolf van de Krol">
<link href="/css/bootstrap.css" rel="stylesheet">
<link href="/css/bootstrap-responsive.css" rel="stylesheet">
<link href="/css/font-awesome.css" rel="stylesheet">
<link href="/css/prettify.css" rel="stylesheet">
<link href="/css/kraftwagen.css" rel="stylesheet">
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body data-spy="scroll" data-target=".kw-sidebar">
<header class="get-started">
<div class="container">
<h1>Getting started with Kraftwagen</h1>
</div>
</header>
<div class="container">
<div class="row">
<div class="span4 kw-sidebar">
<div class="kw-sidebar-inner">
<ul class="nav nav-list kw-sidenav">
<li><a href="#installation"><i class="icon-download-alt"></i> Installation</a></li>
<li><a href="#new-project"><i class="icon-plus-sign"></i> New project</a></li>
<li><a href="#setup-project"><i class="icon-bolt"></i> Setting up projects</a></li>
<li><a href="#build"><i class="icon-magic"></i> Creating a build</a></li>
</ul>
</div>
</div>
<div class="span8">
<p>
Using <a href="/">Kraftwagen</a> in your own projects is fairly
easy, especially if you are a seasoned Drupal developer already.
This page is aimed at developers that are already familiar with
Drupal.
</p>
<section id="installation">
<div class="page-header">
<h2>Installation</h2>
</div>
<p>
Kraftwagen builds heavily on
<a href="http://drupal.org/project/drush">Drush</a>. All command
line interactions with Kraftwagen are done using Drush.
</p>
<p>
To install Kraftwagen, you will need to install Drush and install
Kraftwagen at a location where Drush can reach it. Drush can be
installed globally or in your home directory. Take a look at the
Drush documentation for more information about this. After you
installed Drush you can install Kraftwagen as any other extension
in the global directory (<code>/usr/share/drush/commands</code>)
or in your home directory (<code>~/.drush</code>). Make sure to
clear your drush cache with <code>drush cc drush</code> after
this.
</p>
<h3>Per project</h3>
<p>
If you prefer to keep a Drush and Kraftwagen installation per
project, Kraftwagen provides a little tool for that. Change to the
directory your project in located in (not the <code>src</code>
dir, but the project root directory). Take a look at our
<a href="https://github.com/kraftwagen/tools">Kraftwagen Tools
repository</a>.
</p>
</section>
<section id="new-project">
<div class="page-header">
<h2>Create a new project</h2>
</div>
<p>
Creating a new project is done using the
<code>drush kw-new-project</code> command. This command uses a so
called <em>skeleton</em> to kickstart a project. A skeleton for
Kraftwagen is a Git repository that contains the starting point
for a project. Kraftwagen provides an
<a href="https://github.com/kraftwagen/skeleton">example
skeleton</a> which you can fork to create your own.
</p>
<p>
Start by creating a directory for your project and changing to
this directory.
</p>
<pre class="prettyprint lang-bash">cd /path/to/projects
mkdir MyProject
cd MyProject
</pre>
<p>
Then run <code>drush kw-new-project</code> in this
directory. This command will ask for the human readable name of
the project and the machine name of the project. Then it will ask
for the location of the skeleton repository and which branch to
us from the repository. When you supplied all the information, it
will clone the skeleton repository and create a <code>src</code>
directory in your current directory that contains the source of
the project that is generated from the skeleton.
</p>
<p>
Now the source of the project is created. We advise you to use
your favorite version control system to create the initial commit
of your project.
</p>
<p>
The source of a Kraftwagen projects is a Drupal install profile.
Drupal core and contributed modules are pulled in using Drush make
and `.make` files. This keeps your repository clean and
maintainable. A great advantage is, that with such a small
repository it actually is feasible to walk trough all the code to
review it.
</p>
<p>
You're now at the same state as
<a href="#setup-project-sub">after checking out an existing
project</a>.
</p>
</section>
<section id="setup-project">
<div class="page-header">
<h2>Setting up existing projects</h2>
</div>
<p>
To get started on an existing project, you'll need to setup the
project on your computer. First create a directory for the project
and change to that directory. Then checkout the source code from
the version control system it is saved in. Make sure the checkout
is in the <code>src</code> directory.
</p>
<p id="setup-project-sub">
Now run <code>drush kw-setup</code>. This will create a
<code>cnf</code> directory with some files and directories in it.
</p>
<dl>
<dt><code>settings.php</code> and <code>settings.local.php</code></dt>
<dd>
The settings files are copied from the <code>src/cnf</code>
directory. These files contain target-specific settings for your
Drupal installation. When generating a working Drupal
installation from the <code>src</code> (we call that a
<em>build</em> in Kraftwagen), these files are symlinked to the
right place in the installation.
</dd>
<dt><code>environment</code></dt>
<dd>
This file by default contains <code>production</code>. The
contents of this file controls which environment-specific
dependencies are installed and which environment-specific
manifests are run.
</dd>
<dt><code>files</code></dt>
<dd>
The <code>files</code> directory is an empty directory. It is
used to store the files that are uploaded by the user. The
directory will be symlinked to the correct place when generating
a build (just like the settings files).
</dd>
</dl>
<p>
<p>
You should change the <code>settings.local.php</code> file to be
able to connect to the database. Furthermore, if you want to use
the development settings, you should changes the contents to the
<code>enviroment</code> file to <code>development</code>.
</p>
<p>
You're now ready to create the first <a href="#build">build</a> of
the project.
</p>
</section>
<section id="build">
<div class="page-header">
<h2>Creating a build</h2>
</div>
<p>
The source of the project is not a working Drupal installation. It
doesn't even contain Drupal itself. A working Drupal installation
that is generated from the source is called a <em>build</em>.
</p>
<p>
By default the build is created in a directory <code>build</code>.
If you prefer to keep a directory of all builds and prefer
<code>build</code> to be a symlink to the current build, you only
have to create a directory <code>builds</code>. Kraftwagen will
automatically create the build in the <code>builds</code>
directory if it exists and create a symlink from
<code>build</code> to the latest build for you.
</p>
<p>
A build is created by running <code>drush kw-build</code>.
</p>
</section>
</div>
</div>
<hr>
<footer>
<p>This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/deed.en_US">Creative Commons Attribution-ShareAlike 3.0 Unported License</a></p>
</footer>
</div>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="/js/bootstrap.js"></script>
<script src="/js/prettify.js"></script>
<script src="/js/app.js"></script>
<script type="text/javascript">var _gaq = [['_setAccount', 'UA-36687951-1'], ['_trackPageview']];</script>
<script type="text/javascript" src="http://www.google-analytics.com/ga.js"></script>
</body>
</html>