You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+32-3
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,13 @@ c4-bootstrap is split into to major scripts and two directory structures.
8
8
9
9
##Requirements
10
10
11
-
##Commands
11
+
git-core
12
+
bash
13
+
Ubuntu
14
+
15
+
##HOWTO c4-bootstrap
16
+
17
+
##Commands in Detail
12
18
13
19
###bootstrap.sh
14
20
bootstrap.sh allows you to quickly setup your system to specified environment, it will run pre.d and post.d scripts and also copy your directory structure from files to the root of the system. The follow explains how the script works.
@@ -35,9 +41,32 @@ This part of the script takes the contents of files/.... and copies them to / Th
35
41
The final part of the script is post.d. This is called in the same way as pre.d and itterates through scripts/post.d/XXXX. In post.d you should run things that can only be done once the software is installed and the files are in place. An example of this would be _*a2ensite mysite.conf*_. Yet again these are bash scripts and will be run in numerical order.
36
42
37
43
###repack.sh
38
-
whilst repack.sh allows you to commit local system changes back to a git repo in order repeat these changes on other servers.
44
+
repack.sh allows you to commit local system changes back to a git repo in order repeat these changes on other servers.
45
+
46
+
####Environment checks
47
+
On running the repack.sh scrip the system checks for the system distro name and the version. The version number can be tweaked at the top of the file by altering the followinf variable:
48
+
49
+
supported_dist="Ubuntu"
50
+
supported_vers="10.04"
51
+
52
+
This ensures that you are packaging for the same version as the bootstrap.sh
53
+
54
+
####repack scripts
55
+
The repack scripts live in the scripts/repack directory. Care should be taken when editing current scripts or adding to this directory.
56
+
#####00-suckfiles.sh
57
+
suck files enables repack.sh to pull back into the local directory all the changes you've made on the system in specified directories. in the example script it purely backs up /var/www. It handles /var/www in a special way to compensate for the fact you may have a lot of files in that location by tar.gz the directory and storing it in files/var/tmp/SiteContent.tgz this is also referenced by bootstrap.sh and is exploded in post.d/00-explode-files.sh
58
+
59
+
Other directories specified are simply copied to files/....... verbatum.
60
+
61
+
You can add extra locations to be backed up by modifying the array below in scripts/repack/00-suckfiles.sh:
62
+
63
+
working_dirs=( /var/www/ )
64
+
65
+
the folowing would also copy the contents of /etc/apache2/
66
+
67
+
working_dirs=( /var/www/ /etc/apache2/ )
39
68
40
-
###Files
69
+
##Files
41
70
42
71
The file structure of the system is kept within files, this should be treated as a mirror of your root / for example files/etc/nginx/nginx.conf after bootstrap.sh is run will map to /etc/nginx/nginx.conf
0 commit comments