about summary refs log tree commit diff stats
path: root/manual.tex
blob: a61421b2c410f028ba139b4035899c3310657e72 (plain) (blame)
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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
\input texinfo
@setfilename dscip.info
@settitle Dead Simple Continuous Integration POSIX

@copying
@verbatim
Creative Commons Legal Code

CC0 1.0 Universal

    CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
    LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
    ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
    INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
    REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
    PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
    THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
    HEREUNDER.

Statement of Purpose

The laws of most jurisdictions throughout the world automatically confer
exclusive Copyright and Related Rights (defined below) upon the creator
and subsequent owner(s) (each and all, an "owner") of an original work of
authorship and/or a database (each, a "Work").

Certain owners wish to permanently relinquish those rights to a Work for
the purpose of contributing to a commons of creative, cultural and
scientific works ("Commons") that the public can reliably and without fear
of later claims of infringement build upon, modify, incorporate in other
works, reuse and redistribute as freely as possible in any form whatsoever
and for any purposes, including without limitation commercial purposes.
These owners may contribute to the Commons to promote the ideal of a free
culture and the further production of creative, cultural and scientific
works, or to gain reputation or greater distribution for their Work in
part through the use and efforts of others.

For these and/or other purposes and motivations, and without any
expectation of additional consideration or compensation, the person
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
is an owner of Copyright and Related Rights in the Work, voluntarily
elects to apply CC0 to the Work and publicly distribute the Work under its
terms, with knowledge of his or her Copyright and Related Rights in the
Work and the meaning and intended legal effect of CC0 on those rights.

