Commit a2516fe0222e4144e77b1956beb08584135ea62a

Authored by Jacob Vosmaer
1 parent 6efc3d6a

Move build instructions to doc/build.md

Showing 2 changed files with 157 additions and 153 deletions   Show diff stats
README.md
... ... @@ -51,157 +51,6 @@ Omnibus-gitlab uses four different directories.
51 51 - `/var/log/gitlab` contains all log data generated by components of
52 52 omnibus-gitlab.
53 53  
54   -## Preparing a build environment
  54 +## Building your own package
55 55  
56   -To create builds you will need a build user (`omnibus-build:omnibus-build` in our example).
57   -Preparing the build machine requires sudo access.
58   -
59   -### Ubuntu 12.04
60   -
61   -```shell
62   -# Install dependencies
63   -sudo apt-get install ruby1.9.1 ruby1.9.1-dev git build-essential
64   -sudo gem install --no-ri --no-rdoc bundler
65   -
66   -# Create build directories for use by the build user
67   -sudo mkdir -p /opt/gitlab /var/cache/omnibus
68   -# We assume the build user and group is 'omnibus-build'
69   -sudo chown omnibus-build:omnibus-build /opt/gitlab /var/cache/omnibus
70   -```
71   -
72   -Then, as the build user (omnibus-build):
73   -
74   -```shell
75   -# Clone the omnibus repo
76   -git clone https://gitlab.com/gitlab-org/omnibus-gitlab.git
77   -
78   -# Install gem dependencies for omnibus-ruby
79   -cd omnibus-gitlab
80   -bundle install --path .bundle --binstubs
81   -
82   -# Do a build (and take a break from the computer)
83   -bin/omnibus build project gitlab
84   -```
85   -
86   -### Centos 6.5
87   -
88   -```shell
89   -sudo yum groupinstall 'Development Tools'
90   -# Install RedHat Software Collections to get Ruby 1.9.3
91   -sudo yum install centos-release-SCL
92   -sudo yum install ruby193 ruby193-ruby-devel
93   -
94   -# Create build directories for use by the build user
95   -sudo mkdir -p /opt/gitlab /var/cache/omnibus
96   -# We assume the build user and group is 'omnibus-build'
97   -sudo chown omnibus-build:omnibus-build /opt/gitlab /var/cache/omnibus
98   -```
99   -
100   -As the build user (omnibus-build):
101   -
102   -```shell
103   -# Enable Ruby 1.9.3 from Software Collections
104   -echo 'exec scl enable ruby193 bash' >> .bash_profile
105   -# Start a new login shell so we do not have to log out and in
106   -# this one time
107   -bash --login
108   -
109   -# Clone the omnibus repo
110   -git clone https://gitlab.com/gitlab-org/omnibus-gitlab.git
111   -
112   -# Install gem dependencies for omnibus-ruby
113   -cd omnibus-gitlab
114   -bundle install --path .bundle --binstubs
115   -
116   -# Do a build (and take a break from the computer)
117   -bin/omnibus build project gitlab
118   -```
119   -
120   -## Usage
121   -
122   -### Build
123   -
124   -You create a platform-specific package using the `build project` command:
125   -
126   -```shell
127   -$ bin/omnibus build project gitlab
128   -```
129   -
130   -The platform/architecture type of the package created will match the platform
131   -where the `build project` command is invoked. So running this command on say a
132   -MacBook Pro will generate a Mac OS X specific package. After the build
133   -completes packages will be available in `pkg/`.
134   -
135   -### Clean
136   -
137   -You can clean up all temporary files generated during the build process with
138   -the `clean` command:
139   -
140   -```shell
141   -$ bin/omnibus clean
142   -```
143   -
144   -Adding the `--purge` purge option removes __ALL__ files generated during the
145   -build including the project install directory (`/opt/gitlab`) and
146   -the package cache directory (`/var/cache/omnibus/pkg`):
147   -
148   -```shell
149   -$ bin/omnibus clean --purge
150   -```
151   -
152   -### Help
153   -
154   -Full help for the Omnibus command line interface can be accessed with the
155   -`help` command:
156   -
157   -```shell
158   -$ bin/omnibus help
159   -```
160   -
161   -## Vagrant-based Virtualized Build Lab
162   -
163   -Every Omnibus project ships will a project-specific
164   -[Berksfile](http://berkshelf.com/) and [Vagrantfile](http://www.vagrantup.com/)
165   -that will allow you to build your projects on the following platforms:
166   -
167   -* CentOS 5 64-bit
168   -* CentOS 6 64-bit
169   -* Ubuntu 10.04 64-bit
170   -* Ubuntu 11.04 64-bit
171   -* Ubuntu 12.04 64-bit
172   -
173   -Please note this build-lab is only meant to get you up and running quickly;
174   -there's nothing inherent in Omnibus that restricts you to just building CentOS
175   -or Ubuntu packages. See the Vagrantfile to add new platforms to your build lab.
176   -
177   -The only requirements for standing up this virtualized build lab are:
178   -
179   -* VirtualBox - native packages exist for most platforms and can be downloaded
180   -from the [VirtualBox downloads page](https://www.virtualbox.org/wiki/Downloads).
181   -* Vagrant 1.2.1+ - native packages exist for most platforms and can be downloaded
182   -from the [Vagrant downloads page](http://downloads.vagrantup.com/).
183   -
184   -The [vagrant-berkshelf](https://github.com/RiotGames/vagrant-berkshelf) and
185   -[vagrant-omnibus](https://github.com/schisamo/vagrant-omnibus) Vagrant plugins
186   -are also required and can be installed easily with the following commands:
187   -
188   -```shell
189   -$ vagrant plugin install vagrant-berkshelf
190   -$ vagrant plugin install vagrant-omnibus
191   -```
192   -
193   -Once the pre-requisites are installed you can build your package across all
194   -platforms with the following command:
195   -
196   -```shell
197   -$ vagrant up
198   -```
199   -
200   -If you would like to build a package for a single platform the command looks like this:
201   -
202   -```shell
203   -$ vagrant up PLATFORM
204   -```
205   -
206   -The complete list of valid platform names can be viewed with the
207   -`vagrant status` command.
  56 +See (doc/build.md).
... ...
doc/build.md 0 → 100644
... ... @@ -0,0 +1,155 @@
  1 +# Preparing a build environment
  2 +
  3 +To create builds you will need a build user (`omnibus-build:omnibus-build` in our example).
  4 +Preparing the build machine requires sudo access.
  5 +
  6 +## Ubuntu 12.04
  7 +
  8 +```shell
  9 +# Install dependencies
  10 +sudo apt-get install ruby1.9.1 ruby1.9.1-dev git build-essential
  11 +sudo gem install --no-ri --no-rdoc bundler
  12 +
  13 +# Create build directories for use by the build user
  14 +sudo mkdir -p /opt/gitlab /var/cache/omnibus
  15 +# We assume the build user and group is 'omnibus-build'
  16 +sudo chown omnibus-build:omnibus-build /opt/gitlab /var/cache/omnibus
  17 +```
  18 +
  19 +Then, as the build user (omnibus-build):
  20 +
  21 +```shell
  22 +# Clone the omnibus repo
  23 +git clone https://gitlab.com/gitlab-org/omnibus-gitlab.git
  24 +
  25 +# Install gem dependencies for omnibus-ruby
  26 +cd omnibus-gitlab
  27 +bundle install --path .bundle --binstubs
  28 +
  29 +# Do a build (and take a break from the computer)
  30 +bin/omnibus build project gitlab
  31 +```
  32 +
  33 +## Centos 6.5
  34 +
  35 +```shell
  36 +sudo yum groupinstall 'Development Tools'
  37 +# Install RedHat Software Collections to get Ruby 1.9.3
  38 +sudo yum install centos-release-SCL
  39 +sudo yum install ruby193 ruby193-ruby-devel
  40 +
  41 +# Create build directories for use by the build user
  42 +sudo mkdir -p /opt/gitlab /var/cache/omnibus
  43 +# We assume the build user and group is 'omnibus-build'
  44 +sudo chown omnibus-build:omnibus-build /opt/gitlab /var/cache/omnibus
  45 +```
  46 +
  47 +As the build user (omnibus-build):
  48 +
  49 +```shell
  50 +# Enable Ruby 1.9.3 from Software Collections
  51 +echo 'exec scl enable ruby193 bash' >> .bash_profile
  52 +# Start a new login shell so we do not have to log out and in
  53 +# this one time
  54 +bash --login
  55 +
  56 +# Clone the omnibus repo
  57 +git clone https://gitlab.com/gitlab-org/omnibus-gitlab.git
  58 +
  59 +# Install gem dependencies for omnibus-ruby
  60 +cd omnibus-gitlab
  61 +bundle install --path .bundle --binstubs
  62 +
  63 +# Do a build (and take a break from the computer)
  64 +bin/omnibus build project gitlab
  65 +```
  66 +
  67 +## Usage
  68 +
  69 +### Build
  70 +
  71 +You create a platform-specific package using the `build project` command:
  72 +
  73 +```shell
  74 +$ bin/omnibus build project gitlab
  75 +```
  76 +
  77 +The platform/architecture type of the package created will match the platform
  78 +where the `build project` command is invoked. So running this command on say a
  79 +MacBook Pro will generate a Mac OS X specific package. After the build
  80 +completes packages will be available in `pkg/`.
  81 +
  82 +### Clean
  83 +
  84 +You can clean up all temporary files generated during the build process with
  85 +the `clean` command:
  86 +
  87 +```shell
  88 +$ bin/omnibus clean
  89 +```
  90 +
  91 +Adding the `--purge` purge option removes __ALL__ files generated during the
  92 +build including the project install directory (`/opt/gitlab`) and
  93 +the package cache directory (`/var/cache/omnibus/pkg`):
  94 +
  95 +```shell
  96 +$ bin/omnibus clean --purge
  97 +```
  98 +
  99 +### Help
  100 +
  101 +Full help for the Omnibus command line interface can be accessed with the
  102 +`help` command:
  103 +
  104 +```shell
  105 +$ bin/omnibus help
  106 +```
  107 +
  108 +## Vagrant-based Virtualized Build Lab
  109 +
  110 +Every Omnibus project ships will a project-specific
  111 +[Berksfile](http://berkshelf.com/) and [Vagrantfile](http://www.vagrantup.com/)
  112 +that will allow you to build your projects on the following platforms:
  113 +
  114 +* CentOS 5 64-bit
  115 +* CentOS 6 64-bit
  116 +* Ubuntu 10.04 64-bit
  117 +* Ubuntu 11.04 64-bit
  118 +* Ubuntu 12.04 64-bit
  119 +
  120 +Please note this build-lab is only meant to get you up and running quickly;
  121 +there's nothing inherent in Omnibus that restricts you to just building CentOS
  122 +or Ubuntu packages. See the Vagrantfile to add new platforms to your build lab.
  123 +
  124 +The only requirements for standing up this virtualized build lab are:
  125 +
  126 +* VirtualBox - native packages exist for most platforms and can be downloaded
  127 +from the [VirtualBox downloads page](https://www.virtualbox.org/wiki/Downloads).
  128 +* Vagrant 1.2.1+ - native packages exist for most platforms and can be downloaded
  129 +from the [Vagrant downloads page](http://downloads.vagrantup.com/).
  130 +
  131 +The [vagrant-berkshelf](https://github.com/RiotGames/vagrant-berkshelf) and
  132 +[vagrant-omnibus](https://github.com/schisamo/vagrant-omnibus) Vagrant plugins
  133 +are also required and can be installed easily with the following commands:
  134 +
  135 +```shell
  136 +$ vagrant plugin install vagrant-berkshelf
  137 +$ vagrant plugin install vagrant-omnibus
  138 +```
  139 +
  140 +Once the pre-requisites are installed you can build your package across all
  141 +platforms with the following command:
  142 +
  143 +```shell
  144 +$ vagrant up
  145 +```
  146 +
  147 +If you would like to build a package for a single platform the command looks like this:
  148 +
  149 +```shell
  150 +$ vagrant up PLATFORM
  151 +```
  152 +
  153 +The complete list of valid platform names can be viewed with the
  154 +`vagrant status` command.
  155 +
... ...