capwagen 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE.md +618 -0
- data/README.md +29 -0
- data/bin/capwagen +87 -0
- data/lib/capistrano/recipes/deploy/strategy/capwagen_local_build.rb +138 -0
- data/lib/capwagen/version.rb +3 -0
- data/lib/capwagen.rb +217 -0
- metadata +74 -0
data/LICENSE.md
ADDED
@@ -0,0 +1,618 @@
|
|
1
|
+
# GNU GENERAL PUBLIC LICENSE
|
2
|
+
|
3
|
+
Version 3, 29 June 2007
|
4
|
+
|
5
|
+
Copyright © 2007 Free Software Foundation, Inc. <<http://fsf.org/>>
|
6
|
+
|
7
|
+
Everyone is permitted to copy and distribute verbatim copies of this license
|
8
|
+
document, but changing it is not allowed.
|
9
|
+
|
10
|
+
## Preamble
|
11
|
+
|
12
|
+
The GNU General Public License is a free, copyleft license for software and
|
13
|
+
other kinds of works.
|
14
|
+
|
15
|
+
The licenses for most software and other practical works are designed to take
|
16
|
+
away your freedom to share and change the works. By contrast, the GNU General
|
17
|
+
Public License is intended to guarantee your freedom to share and change all
|
18
|
+
versions of a program--to make sure it remains free software for all its users.
|
19
|
+
We, the Free Software Foundation, use the GNU General Public License for most of
|
20
|
+
our software; it applies also to any other work released this way by its
|
21
|
+
authors. You can apply it to your programs, too.
|
22
|
+
|
23
|
+
When we speak of free software, we are referring to freedom, not price. Our
|
24
|
+
General Public Licenses are designed to make sure that you have the freedom to
|
25
|
+
distribute copies of free software (and charge for them if you wish), that you
|
26
|
+
receive source code or can get it if you want it, that you can change the
|
27
|
+
software or use pieces of it in new free programs, and that you know you can do
|
28
|
+
these things.
|
29
|
+
|
30
|
+
To protect your rights, we need to prevent others from denying you these rights
|
31
|
+
or asking you to surrender the rights. Therefore, you have certain
|
32
|
+
responsibilities if you distribute copies of the software, or if you modify it:
|
33
|
+
responsibilities to respect the freedom of others.
|
34
|
+
|
35
|
+
For example, if you distribute copies of such a program, whether gratis or for a
|
36
|
+
fee, you must pass on to the recipients the same freedoms that you received. You
|
37
|
+
must make sure that they, too, receive or can get the source code. And you must
|
38
|
+
show them these terms so they know their rights.
|
39
|
+
|
40
|
+
Developers that use the GNU GPL protect your rights with two steps: (1) assert
|
41
|
+
copyright on the software, and (2) offer you this License giving you legal
|
42
|
+
permission to copy, distribute and/or modify it.
|
43
|
+
|
44
|
+
For the developers' and authors' protection, the GPL clearly explains that there
|
45
|
+
is no warranty for this free software. For both users' and authors' sake, the
|
46
|
+
GPL requires that modified versions be marked as changed, so that their problems
|
47
|
+
will not be attributed erroneously to authors of previous versions.
|
48
|
+
|
49
|
+
Some devices are designed to deny users access to install or run modified
|
50
|
+
versions of the software inside them, although the manufacturer can do so. This
|
51
|
+
is fundamentally incompatible with the aim of protecting users' freedom to
|
52
|
+
change the software. The systematic pattern of such abuse occurs in the area of
|
53
|
+
products for individuals to use, which is precisely where it is most
|
54
|
+
unacceptable. Therefore, we have designed this version of the GPL to prohibit
|
55
|
+
the practice for those products. If such problems arise substantially in other
|
56
|
+
domains, we stand ready to extend this provision to those domains in future
|
57
|
+
versions of the GPL, as needed to protect the freedom of users.
|
58
|
+
|
59
|
+
Finally, every program is threatened constantly by software patents. States
|
60
|
+
should not allow patents to restrict development and use of software on general-
|
61
|
+
purpose computers, but in those that do, we wish to avoid the special danger
|
62
|
+
that patents applied to a free program could make it effectively proprietary. To
|
63
|
+
prevent this, the GPL assures that patents cannot be used to render the program
|
64
|
+
non-free.
|
65
|
+
|
66
|
+
The precise terms and conditions for copying, distribution and modification
|
67
|
+
follow.
|
68
|
+
|
69
|
+
## TERMS AND CONDITIONS
|
70
|
+
|
71
|
+
### 0. Definitions.
|
72
|
+
|
73
|
+
“This License” refers to version 3 of the GNU General Public
|
74
|
+
License.
|
75
|
+
|
76
|
+
“Copyright” also means copyright-like laws that apply to other kinds
|
77
|
+
of works, such as semiconductor masks.
|
78
|
+
|
79
|
+
“The Program” refers to any copyrightable work licensed under this
|
80
|
+
License. Each licensee is addressed as “you”.
|
81
|
+
“Licensees” and “recipients” may be individuals or
|
82
|
+
organizations.
|
83
|
+
|
84
|
+
To “modify” a work means to copy from or adapt all or part of the
|
85
|
+
work in a fashion requiring copyright permission, other than the making of an
|
86
|
+
exact copy. The resulting work is called a “modified version” of the
|
87
|
+
earlier work or a work “based on” the earlier work.
|
88
|
+
|
89
|
+
A “covered work” means either the unmodified Program or a work based
|
90
|
+
on the Program.
|
91
|
+
|
92
|
+
To “propagate” a work means to do anything with it that, without
|
93
|
+
permission, would make you directly or secondarily liable for infringement under
|
94
|
+
applicable copyright law, except executing it on a computer or modifying a
|
95
|
+
private copy. Propagation includes copying, distribution (with or without
|
96
|
+
modification), making available to the public, and in some countries other
|
97
|
+
activities as well.
|
98
|
+
|
99
|
+
To “convey” a work means any kind of propagation that enables other
|
100
|
+
parties to make or receive copies. Mere interaction with a user through a
|
101
|
+
computer network, with no transfer of a copy, is not conveying.
|
102
|
+
|
103
|
+
An interactive user interface displays “Appropriate Legal Notices”
|
104
|
+
to the extent that it includes a convenient and prominently visible feature that
|
105
|
+
(1) displays an appropriate copyright notice, and (2) tells the user that there
|
106
|
+
is no warranty for the work (except to the extent that warranties are provided),
|
107
|
+
that licensees may convey the work under this License, and how to view a copy of
|
108
|
+
this License. If the interface presents a list of user commands or options, such
|
109
|
+
as a menu, a prominent item in the list meets this criterion.
|
110
|
+
|
111
|
+
### 1. Source Code.
|
112
|
+
|
113
|
+
The “source code” for a work means the preferred form of the work
|
114
|
+
for making modifications to it. “Object code” means any non-source
|
115
|
+
form of a work.
|
116
|
+
|
117
|
+
A “Standard Interface” means an interface that either is an official
|
118
|
+
standard defined by a recognized standards body, or, in the case of interfaces
|
119
|
+
specified for a particular programming language, one that is widely used among
|
120
|
+
developers working in that language.
|
121
|
+
|
122
|
+
The “System Libraries” of an executable work include anything, other
|
123
|
+
than the work as a whole, that (a) is included in the normal form of packaging a
|
124
|
+
Major Component, but which is not part of that Major Component, and (b) serves
|
125
|
+
only to enable use of the work with that Major Component, or to implement a
|
126
|
+
Standard Interface for which an implementation is available to the public in
|
127
|
+
source code form. A “Major Component”, in this context, means a
|
128
|
+
major essential component (kernel, window system, and so on) of the specific
|
129
|
+
operating system (if any) on which the executable work runs, or a compiler used
|
130
|
+
to produce the work, or an object code interpreter used to run it.
|
131
|
+
|
132
|
+
The “Corresponding Source” for a work in object code form means all
|
133
|
+
the source code needed to generate, install, and (for an executable work) run
|
134
|
+
the object code and to modify the work, including scripts to control those
|
135
|
+
activities. However, it does not include the work's System Libraries, or
|
136
|
+
general-purpose tools or generally available free programs which are used
|
137
|
+
unmodified in performing those activities but which are not part of the work.
|
138
|
+
For example, Corresponding Source includes interface definition files associated
|
139
|
+
with source files for the work, and the source code for shared libraries and
|
140
|
+
dynamically linked subprograms that the work is specifically designed to
|
141
|
+
require, such as by intimate data communication or control flow between those
|
142
|
+
subprograms and other parts of the work.
|
143
|
+
|
144
|
+
The Corresponding Source need not include anything that users can regenerate
|
145
|
+
automatically from other parts of the Corresponding Source.
|
146
|
+
|
147
|
+
The Corresponding Source for a work in source code form is that same work.
|
148
|
+
|
149
|
+
### 2. Basic Permissions.
|
150
|
+
|
151
|
+
All rights granted under this License are granted for the term of copyright on
|
152
|
+
the Program, and are irrevocable provided the stated conditions are met. This
|
153
|
+
License explicitly affirms your unlimited permission to run the unmodified
|
154
|
+
Program. The output from running a covered work is covered by this License only
|
155
|
+
if the output, given its content, constitutes a covered work. This License
|
156
|
+
acknowledges your rights of fair use or other equivalent, as provided by
|
157
|
+
copyright law.
|
158
|
+
|
159
|
+
You may make, run and propagate covered works that you do not convey, without
|
160
|
+
conditions so long as your license otherwise remains in force. You may convey
|
161
|
+
covered works to others for the sole purpose of having them make modifications
|
162
|
+
exclusively for you, or provide you with facilities for running those works,
|
163
|
+
provided that you comply with the terms of this License in conveying all
|
164
|
+
material for which you do not control copyright. Those thus making or running
|
165
|
+
the covered works for you must do so exclusively on your behalf, under your
|
166
|
+
direction and control, on terms that prohibit them from making any copies of
|
167
|
+
your copyrighted material outside their relationship with you.
|
168
|
+
|
169
|
+
Conveying under any other circumstances is permitted solely under the conditions
|
170
|
+
stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
|
171
|
+
|
172
|
+
### 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
173
|
+
|
174
|
+
No covered work shall be deemed part of an effective technological measure under
|
175
|
+
any applicable law fulfilling obligations under article 11 of the WIPO copyright
|
176
|
+
treaty adopted on 20 December 1996, or similar laws prohibiting or restricting
|
177
|
+
circumvention of such measures.
|
178
|
+
|
179
|
+
When you convey a covered work, you waive any legal power to forbid
|
180
|
+
circumvention of technological measures to the extent such circumvention is
|
181
|
+
effected by exercising rights under this License with respect to the covered
|
182
|
+
work, and you disclaim any intention to limit operation or modification of the
|
183
|
+
work as a means of enforcing, against the work's users, your or third parties'
|
184
|
+
legal rights to forbid circumvention of technological measures.
|
185
|
+
|
186
|
+
### 4. Conveying Verbatim Copies.
|
187
|
+
|
188
|
+
You may convey verbatim copies of the Program's source code as you receive it,
|
189
|
+
in any medium, provided that you conspicuously and appropriately publish on each
|
190
|
+
copy an appropriate copyright notice; keep intact all notices stating that this
|
191
|
+
License and any non-permissive terms added in accord with section 7 apply to the
|
192
|
+
code; keep intact all notices of the absence of any warranty; and give all
|
193
|
+
recipients a copy of this License along with the Program.
|
194
|
+
|
195
|
+
You may charge any price or no price for each copy that you convey, and you may
|
196
|
+
offer support or warranty protection for a fee.
|
197
|
+
|
198
|
+
### 5. Conveying Modified Source Versions.
|
199
|
+
|
200
|
+
You may convey a work based on the Program, or the modifications to produce it
|
201
|
+
from the Program, in the form of source code under the terms of section 4,
|
202
|
+
provided that you also meet all of these conditions:
|
203
|
+
|
204
|
+
* a) The work must carry prominent notices stating that you modified it, and
|
205
|
+
giving a relevant date.
|
206
|
+
* b) The work must carry prominent notices stating that it is released under
|
207
|
+
this License and any conditions added under section 7. This requirement modifies
|
208
|
+
the requirement in section 4 to “keep intact all notices”.
|
209
|
+
* c) You must license the entire work, as a whole, under this License to anyone
|
210
|
+
who comes into possession of a copy. This License will therefore apply, along
|
211
|
+
with any applicable section 7 additional terms, to the whole of the work, and
|
212
|
+
all its parts, regardless of how they are packaged. This License gives no
|
213
|
+
permission to license the work in any other way, but it does not invalidate such
|
214
|
+
permission if you have separately received it.
|
215
|
+
* d) If the work has interactive user interfaces, each must display Appropriate
|
216
|
+
Legal Notices; however, if the Program has interactive interfaces that do not
|
217
|
+
display Appropriate Legal Notices, your work need not make them do so.
|
218
|
+
|
219
|
+
A compilation of a covered work with other separate and independent works, which
|
220
|
+
are not by their nature extensions of the covered work, and which are not
|
221
|
+
combined with it such as to form a larger program, in or on a volume of a
|
222
|
+
storage or distribution medium, is called an “aggregate” if the
|
223
|
+
compilation and its resulting copyright are not used to limit the access or
|
224
|
+
legal rights of the compilation's users beyond what the individual works permit.
|
225
|
+
Inclusion of a covered work in an aggregate does not cause this License to apply
|
226
|
+
to the other parts of the aggregate.
|
227
|
+
|
228
|
+
### 6. Conveying Non-Source Forms.
|
229
|
+
|
230
|
+
You may convey a covered work in object code form under the terms of sections 4
|
231
|
+
and 5, provided that you also convey the machine-readable Corresponding Source
|
232
|
+
under the terms of this License, in one of these ways:
|
233
|
+
|
234
|
+
* a) Convey the object code in, or embodied in, a physical product (including a
|
235
|
+
physical distribution medium), accompanied by the Corresponding Source fixed on
|
236
|
+
a durable physical medium customarily used for software interchange.
|
237
|
+
* b) Convey the object code in, or embodied in, a physical product (including a
|
238
|
+
physical distribution medium), accompanied by a written offer, valid for at
|
239
|
+
least three years and valid for as long as you offer spare parts or customer
|
240
|
+
support for that product model, to give anyone who possesses the object code
|
241
|
+
either (1) a copy of the Corresponding Source for all the software in the
|
242
|
+
product that is covered by this License, on a durable physical medium
|
243
|
+
customarily used for software interchange, for a price no more than your
|
244
|
+
reasonable cost of physically performing this conveying of source, or (2) access
|
245
|
+
to copy the Corresponding Source from a network server at no charge.
|
246
|
+
* c) Convey individual copies of the object code with a copy of the written
|
247
|
+
offer to provide the Corresponding Source. This alternative is allowed only
|
248
|
+
occasionally and noncommercially, and only if you received the object code with
|
249
|
+
such an offer, in accord with subsection 6b.
|
250
|
+
* d) Convey the object code by offering access from a designated place (gratis
|
251
|
+
or for a charge), and offer equivalent access to the Corresponding Source in the
|
252
|
+
same way through the same place at no further charge. You need not require
|
253
|
+
recipients to copy the Corresponding Source along with the object code. If the
|
254
|
+
place to copy the object code is a network server, the Corresponding Source may
|
255
|
+
be on a different server (operated by you or a third party) that supports
|
256
|
+
equivalent copying facilities, provided you maintain clear directions next to
|
257
|
+
the object code saying where to find the Corresponding Source. Regardless of
|
258
|
+
what server hosts the Corresponding Source, you remain obligated to ensure that
|
259
|
+
it is available for as long as needed to satisfy these requirements.
|
260
|
+
* e) Convey the object code using peer-to-peer transmission, provided you inform
|
261
|
+
other peers where the object code and Corresponding Source of the work are being
|
262
|
+
offered to the general public at no charge under subsection 6d.
|
263
|
+
|
264
|
+
A separable portion of the object code, whose source code is excluded from the
|
265
|
+
Corresponding Source as a System Library, need not be included in conveying the
|
266
|
+
object code work.
|
267
|
+
|
268
|
+
A “User Product” is either (1) a “consumer product”,
|
269
|
+
which means any tangible personal property which is normally used for personal,
|
270
|
+
family, or household purposes, or (2) anything designed or sold for
|
271
|
+
incorporation into a dwelling. In determining whether a product is a consumer
|
272
|
+
product, doubtful cases shall be resolved in favor of coverage. For a particular
|
273
|
+
product received by a particular user, “normally used” refers to a
|
274
|
+
typical or common use of that class of product, regardless of the status of the
|
275
|
+
particular user or of the way in which the particular user actually uses, or
|
276
|
+
expects or is expected to use, the product. A product is a consumer product
|
277
|
+
regardless of whether the product has substantial commercial, industrial or non-
|
278
|
+
consumer uses, unless such uses represent the only significant mode of use of
|
279
|
+
the product.
|
280
|
+
|
281
|
+
“Installation Information” for a User Product means any methods,
|
282
|
+
procedures, authorization keys, or other information required to install and
|
283
|
+
execute modified versions of a covered work in that User Product from a modified
|
284
|
+
version of its Corresponding Source. The information must suffice to ensure that
|
285
|
+
the continued functioning of the modified object code is in no case prevented or
|
286
|
+
interfered with solely because modification has been made.
|
287
|
+
|
288
|
+
If you convey an object code work under this section in, or with, or
|
289
|
+
specifically for use in, a User Product, and the conveying occurs as part of a
|
290
|
+
transaction in which the right of possession and use of the User Product is
|
291
|
+
transferred to the recipient in perpetuity or for a fixed term (regardless of
|
292
|
+
how the transaction is characterized), the Corresponding Source conveyed under
|
293
|
+
this section must be accompanied by the Installation Information. But this
|
294
|
+
requirement does not apply if neither you nor any third party retains the
|
295
|
+
ability to install modified object code on the User Product (for example, the
|
296
|
+
work has been installed in ROM).
|
297
|
+
|
298
|
+
The requirement to provide Installation Information does not include a
|
299
|
+
requirement to continue to provide support service, warranty, or updates for a
|
300
|
+
work that has been modified or installed by the recipient, or for the User
|
301
|
+
Product in which it has been modified or installed. Access to a network may be
|
302
|
+
denied when the modification itself materially and adversely affects the
|
303
|
+
operation of the network or violates the rules and protocols for communication
|
304
|
+
across the network.
|
305
|
+
|
306
|
+
Corresponding Source conveyed, and Installation Information provided, in accord
|
307
|
+
with this section must be in a format that is publicly documented (and with an
|
308
|
+
implementation available to the public in source code form), and must require no
|
309
|
+
special password or key for unpacking, reading or copying.
|
310
|
+
|
311
|
+
### 7. Additional Terms.
|
312
|
+
|
313
|
+
“Additional permissions” are terms that supplement the terms of this
|
314
|
+
License by making exceptions from one or more of its conditions. Additional
|
315
|
+
permissions that are applicable to the entire Program shall be treated as though
|
316
|
+
they were included in this License, to the extent that they are valid under
|
317
|
+
applicable law. If additional permissions apply only to part of the Program,
|
318
|
+
that part may be used separately under those permissions, but the entire Program
|
319
|
+
remains governed by this License without regard to the additional permissions.
|
320
|
+
|
321
|
+
When you convey a copy of a covered work, you may at your option remove any
|
322
|
+
additional permissions from that copy, or from any part of it. (Additional
|
323
|
+
permissions may be written to require their own removal in certain cases when
|
324
|
+
you modify the work.) You may place additional permissions on material, added by
|
325
|
+
you to a covered work, for which you have or can give appropriate copyright
|
326
|
+
permission.
|
327
|
+
|
328
|
+
Notwithstanding any other provision of this License, for material you add to a
|
329
|
+
covered work, you may (if authorized by the copyright holders of that material)
|
330
|
+
supplement the terms of this License with terms:
|
331
|
+
|
332
|
+
* a) Disclaiming warranty or limiting liability differently from the terms of
|
333
|
+
sections 15 and 16 of this License; or
|
334
|
+
* b) Requiring preservation of specified reasonable legal notices or author
|
335
|
+
attributions in that material or in the Appropriate Legal Notices displayed by
|
336
|
+
works containing it; or
|
337
|
+
* c) Prohibiting misrepresentation of the origin of that material, or requiring
|
338
|
+
that modified versions of such material be marked in reasonable ways as
|
339
|
+
different from the original version; or
|
340
|
+
* d) Limiting the use for publicity purposes of names of licensors or authors of
|
341
|
+
the material; or
|
342
|
+
* e) Declining to grant rights under trademark law for use of some trade names,
|
343
|
+
trademarks, or service marks; or
|
344
|
+
* f) Requiring indemnification of licensors and authors of that material by
|
345
|
+
anyone who conveys the material (or modified versions of it) with contractual
|
346
|
+
assumptions of liability to the recipient, for any liability that these
|
347
|
+
contractual assumptions directly impose on those licensors and authors.
|
348
|
+
|
349
|
+
All other non-permissive additional terms are considered “further
|
350
|
+
restrictions” within the meaning of section 10. If the Program as you
|
351
|
+
received it, or any part of it, contains a notice stating that it is governed by
|
352
|
+
this License along with a term that is a further restriction, you may remove
|
353
|
+
that term. If a license document contains a further restriction but permits
|
354
|
+
relicensing or conveying under this License, you may add to a covered work
|
355
|
+
material governed by the terms of that license document, provided that the
|
356
|
+
further restriction does not survive such relicensing or conveying.
|
357
|
+
|
358
|
+
If you add terms to a covered work in accord with this section, you must place,
|
359
|
+
in the relevant source files, a statement of the additional terms that apply to
|
360
|
+
those files, or a notice indicating where to find the applicable terms.
|
361
|
+
|
362
|
+
Additional terms, permissive or non-permissive, may be stated in the form of a
|
363
|
+
separately written license, or stated as exceptions; the above requirements
|
364
|
+
apply either way.
|
365
|
+
|
366
|
+
### 8. Termination.
|
367
|
+
|
368
|
+
You may not propagate or modify a covered work except as expressly provided
|
369
|
+
under this License. Any attempt otherwise to propagate or modify it is void, and
|
370
|
+
will automatically terminate your rights under this License (including any
|
371
|
+
patent licenses granted under the third paragraph of section 11).
|
372
|
+
|
373
|
+
However, if you cease all violation of this License, then your license from a
|
374
|
+
particular copyright holder is reinstated (a) provisionally, unless and until
|
375
|
+
the copyright holder explicitly and finally terminates your license, and (b)
|
376
|
+
permanently, if the copyright holder fails to notify you of the violation by
|
377
|
+
some reasonable means prior to 60 days after the cessation.
|
378
|
+
|
379
|
+
Moreover, your license from a particular copyright holder is reinstated
|
380
|
+
permanently if the copyright holder notifies you of the violation by some
|
381
|
+
reasonable means, this is the first time you have received notice of violation
|
382
|
+
of this License (for any work) from that copyright holder, and you cure the
|
383
|
+
violation prior to 30 days after your receipt of the notice.
|
384
|
+
|
385
|
+
Termination of your rights under this section does not terminate the licenses of
|
386
|
+
parties who have received copies or rights from you under this License. If your
|
387
|
+
rights have been terminated and not permanently reinstated, you do not qualify
|
388
|
+
to receive new licenses for the same material under section 10.
|
389
|
+
|
390
|
+
### 9. Acceptance Not Required for Having Copies.
|
391
|
+
|
392
|
+
You are not required to accept this License in order to receive or run a copy of
|
393
|
+
the Program. Ancillary propagation of a covered work occurring solely as a
|
394
|
+
consequence of using peer-to-peer transmission to receive a copy likewise does
|
395
|
+
not require acceptance. However, nothing other than this License grants you
|
396
|
+
permission to propagate or modify any covered work. These actions infringe
|
397
|
+
copyright if you do not accept this License. Therefore, by modifying or
|
398
|
+
propagating a covered work, you indicate your acceptance of this License to do
|
399
|
+
so.
|
400
|
+
|
401
|
+
### 10. Automatic Licensing of Downstream Recipients.
|
402
|
+
|
403
|
+
Each time you convey a covered work, the recipient automatically receives a
|
404
|
+
license from the original licensors, to run, modify and propagate that work,
|
405
|
+
subject to this License. You are not responsible for enforcing compliance by
|
406
|
+
third parties with this License.
|
407
|
+
|
408
|
+
An “entity transaction” is a transaction transferring control of an
|
409
|
+
organization, or substantially all assets of one, or subdividing an
|
410
|
+
organization, or merging organizations. If propagation of a covered work results
|
411
|
+
from an entity transaction, each party to that transaction who receives a copy
|
412
|
+
of the work also receives whatever licenses to the work the party's predecessor
|
413
|
+
in interest had or could give under the previous paragraph, plus a right to
|
414
|
+
possession of the Corresponding Source of the work from the predecessor in
|
415
|
+
interest, if the predecessor has it or can get it with reasonable efforts.
|
416
|
+
|
417
|
+
You may not impose any further restrictions on the exercise of the rights
|
418
|
+
granted or affirmed under this License. For example, you may not impose a
|
419
|
+
license fee, royalty, or other charge for exercise of rights granted under this
|
420
|
+
License, and you may not initiate litigation (including a cross-claim or
|
421
|
+
counterclaim in a lawsuit) alleging that any patent claim is infringed by
|
422
|
+
making, using, selling, offering for sale, or importing the Program or any
|
423
|
+
portion of it.
|
424
|
+
|
425
|
+
### 11. Patents.
|
426
|
+
|
427
|
+
A “contributor” is a copyright holder who authorizes use under this
|
428
|
+
License of the Program or a work on which the Program is based. The work thus
|
429
|
+
licensed is called the contributor's “contributor version”.
|
430
|
+
|
431
|
+
A contributor's “essential patent claims” are all patent claims
|
432
|
+
owned or controlled by the contributor, whether already acquired or hereafter
|
433
|
+
acquired, that would be infringed by some manner, permitted by this License, of
|
434
|
+
making, using, or selling its contributor version, but do not include claims
|
435
|
+
that would be infringed only as a consequence of further modification of the
|
436
|
+
contributor version. For purposes of this definition, “control”
|
437
|
+
includes the right to grant patent sublicenses in a manner consistent with the
|
438
|
+
requirements of this License.
|
439
|
+
|
440
|
+
Each contributor grants you a non-exclusive, worldwide, royalty-free patent
|
441
|
+
license under the contributor's essential patent claims, to make, use, sell,
|
442
|
+
offer for sale, import and otherwise run, modify and propagate the contents of
|
443
|
+
its contributor version.
|
444
|
+
|
445
|
+
In the following three paragraphs, a “patent license” is any express
|
446
|
+
agreement or commitment, however denominated, not to enforce a patent (such as
|
447
|
+
an express permission to practice a patent or covenant not to sue for patent
|
448
|
+
infringement). To “grant” such a patent license to a party means to
|
449
|
+
make such an agreement or commitment not to enforce a patent against the party.
|
450
|
+
|
451
|
+
If you convey a covered work, knowingly relying on a patent license, and the
|
452
|
+
Corresponding Source of the work is not available for anyone to copy, free of
|
453
|
+
charge and under the terms of this License, through a publicly available network
|
454
|
+
server or other readily accessible means, then you must either (1) cause the
|
455
|
+
Corresponding Source to be so available, or (2) arrange to deprive yourself of
|
456
|
+
the benefit of the patent license for this particular work, or (3) arrange, in a
|
457
|
+
manner consistent with the requirements of this License, to extend the patent
|
458
|
+
license to downstream recipients. “Knowingly relying” means you have
|
459
|
+
actual knowledge that, but for the patent license, your conveying the covered
|
460
|
+
work in a country, or your recipient's use of the covered work in a country,
|
461
|
+
would infringe one or more identifiable patents in that country that you have
|
462
|
+
reason to believe are valid.
|
463
|
+
|
464
|
+
If, pursuant to or in connection with a single transaction or arrangement, you
|
465
|
+
convey, or propagate by procuring conveyance of, a covered work, and grant a
|
466
|
+
patent license to some of the parties receiving the covered work authorizing
|
467
|
+
them to use, propagate, modify or convey a specific copy of the covered work,
|
468
|
+
then the patent license you grant is automatically extended to all recipients of
|
469
|
+
the covered work and works based on it.
|
470
|
+
|
471
|
+
A patent license is “discriminatory” if it does not include within
|
472
|
+
the scope of its coverage, prohibits the exercise of, or is conditioned on the
|
473
|
+
non-exercise of one or more of the rights that are specifically granted under
|
474
|
+
this License. You may not convey a covered work if you are a party to an
|
475
|
+
arrangement with a third party that is in the business of distributing software,
|
476
|
+
under which you make payment to the third party based on the extent of your
|
477
|
+
activity of conveying the work, and under which the third party grants, to any
|
478
|
+
of the parties who would receive the covered work from you, a discriminatory
|
479
|
+
patent license (a) in connection with copies of the covered work conveyed by you
|
480
|
+
(or copies made from those copies), or (b) primarily for and in connection with
|
481
|
+
specific products or compilations that contain the covered work, unless you
|
482
|
+
entered into that arrangement, or that patent license was granted, prior to 28
|
483
|
+
March 2007.
|
484
|
+
|
485
|
+
Nothing in this License shall be construed as excluding or limiting any implied
|
486
|
+
license or other defenses to infringement that may otherwise be available to you
|
487
|
+
under applicable patent law.
|
488
|
+
|
489
|
+
### 12. No Surrender of Others' Freedom.
|
490
|
+
|
491
|
+
If conditions are imposed on you (whether by court order, agreement or
|
492
|
+
otherwise) that contradict the conditions of this License, they do not excuse
|
493
|
+
you from the conditions of this License. If you cannot convey a covered work so
|
494
|
+
as to satisfy simultaneously your obligations under this License and any other
|
495
|
+
pertinent obligations, then as a consequence you may not convey it at all. For
|
496
|
+
example, if you agree to terms that obligate you to collect a royalty for
|
497
|
+
further conveying from those to whom you convey the Program, the only way you
|
498
|
+
could satisfy both those terms and this License would be to refrain entirely
|
499
|
+
from conveying the Program.
|
500
|
+
|
501
|
+
### 13. Use with the GNU Affero General Public License.
|
502
|
+
|
503
|
+
Notwithstanding any other provision of this License, you have permission to link
|
504
|
+
or combine any covered work with a work licensed under version 3 of the GNU
|
505
|
+
Affero General Public License into a single combined work, and to convey the
|
506
|
+
resulting work. The terms of this License will continue to apply to the part
|
507
|
+
which is the covered work, but the special requirements of the GNU Affero
|
508
|
+
General Public License, section 13, concerning interaction through a network
|
509
|
+
will apply to the combination as such.
|
510
|
+
|
511
|
+
### 14. Revised Versions of this License.
|
512
|
+
|
513
|
+
The Free Software Foundation may publish revised and/or new versions of the GNU
|
514
|
+
General Public License from time to time. Such new versions will be similar in
|
515
|
+
spirit to the present version, but may differ in detail to address new problems
|
516
|
+
or concerns.
|
517
|
+
|
518
|
+
Each version is given a distinguishing version number. If the Program specifies
|
519
|
+
that a certain numbered version of the GNU General Public License “or any
|
520
|
+
later version” applies to it, you have the option of following the terms
|
521
|
+
and conditions either of that numbered version or of any later version published
|
522
|
+
by the Free Software Foundation. If the Program does not specify a version
|
523
|
+
number of the GNU General Public License, you may choose any version ever
|
524
|
+
published by the Free Software Foundation.
|
525
|
+
|
526
|
+
If the Program specifies that a proxy can decide which future versions of the
|
527
|
+
GNU General Public License can be used, that proxy's public statement of
|
528
|
+
acceptance of a version permanently authorizes you to choose that version for
|
529
|
+
the Program.
|
530
|
+
|
531
|
+
Later license versions may give you additional or different permissions.
|
532
|
+
However, no additional obligations are imposed on any author or copyright holder
|
533
|
+
as a result of your choosing to follow a later version.
|
534
|
+
|
535
|
+
### 15. Disclaimer of Warranty.
|
536
|
+
|
537
|
+
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
538
|
+
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER
|
539
|
+
PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND,
|
540
|
+
EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
541
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE
|
542
|
+
RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
543
|
+
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR
|
544
|
+
OR CORRECTION.
|
545
|
+
|
546
|
+
### 16. Limitation of Liability.
|
547
|
+
|
548
|
+
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY
|
549
|
+
COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS
|
550
|
+
PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
|
551
|
+
INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
|
552
|
+
THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED
|
553
|
+
INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE
|
554
|
+
PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY
|
555
|
+
HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
556
|
+
|
557
|
+
### 17. Interpretation of Sections 15 and 16.
|
558
|
+
|
559
|
+
If the disclaimer of warranty and limitation of liability provided above cannot
|
560
|
+
be given local legal effect according to their terms, reviewing courts shall
|
561
|
+
apply local law that most closely approximates an absolute waiver of all civil
|
562
|
+
liability in connection with the Program, unless a warranty or assumption of
|
563
|
+
liability accompanies a copy of the Program in return for a fee.
|
564
|
+
|
565
|
+
END OF TERMS AND CONDITIONS
|
566
|
+
|
567
|
+
## How to Apply These Terms to Your New Programs
|
568
|
+
|
569
|
+
If you develop a new program, and you want it to be of the greatest possible use
|
570
|
+
to the public, the best way to achieve this is to make it free software which
|
571
|
+
everyone can redistribute and change under these terms.
|
572
|
+
|
573
|
+
To do so, attach the following notices to the program. It is safest to attach
|
574
|
+
them to the start of each source file to most effectively state the exclusion of
|
575
|
+
warranty; and each file should have at least the “copyright” line
|
576
|
+
and a pointer to where the full notice is found.
|
577
|
+
|
578
|
+
<one line to give the program's name and a brief idea of what it does.>
|
579
|
+
Copyright (C) <year> <name of author>
|
580
|
+
|
581
|
+
This program is free software: you can redistribute it and/or modify it
|
582
|
+
under the terms of the GNU General Public License as published by the Free
|
583
|
+
Software Foundation, either version 3 of the License, or (at your option)
|
584
|
+
any later version.
|
585
|
+
|
586
|
+
This program is distributed in the hope that it will be useful, but WITHOUT
|
587
|
+
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
588
|
+
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
589
|
+
more details.
|
590
|
+
|
591
|
+
You should have received a copy of the GNU General Public License along with
|
592
|
+
this program. If not, see <http://www.gnu.org/licenses/>.
|
593
|
+
|
594
|
+
Also add information on how to contact you by electronic and paper mail.
|
595
|
+
|
596
|
+
If the program does terminal interaction, make it output a short notice like
|
597
|
+
this when it starts in an interactive mode:
|
598
|
+
|
599
|
+
<program> Copyright (C) <year> <name of author>
|
600
|
+
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
601
|
+
This is free software, and you are welcome to redistribute it under certain
|
602
|
+
conditions; type `show c' for details.
|
603
|
+
|
604
|
+
The hypothetical commands `show w` and `show c` should show the appropriate
|
605
|
+
parts of the General Public License. Of course, your program's commands might be
|
606
|
+
different; for a GUI interface, you would use an “about box”.
|
607
|
+
|
608
|
+
You should also get your employer (if you work as a programmer) or school, if
|
609
|
+
any, to sign a “copyright disclaimer” for the program, if necessary.
|
610
|
+
For more information on this, and how to apply and follow the GNU GPL, see
|
611
|
+
<<http://www.gnu.org/licenses/>>.
|
612
|
+
|
613
|
+
The GNU General Public License does not permit incorporating your program into
|
614
|
+
proprietary programs. If your program is a subroutine library, you may consider
|
615
|
+
it more useful to permit linking proprietary applications with the library. If
|
616
|
+
this is what you want to do, use the GNU Lesser General Public License instead
|
617
|
+
of this License. But first, please read <<http://www.gnu.org/philosophy/why-
|
618
|
+
not-lgpl.html>>.
|
data/README.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# Capwagen
|
2
|
+
|
3
|
+
Capistrano integration for Kraftwagen projects. More information coming soon.
|
4
|
+
For the more adventurous of you a very short tutorial below.
|
5
|
+
|
6
|
+
* This is very inmature code at the moment. DO NOT use it for production
|
7
|
+
deployments unless you do not care about breaking your production site.*
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
```
|
12
|
+
gem install capwagen
|
13
|
+
```
|
14
|
+
|
15
|
+
## Adding Capwagen to your project
|
16
|
+
|
17
|
+
```
|
18
|
+
cd /path/to/project/src
|
19
|
+
capwagen .
|
20
|
+
```
|
21
|
+
|
22
|
+
Change `/path/to/project/src/cap/deploy.rb` to fit your configuration.
|
23
|
+
|
24
|
+
## Running a deployment
|
25
|
+
|
26
|
+
```
|
27
|
+
cd /path/top/project/src
|
28
|
+
cap deploy
|
29
|
+
```
|
data/bin/capwagen
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'capwagen/version'
|
4
|
+
|
5
|
+
require 'optparse'
|
6
|
+
require 'fileutils'
|
7
|
+
|
8
|
+
|
9
|
+
OptionParser.new do |opts|
|
10
|
+
opts.banner = "Usage: #{File.basename($0)} [path]"
|
11
|
+
|
12
|
+
opts.on("-h", "--help", "Displays this help info") do
|
13
|
+
puts opts
|
14
|
+
exit 0
|
15
|
+
end
|
16
|
+
|
17
|
+
opts.on("-v", "--version", "") do
|
18
|
+
puts "capwagen v#{Capwagen::VERSION}"
|
19
|
+
exit 0
|
20
|
+
end
|
21
|
+
|
22
|
+
begin
|
23
|
+
opts.parse!(ARGV)
|
24
|
+
rescue OptionParser::ParseError => e
|
25
|
+
warn e.message
|
26
|
+
puts opts
|
27
|
+
exit 1
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
if ARGV.empty?
|
32
|
+
abort "Please specify the directory to capwagen, e.g. `#{File.basename($0)} .'"
|
33
|
+
elsif !File.exists?(ARGV.first)
|
34
|
+
abort "`#{ARGV.first}' does not exist."
|
35
|
+
elsif !File.directory?(ARGV.first)
|
36
|
+
abort "`#{ARGV.first}' is not a directory."
|
37
|
+
elsif ARGV.length > 1
|
38
|
+
abort "Too many arguments; please specify only the directory to capwagen."
|
39
|
+
end
|
40
|
+
|
41
|
+
def unindent(string)
|
42
|
+
indentation = string[/\A\s*/]
|
43
|
+
string.strip.gsub(/^#{indentation}/, "")
|
44
|
+
end
|
45
|
+
|
46
|
+
base = ARGV.shift
|
47
|
+
|
48
|
+
files = {
|
49
|
+
"Capfile" => unindent(<<-FILE),
|
50
|
+
load 'deploy'
|
51
|
+
|
52
|
+
require 'capwagen'
|
53
|
+
load 'cap/deploy'
|
54
|
+
FILE
|
55
|
+
|
56
|
+
"cap/deploy.rb" => unindent(<<-FILE)
|
57
|
+
set :repository, "REPOSITORY_URL"
|
58
|
+
set :scm, :git
|
59
|
+
|
60
|
+
role :web, "domain.ext", :primary => true
|
61
|
+
set :deploy_to, "/path/to/application"
|
62
|
+
|
63
|
+
# if you want to clean up old releases on each deploy uncomment this:
|
64
|
+
# after "deploy:restart", "deploy:cleanup"
|
65
|
+
|
66
|
+
# Be more verbose by uncommenting the following line
|
67
|
+
# logger.level = Logger::MAX_LEVEL
|
68
|
+
FILE
|
69
|
+
}
|
70
|
+
|
71
|
+
files.each do |file, content|
|
72
|
+
file = File.join(base, file)
|
73
|
+
if File.exists?(file)
|
74
|
+
warn "[skip] '#{file}' already exists"
|
75
|
+
elsif File.exists?(file.downcase)
|
76
|
+
warn "[skip] '#{file.downcase}' exists, which could conflict with `#{file}'"
|
77
|
+
else
|
78
|
+
unless File.exists?(File.dirname(file))
|
79
|
+
puts "[add] making directory '#{File.dirname(file)}'"
|
80
|
+
FileUtils.mkdir_p(File.dirname(file))
|
81
|
+
end
|
82
|
+
puts "[add] writing '#{file}'"
|
83
|
+
File.open(file, "w") { |f| f.write(content) }
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
puts "[done] Kraftwagen project capwagened!"
|
@@ -0,0 +1,138 @@
|
|
1
|
+
require 'capistrano/recipes/deploy/strategy/base'
|
2
|
+
require 'tmpdir'
|
3
|
+
|
4
|
+
module Capistrano
|
5
|
+
module Deploy
|
6
|
+
module Strategy
|
7
|
+
class CapwagenLocalBuild < Base
|
8
|
+
Compression = Struct.new(:extension, :compress_command, :decompress_command)
|
9
|
+
|
10
|
+
def deploy!
|
11
|
+
checkout_source
|
12
|
+
make_copy_dir
|
13
|
+
make_build
|
14
|
+
create_revision_file
|
15
|
+
compress_build
|
16
|
+
distribute!
|
17
|
+
ensure
|
18
|
+
remove_temporary_files
|
19
|
+
end
|
20
|
+
|
21
|
+
# define methods to access the various temporary files and directories
|
22
|
+
@@temp_names = [:source_dir, :build_make_file, :copy_dir]
|
23
|
+
@@temp_names.each do |name|
|
24
|
+
define_method("#{name}") do
|
25
|
+
next instance_variable_get("@#{name}") unless instance_variable_get("@#{name}").nil?
|
26
|
+
Dir::Tmpname.create(configuration[:capwagen_tmp_basename]) do |path|
|
27
|
+
instance_variable_set("@#{name}", path)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
private name
|
31
|
+
end
|
32
|
+
|
33
|
+
private
|
34
|
+
# Get the source of the projects from the repository.
|
35
|
+
def checkout_source
|
36
|
+
system(source.export(revision, source_dir))
|
37
|
+
end
|
38
|
+
|
39
|
+
# Create the directory where our build is generated and our archive is
|
40
|
+
# created.
|
41
|
+
def make_copy_dir
|
42
|
+
system("mkdir #{copy_dir}")
|
43
|
+
end
|
44
|
+
|
45
|
+
# Perform the Kraftwagen build
|
46
|
+
def make_build
|
47
|
+
execute = []
|
48
|
+
execute << "#{drush_cmd} kw-generate-makefile #{build_make_file} #{source_dir}"
|
49
|
+
execute << "#{drush_cmd} make #{build_make_file} #{build_dir} --concurrency=1"
|
50
|
+
system(execute.join(" && "))
|
51
|
+
end
|
52
|
+
|
53
|
+
# Add a revision file to the build, to make sure we can find out later
|
54
|
+
# which revision we created the build from.
|
55
|
+
def create_revision_file
|
56
|
+
File.open(File.join(build_dir, "REVISION"), "w") { |f| f.puts(revision) }
|
57
|
+
end
|
58
|
+
|
59
|
+
# Create a the archive from the build
|
60
|
+
def compress_build
|
61
|
+
execute "Compressing #{build_dir} to #{compressed_filename}" do
|
62
|
+
Dir.chdir(copy_dir) { system(compress(File.basename(build_dir), File.basename(compressed_filename)).join(" ")) }
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
# Upload the archive and the recompress it.
|
67
|
+
def distribute!
|
68
|
+
upload(compressed_filename, remote_compressed_filename)
|
69
|
+
decompress_remote_file
|
70
|
+
end
|
71
|
+
|
72
|
+
# Remove the temporary files and directories
|
73
|
+
def remove_temporary_files
|
74
|
+
execute = []
|
75
|
+
@@temp_names.each do |name|
|
76
|
+
execute << "rm -Rf #{instance_variable_get("@#{name}")}" unless instance_variable_get("@#{name}").nil?
|
77
|
+
end
|
78
|
+
system(execute.join(" && ")) unless execute.empty?
|
79
|
+
end
|
80
|
+
|
81
|
+
# Find out where the build should be created
|
82
|
+
def build_dir
|
83
|
+
@build_dir ||= File.join(copy_dir, File.basename(configuration[:release_path]))
|
84
|
+
end
|
85
|
+
# Find out how the compressed file should be called
|
86
|
+
def compressed_filename
|
87
|
+
@compressed_filename ||= File.join(copy_dir, "#{File.basename(build_dir)}.#{compression.extension}")
|
88
|
+
end
|
89
|
+
# Find out to which directory we should upload
|
90
|
+
def remote_dir
|
91
|
+
@remote_dir ||= configuration[:capwagen_remote_dir] || "/tmp"
|
92
|
+
end
|
93
|
+
# Find out the name of the compressed file at the server
|
94
|
+
def remote_compressed_filename
|
95
|
+
@remote_filename ||= File.join(remote_dir, File.basename(compressed_filename))
|
96
|
+
end
|
97
|
+
|
98
|
+
# The methods to compress and decompress the files
|
99
|
+
def compress(directory, file)
|
100
|
+
compression.compress_command + [file, directory]
|
101
|
+
end
|
102
|
+
def decompress(file)
|
103
|
+
compression.decompress_command + [file]
|
104
|
+
end
|
105
|
+
def compression
|
106
|
+
remote_tar = configuration[:capwagen_remote_tar] || 'tar'
|
107
|
+
local_tar = configuration[:capwagen_local_tar] || 'tar'
|
108
|
+
|
109
|
+
type = configuration[:capwagen_compression] || :gzip
|
110
|
+
case type
|
111
|
+
when :gzip, :gz then Compression.new("tar.gz", [local_tar, 'czf'], [remote_tar, 'xzf'])
|
112
|
+
when :bzip2, :bz2 then Compression.new("tar.bz2", [local_tar, 'cjf'], [remote_tar, 'xjf'])
|
113
|
+
else raise ArgumentError, "invalid compression type #{type.inspect}"
|
114
|
+
end
|
115
|
+
end
|
116
|
+
def decompress_remote_file
|
117
|
+
run "cd #{configuration[:releases_path]} && #{decompress(remote_compressed_filename).join(" ")} && rm #{remote_compressed_filename}"
|
118
|
+
end
|
119
|
+
|
120
|
+
# The methods to execute some commands with error checking
|
121
|
+
def execute description, &block
|
122
|
+
logger.debug description
|
123
|
+
handle_system_errors &block
|
124
|
+
end
|
125
|
+
def handle_system_errors &block
|
126
|
+
block.call
|
127
|
+
raise_command_failed if last_command_failed?
|
128
|
+
end
|
129
|
+
def last_command_failed?
|
130
|
+
$? != 0
|
131
|
+
end
|
132
|
+
def raise_command_failed
|
133
|
+
raise Capistrano::Error, "shell command failed with return code #{$?}"
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|
data/lib/capwagen.rb
ADDED
@@ -0,0 +1,217 @@
|
|
1
|
+
|
2
|
+
require 'capwagen/version'
|
3
|
+
|
4
|
+
module Capwagen
|
5
|
+
def self.load_into(configuration)
|
6
|
+
configuration.load do
|
7
|
+
set :drush_cmd, 'drush'
|
8
|
+
|
9
|
+
set :deploy_via, :capwagen_local_build
|
10
|
+
|
11
|
+
set :capwagen_tmp_basename, 'capwagen'
|
12
|
+
set :kraftwagen_environment, 'production'
|
13
|
+
|
14
|
+
set :normalize_asset_timestamps, false
|
15
|
+
|
16
|
+
set :drupal_site_name, 'default'
|
17
|
+
set(:shared_files) {
|
18
|
+
["sites/#{drupal_site_name}/settings.php",
|
19
|
+
"sites/#{drupal_site_name}/settings.local.php"]
|
20
|
+
}
|
21
|
+
set(:shared_dirs) {
|
22
|
+
["sites/#{drupal_site_name}/files"]
|
23
|
+
}
|
24
|
+
|
25
|
+
namespace :deploy do
|
26
|
+
# We override the default update task, because we need to add our own
|
27
|
+
# routines between the defaults
|
28
|
+
task :update do
|
29
|
+
transaction do
|
30
|
+
update_code
|
31
|
+
find_and_execute_task("drupal:offline")
|
32
|
+
create_symlink
|
33
|
+
find_and_execute_task("kraftwagen:update")
|
34
|
+
find_and_execute_task("drupal:online")
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
# We override the default finalize update task, because our logic for
|
39
|
+
# filling projects with the correct symlinks, is completely different from
|
40
|
+
# Rails projects.
|
41
|
+
task :finalize_update, :except => { :no_release => true } do
|
42
|
+
run "chmod -R g+w #{latest_release}" if fetch(:group_writable, true)
|
43
|
+
|
44
|
+
# mkdir -p is making sure that the directories are there for some SCM's that don't
|
45
|
+
# save empty folders
|
46
|
+
(shared_files + shared_dirs).map do |d|
|
47
|
+
if (d.rindex('/')) then
|
48
|
+
run "rm -rf #{latest_release}/#{d} && mkdir -p #{latest_release}/#{d.slice(0..(d.rindex('/')))}"
|
49
|
+
else
|
50
|
+
run "rm -rf #{latest_release}/#{d}"
|
51
|
+
end
|
52
|
+
run "ln -s #{shared_path}/#{d.split('/').last} #{latest_release}/#{d}"
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
task :setup, :except => { :no_release => true } do
|
57
|
+
dirs = [deploy_to, releases_path, shared_path]
|
58
|
+
dirs += shared_dirs.map { |d| File.join(shared_path, d.split('/').last) }
|
59
|
+
run "#{try_sudo} mkdir -p #{dirs.join(' ')}"
|
60
|
+
run "#{try_sudo} chmod g+w #{dirs.join(' ')}" if fetch(:group_writable, true)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
# The Drupal namespace contains the commands for Drupal that is not specific
|
65
|
+
# to the Kraftwagen update process
|
66
|
+
namespace :drupal do
|
67
|
+
task :cache_clear, :except => { :no_release => true }, :only => { :primary => true } do
|
68
|
+
run "cd #{latest_release} && #{drush_cmd} cache-clear all"
|
69
|
+
end
|
70
|
+
task :cache_clear_drush do
|
71
|
+
run "cd #{latest_release} && #{drush_cmd} cache-clear drush"
|
72
|
+
end
|
73
|
+
task :offline, :except => { :no_release => true }, :only => { :primary => true } do
|
74
|
+
run "cd #{latest_release} && #{drush_cmd} variable-set maintenance_mode 1 --yes"
|
75
|
+
cache_clear
|
76
|
+
end
|
77
|
+
task :online, :except => { :no_release => true }, :only => { :primary => true } do
|
78
|
+
run "cd #{latest_release} && #{drush_cmd} variable-set maintenance_mode 0 --yes"
|
79
|
+
cache_clear
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
# The Kraftwagen namespace contains the Kraftwagen update process
|
84
|
+
namespace :kraftwagen do
|
85
|
+
task :update do
|
86
|
+
apply_module_dependencies
|
87
|
+
updatedb
|
88
|
+
find_and_execute_task("drupal:cache_clear_drush")
|
89
|
+
features_revert
|
90
|
+
find_and_execute_task("drupal:cache_clear")
|
91
|
+
manifests
|
92
|
+
find_and_execute_task("drupal:cache_clear")
|
93
|
+
end
|
94
|
+
|
95
|
+
task :apply_module_dependencies do
|
96
|
+
run "cd #{latest_release} && #{drush_cmd} kw-apply-module-dependencies #{kraftwagen_environment}"
|
97
|
+
end
|
98
|
+
task :updatedb do
|
99
|
+
run "cd #{latest_release} && #{drush_cmd} updatedb"
|
100
|
+
end
|
101
|
+
task :features_revert do
|
102
|
+
run "cd #{latest_release} && #{drush_cmd} features-revert-all --yes"
|
103
|
+
end
|
104
|
+
task :manifests do
|
105
|
+
run "cd #{latest_release} && #{drush_cmd} kw-manifests #{kraftwagen_environment}"
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
Capistrano::Configuration.instance.load do
|
114
|
+
set :drush_cmd, 'drush'
|
115
|
+
|
116
|
+
set :deploy_via, :capwagen_local_build
|
117
|
+
|
118
|
+
set :capwagen_tmp_basename, 'capwagen'
|
119
|
+
set :kraftwagen_environment, 'production'
|
120
|
+
|
121
|
+
set :normalize_asset_timestamps, false
|
122
|
+
|
123
|
+
set :drupal_site_name, 'default'
|
124
|
+
set(:shared_files) {
|
125
|
+
["sites/#{drupal_site_name}/settings.php",
|
126
|
+
"sites/#{drupal_site_name}/settings.local.php"]
|
127
|
+
}
|
128
|
+
set(:shared_dirs) {
|
129
|
+
["sites/#{drupal_site_name}/files"]
|
130
|
+
}
|
131
|
+
|
132
|
+
namespace :deploy do
|
133
|
+
# We override the default update task, because we need to add our own
|
134
|
+
# routines between the defaults
|
135
|
+
task :update do
|
136
|
+
transaction do
|
137
|
+
update_code
|
138
|
+
find_and_execute_task("drupal:offline")
|
139
|
+
create_symlink
|
140
|
+
find_and_execute_task("kraftwagen:update")
|
141
|
+
find_and_execute_task("drupal:online")
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
# We override the default finalize update task, because our logic for
|
146
|
+
# filling projects with the correct symlinks, is completely different from
|
147
|
+
# Rails projects.
|
148
|
+
task :finalize_update, :except => { :no_release => true } do
|
149
|
+
run "chmod -R g+w #{latest_release}" if fetch(:group_writable, true)
|
150
|
+
|
151
|
+
# mkdir -p is making sure that the directories are there for some SCM's that don't
|
152
|
+
# save empty folders
|
153
|
+
(shared_files + shared_dirs).map do |d|
|
154
|
+
if (d.rindex('/')) then
|
155
|
+
run "rm -rf #{latest_release}/#{d} && mkdir -p #{latest_release}/#{d.slice(0..(d.rindex('/')))}"
|
156
|
+
else
|
157
|
+
run "rm -rf #{latest_release}/#{d}"
|
158
|
+
end
|
159
|
+
run "ln -s #{shared_path}/#{d.split('/').last} #{latest_release}/#{d}"
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
task :setup, :except => { :no_release => true } do
|
164
|
+
dirs = [deploy_to, releases_path, shared_path]
|
165
|
+
dirs += shared_dirs.map { |d| File.join(shared_path, d.split('/').last) }
|
166
|
+
run "#{try_sudo} mkdir -p #{dirs.join(' ')}"
|
167
|
+
run "#{try_sudo} chmod g+w #{dirs.join(' ')}" if fetch(:group_writable, true)
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
# The Drupal namespace contains the commands for Drupal that is not specific
|
172
|
+
# to the Kraftwagen update process
|
173
|
+
namespace :drupal do
|
174
|
+
task :cache_clear, :except => { :no_release => true }, :only => { :primary => true } do
|
175
|
+
run "cd #{latest_release} && #{drush_cmd} cache-clear all"
|
176
|
+
end
|
177
|
+
task :cache_clear_drush do
|
178
|
+
run "cd #{latest_release} && #{drush_cmd} cache-clear drush"
|
179
|
+
end
|
180
|
+
task :offline, :except => { :no_release => true }, :only => { :primary => true } do
|
181
|
+
run "cd #{latest_release} && #{drush_cmd} variable-set maintenance_mode 1 --yes"
|
182
|
+
cache_clear
|
183
|
+
end
|
184
|
+
task :online, :except => { :no_release => true }, :only => { :primary => true } do
|
185
|
+
run "cd #{latest_release} && #{drush_cmd} variable-set maintenance_mode 0 --yes"
|
186
|
+
cache_clear
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
# The Kraftwagen namespace contains the Kraftwagen update process
|
191
|
+
namespace :kraftwagen do
|
192
|
+
task :update do
|
193
|
+
apply_module_dependencies
|
194
|
+
updatedb
|
195
|
+
find_and_execute_task("drupal:cache_clear_drush")
|
196
|
+
features_revert
|
197
|
+
find_and_execute_task("drupal:cache_clear")
|
198
|
+
manifests
|
199
|
+
find_and_execute_task("drupal:cache_clear")
|
200
|
+
end
|
201
|
+
|
202
|
+
task :apply_module_dependencies do
|
203
|
+
run "cd #{latest_release} && #{drush_cmd} kw-apply-module-dependencies #{kraftwagen_environment}"
|
204
|
+
end
|
205
|
+
task :updatedb do
|
206
|
+
run "cd #{latest_release} && #{drush_cmd} updatedb"
|
207
|
+
end
|
208
|
+
task :features_revert do
|
209
|
+
run "cd #{latest_release} && #{drush_cmd} features-revert-all --yes"
|
210
|
+
end
|
211
|
+
task :manifests do
|
212
|
+
run "cd #{latest_release} && #{drush_cmd} kw-manifests #{kraftwagen_environment}"
|
213
|
+
end
|
214
|
+
end
|
215
|
+
end
|
216
|
+
|
217
|
+
Capwagen.load_into(Capistrano::Configuration.instance)
|
metadata
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: capwagen
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Rolf van de Krol
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-02-26 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: capistrano
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 2.14.2
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 2.14.2
|
30
|
+
description: ! ' Capistrano is an open source tool for running scripts on multiple
|
31
|
+
servers. It’s primary use is for easily deploying applications. While it was built
|
32
|
+
specifically for deploying Rails apps, it’s pretty simple to customize it to deploy
|
33
|
+
other types of applications. This package is a deployment "recipe" to work with
|
34
|
+
Kraftwagen/Drupal applications.
|
35
|
+
|
36
|
+
'
|
37
|
+
email:
|
38
|
+
- info AT rolfvandekrol DOT com
|
39
|
+
executables:
|
40
|
+
- capwagen
|
41
|
+
extensions: []
|
42
|
+
extra_rdoc_files: []
|
43
|
+
files:
|
44
|
+
- bin/capwagen
|
45
|
+
- lib/capistrano/recipes/deploy/strategy/capwagen_local_build.rb
|
46
|
+
- lib/capwagen/version.rb
|
47
|
+
- lib/capwagen.rb
|
48
|
+
- README.md
|
49
|
+
- LICENSE.md
|
50
|
+
homepage: http://github.com/kraftwagen/capwagen
|
51
|
+
licenses: []
|
52
|
+
post_install_message:
|
53
|
+
rdoc_options: []
|
54
|
+
require_paths:
|
55
|
+
- lib
|
56
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
63
|
+
none: false
|
64
|
+
requirements:
|
65
|
+
- - ! '>='
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
requirements: []
|
69
|
+
rubyforge_project: capwagen
|
70
|
+
rubygems_version: 1.8.25
|
71
|
+
signing_key:
|
72
|
+
specification_version: 3
|
73
|
+
summary: Deploying Kraftwagen/Drupal applications with Capistrano.
|
74
|
+
test_files: []
|