1. Copyright and Related Rights. A Work made available under CC0 may be
protected by copyright and related or neighboring rights ("Copyright and
Related Rights"). Copyright and Related Rights include, but are not
limited to, the following:

  i. the right to reproduce, adapt, distribute, perform, display,
     communicate, and translate a Work;
 ii. moral rights retained by the original author(s) and/or performer(s);
iii. publicity and privacy rights pertaining to a person's image or
     likeness depicted in a Work;
 iv. rights protecting against unfair competition in regards to a Work,
     subject to the limitations in paragraph 4(a), below;
  v. rights protecting the extraction, dissemination, use and reuse of data
     in a Work;
 vi. database rights (such as those arising under Directive 96/9/EC of the
     European Parliament and of the Council of 11 March 1996 on the legal
     protection of databases, and under any national implementation
     thereof, including any amended or successor version of such
     directive); and
vii. other similar, equivalent or corresponding rights throughout the
     world based on applicable law or treaty, and any national
     implementations thereof.

2. Waiver. To the greatest extent permitted by, but not in contravention
of, applicable law, Affirmer hereby overtly, fully, permanently,
irrevocably and unconditionally waives, abandons, and surrenders all of
Affirmer's Copyright and Related Rights and associated claims and causes
of action, whether now known or unknown (including existing as well as
future claims and causes of action), in the Work (i) in all territories
worldwide, (ii) for the maximum duration provided by applicable law or
treaty (including future time extensions), (iii) in any current or future
medium and for any number of copies, and (iv) for any purpose whatsoever,
including without limitation commercial, advertising or promotional
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
member of the public at large and to the detriment of Affirmer's heirs and
successors, fully intending that such Waiver shall not be subject to
revocation, rescission, cancellation, termination, or any other legal or
equitable action to disrupt the quiet enjoyment of the Work by the public
as contemplated by Affirmer's express Statement of Purpose.

3. Public License Fallback. Should any part of the Waiver for any reason
be judged legally invalid or ineffective under applicable law, then the
Waiver shall be preserved to the maximum extent permitted taking into
account Affirmer's express Statement of Purpose. In addition, to the
extent the Waiver is so judged Affirmer hereby grants to each affected
person a royalty-free, non transferable, non sublicensable, non exclusive,
irrevocable and unconditional license to exercise Affirmer's Copyright and
Related Rights in the Work (i) in all territories worldwide, (ii) for the
maximum duration provided by applicable law or treaty (including future
time extensions), (iii) in any current or future medium and for any number
of copies, and (iv) for any purpose whatsoever, including without
limitation commercial, advertising or promotional purposes (the
"License"). The License shall be deemed effective as of the date CC0 was
applied by Affirmer to the Work. Should any part of the License for any
reason be judged legally invalid or ineffective under applicable law, such
partial invalidity or ineffectiveness shall not invalidate the remainder
of the License, and in such case Affirmer hereby affirms that he or she
will not (i) exercise any of his or her remaining Copyright and Related
Rights in the Work or (ii) assert any associated claims and causes of
action with respect to the Work, in either case contrary to Affirmer's
express Statement of Purpose.

4. Limitations and Disclaimers.

 a. No trademark or patent rights held by Affirmer are waived, abandoned,
    surrendered, licensed or otherwise affected by this document.
 b. Affirmer offers the Work as-is and makes no representations or
    warranties of any kind concerning the Work, express, implied,
    statutory or otherwise, including without limitation warranties of
    title, merchantability, fitness for a particular purpose, non
    infringement, or the absence of latent or other defects, accuracy, or
    the present or absence of errors, whether or not discoverable, all to
    the greatest extent permissible under applicable law.
 c. Affirmer disclaims responsibility for clearing rights of other persons
    that may apply to the Work or any use thereof, including without
    limitation any person's Copyright and Related Rights in the Work.
    Further, Affirmer disclaims responsibility for obtaining any necessary
    consents, permissions or other rights required for any use of the
    Work.
 d. Affirmer understands and acknowledges that Creative Commons is not a
    party to this document and has no duty or obligation with respect to
    this CC0 or use of the Work.
@end verbatim
@end copying

@contents

@node Top
@top Dead Simple Continuous Integration POSIX Manual

This is the manual for the Dead Simple Continuous Integration POSIX program.

@verbatim
Dead Simple Continuous Integration POSIX Manual by Charadon
(DSCIP Manual for short.)

To the extent possible under law, the person who associated CC0 with
DSCIP Manual has waived all copyright and related or neighboring rights
to DSCIP Manual.

You should have received a copy of the CC0 legalcode along with this
work.  If not, see:
@end verbatim
@url{https://creativecommons.org/publicdomain/zero/1.0/}.

@menu
* Installing::
* Using::
* Quirks::

* Manual's License::
* Index::
@end menu

@node Installing
@chapter Installing
@cindex Installing
	Details on installing DSCIP onto various systems.
	@node Downloading
	@section Downloading
	@cindex Downloading
		Currently, the upstream repo for DSCIP is located at this
		@url{https://www.opencode.net/charadon/dscip, Git Repo}. If your OS
		doesn't have DSCIP packaged, you can download the @command{setup.sh}
		from the releases page, and use that to install dscip. Alternatively,
		you can clone the git repo into whatever directory you want.
	@node Unix
	@section Unix
		@cindex Installing on Unix
		In this section, Unix refers to systems that are similar in nature to the
		old System V Unix or is POSIX in nature. This would include: Linux, BSD,
		Mac, Haiku, and Illumos.@*@*
		The instructions will pretty much be the same for all systems.

		@node As a Package
		@subsection As a Package
		@cindex Unix: Installing Packaged DSCIP
			If your host OS packaged DSCIP correctly according to 
			Packaging (@xref{Packaging}), these instructions should work.

			@enumerate
			@item
			Run @command{setup-dscip} in the terminal. See @command{setup-dscip
			-h} for more details.
			@item
			Add the new script as a cronjob or daemon. See your OS's
			manual for instructions on how to do so.
			@end enumerate
			
			And that's it! You're ready to go!

		@node Manually
		@subsection Manually
		@cindex Unix: Install Manually
			While not as simple as if it was packaged. The process is still not
			that hard.
			@enumerate
			@item
			Run @command{setup.sh}. See @command{setup.sh -h} for more
			details.
			@item
			Add the new script as a cronjob or daemon. See your OS's manual
			for instructions on how to do so.
			@end enumerate
			And that's it! You're ready to go!

	@node Windows
	@section Windows
	@cindex Installing on Windows
		Windows is a different beast from Unix. So it warrants it's own dedicated
		section.
		@node MSYS2 (Recommended)
		@subsection MSYS2 (Recommended)
		@cindex Windows: Installing on MSYS2
			@enumerate
			@item
			Install @url{https://www.msys2.org, MSYS2} in whatever way you want. I recommend using
			@url{https://scoop.sh, Scoop}.
			@item
			Once MSYS2 is installed, run setup.sh (@command{setup.sh -h} for
			more info.).
			@item
			Next, we'll need to set it up as a service since Windows doesn't
			really have cronjobs. I recommend using @url{https://nssm.cc, NSSM}
			to create a service for Windows.
			@item
			Edit config.sh and set @env{DSCIP_DAEMON} to true, and set
			@env{DSCIP_DAEMON_FORK} to false.
			@item
			Next, create a batch/powershell script to launch MSYS2 to run the
			dscip script. Here's an example batch script:
			@example
set MSYSTEM=MINGW64
"C:\Users\builder.DESKTOP-U8KQJI1\scoop\apps\msys2\current\usr\bin\bash" -l -c "path/to/dscip"
			@end example
			@item
			Next, run @command{nssm install <name of service>} and set follow
			it's instructions. You can also use
			@url{https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/sc-create,
			sc.exe} if you'd rather not use NSSM.
			@item
			Then you just open services.msc and run it, or use @command{nssm
			start name-of-service}, if you went with NSSM.
			
			@end enumerate
	
		@node Only Bash
		@subsection Bash
		@cindex Windows: Installing with only Bash
			The easiest way to get Bash on Windows is to install git, so we'll
			be assuming that path.
			@enumerate
			@item
			Install @url{https://gitforwindows.org/, Git for Windows}, I recommend using @url{https://scoop.sh,
			Scoop}.
			@item
			Once Git is installed, you should be able to run @command{bash} from
			the command prompt or powershell. Once in Bash, run setup.sh
			(@command{setup.sh -h} for more info.) and install dscip.
			@item
			Once installed, you'll need to set up a service for it. I recommend
			using @url{https://nssm.cc, NSSM} for an easier time.
			@item
			Open config.sh and change @env{DSCIP_DAEMON} to true, and set
			@env{DSCIP_DAEMON_FORK} to false.
			@item
			Create a Batch or Powershell script, here's an example batch script:
			@*
			@example
			bash "C:\path\to\dscip"
			@end example
			@item
			Once the script is done being made, you can use NSSM to create the
			service, or
			@url{https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/sc-create,
			sc.exe}.
			@item
			Now just open services.msc or @command{nssm start <name-of-service>}
			to start it.
			@end enumerate
		
	
	@node Packaging
	@section Packaging
	@cindex Packaging
		Packaging is pretty easy, just run @command{make install} and it'll do
		everything for you. You can use environment variables to change where
		certain things go though.
		@enumerate
		@item
		@env{PREFIX}: This specifies where on the system everything will go. By
		default it's /usr/local.
		@item
		@env{BINDIR}: The directory to install setup.sh to. When installed, it
		will change it's name to @command{setup-dscip}.
		@item
		@env{INFODIR}: The directory to install the manual. Default is
		@env{PREFIX}/share/info.
		@end enumerate
		@noindent
		This is the general layout that the Makefile defaults to:
		@example
├── bin
│   └── setup-dscip (setup.sh)
└── share
    ├── charadon
    │   └── dscip
    │       ├── build.sh
    │       ├── config.sh
    │       ├── dscip
    │       ├── failed.sh
    │       ├── post.sh
    │       └── pre.sh
    └── info
        └── dscip.info.gz
		@end example
		@*
		@noindent
		You'll note two things:
		@enumerate
		@item
		@command{update.sh} is not included. This is mainly mean't for non-package
		installs. Such as direct @command{git} clones, or using the
		@command{setup.sh} script on it's own.
		@item
		@env{SCRIPT_DIR} cannot be changed from it's default of
		$PREFIX/share/charadon/dscip. This is because the @command{setup.sh}
		script relies on the scripts being there to symlink to them.
		@end enumerate

	@node Using Templates
	@section Using Templates
	@cindex Using Templates
		Templates are an easy way to quickly get a DSCIP instance up and
		running. Since most developers tend to have all their projects build
		almost the exact same way, you can easily create a git repo with your DSCIP
		scripts and have the setup script copy them over. You can point to the
		directory containing your templates by using the @option{-t} argument with
		setup.sh. You find find an example of templates here at my
		@url{https://www.opencode.net/charadon/my-dscip-templates-v1, Git Repo}
		
	

@node Using
@chapter Using
@cindex Using
	This chapter goes over how to actually use DSCIP.
	@node Basic Variables
	@section Basic Variables
	@cindex Basic Variables
		This section goes over variables that you can safely modify in
		config.sh.
		@subsection DSCIP_GITREPO
		@cindex Basic Variables: DSCIP_GITREPO
			This is the variable that determines what git repo DSCIP clones into
			wrkdir.
		@subsection DSCIP_NAME
		@cindex Basic Variables: DSCIP_NAME
			This variable determines the name of the program that's being build.
			Mostly for use with the @command{post.sh} and @command{failed.sh}
			scripts when publishing artifacts.
		@subsection DSCIP_BRANCH
		@cindex Basic Variables: DSCIP_BRANCH
			This variable tells DSCIP which branch to clone. This is useful if
			you	develop in a branch other than master.
		@subsection DSCIP_DAEMON
		@cindex Basic Variables: DSCIP_DAEMON
			This variable will tell DSCIP to not close, but rather stay open and
			just sleep before re-running itself. Useful for Windows, if you
			want DSCIP to run in shorter time periods than 60 seconds, or use
			special features that your OS's init system gives.
		@subsection DSCIP_DAEMON_FORK
		@cindex Basic Variables: DSCIP_DAEMON_FORK
			This variable tells DSCIP if it should run itself in the background.
			Some init systems prefer one or the other, so consult your OS's
			documentation.
		@subsection DSCIP_SLEEP
		@cindex Basic Variables: DSCIP_SLEEP
			When in daemon mode, this controls how long DSCIP should wait
			between attempted builds before checking for a new commit and
			building if one exists.
		@subsection DSCIP_OUTPUT_TO
		@cindex Basic Variables: DSCIP_OUTPUT_TO
			This variable tells DSCIP where to put logs. By default it puts all
			output into output.txt. This is useful if, for example, you're
			running DSCIP in daemon mode, and need to store logs somewhere else.
	@node Advanced Variables
	@section Advanced Variables
	@cindex Advanced Variables
		These are variables you should only change if you absolutely need to!
		@subsection DSCIP_GITMODE
		@cindex Advanced Variables: DSCIP_GITMODE
			This tells DSCIP to, rather than delete the wrkdir and get a fresh
			clone, to just pull changes. This is really only useful in
			situations where you have limited bandwidth.
		@subsection WORKING_DIRECTORY
		@cindex Advanced Variables: WORKING_DIRECTORY
			This should probably never be changed. The only situation that
			*might* warrant changing it, is in a very restricted environment
			where it *has* to run in a specific place.
		@subsection DSCIP_@{PRE,BUILD,POST,FAILED@}_CMD
		@cindex Advanced Variables: DSCIP_@{PRE,BUILD,POST,FAILED@}_CMD
			These variables tell DSCIP where to find their respective scripts. Like
			WORKING_DIRECTORY, this really shouldn't be changed and is really
			only useful in situations that are very restrictive.
		@subsection DSCIP_DISREGARD_COMMIT_CHECK
		@cindex Advanced Variables: DSCIP_DISREGARD_COMMIT_CHECK
			This variable tells DSCIP to ignore the commit check and just keep
			rebuilding. This is useful for seeing if old/unmaintained software
			will still build on modern systems. But other than that, should be
			left off.
		@subsection DSCIP_AUTO_UPDATE
		@cindex Advanced Variables: DSCIP_AUTO_UPDATE
			This variable tells DSCIP to run @command{update.sh}, and then run a
			checksum on itself. If it's different from when it first launched,
			It'll re-run itself. This is useful for manual installations.

@node Quirks
@chapter Quirks
@cindex Quirks
	This chapter goes over various quirks that have been discovered with DSCIP.
	None so far...

@node Manual's License
@chapter Manual's License
@cindex Manual's License
	@insertcopying

	

@node Index
@unnumbered Index
@printindex cp

@bye