-
Notifications
You must be signed in to change notification settings - Fork 124
Improve buildkit installation docs #224
Changes from 4 commits
76c8105
eb8e22c
a698d51
bb27c6e
3485d72
0015e66
36b10fb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,20 +11,22 @@ This is the same collection of tools which manages the test/demo/release infrast | |
|
||
### Ubuntu | ||
|
||
If you have a new installation of Ubuntu 12.04 or 14.04, then you can download | ||
If you have a new installation of Ubuntu 12.04 or later, then you can download | ||
everything -- buildkit and the system requirements -- with one command. This | ||
command will install buildkit to `~/buildkit`: | ||
|
||
```bash | ||
curl -Ls https://civicrm.org/get-buildkit.sh | bash -s -- --full --dir ~/buildkit | ||
``` | ||
|
||
Note: | ||
!!! note | ||
|
||
* When executing the above command, you should *not* run as `root`. However, you *should* | ||
have `sudo` permissions. | ||
* The `--full` option is *very opinionated*; it specifically installs `php`, `apache`, and `mysql` (rather than `hhvm`, `nginx`, `lighttpd`, or `percona`). If you try to mix `--full` with alternative systems, then expect conflicts. | ||
* If you use the Ubuntu feature for "encrypted home directories", then don't put buildkit in `~/buildkit`. Consider `/opt/buildkit`, `/srv/buildkit`, or some other location that remains available during reboot. | ||
* When executing the above command, you should *not* run as `root`. However, you *should* | ||
have `sudo` permissions. | ||
* The `--full` option is *very opinionated*; it specifically installs `php`, `apache`, and `mysql` (rather than `hhvm`, `nginx`, `lighttpd`, or `percona`). If you try to mix `--full` with alternative systems, then expect conflicts. | ||
* If you use the Ubuntu feature for "encrypted home directories", then don't put buildkit in `~/buildkit`. Consider `/opt/buildkit`, `/srv/buildkit`, or some other location that remains available during reboot. | ||
|
||
After running the above command, then proceed to the [post-installation configuration](#config). | ||
|
||
### Vagrant | ||
|
||
|
@@ -59,44 +61,15 @@ true for MAMP, XAMPP, and other downloaded packages. | |
Once the pre-requisites are met, download buildkit to `~/buildkit`: | ||
|
||
```bash | ||
git clone https://github.com/civicrm/civicrm-buildkit.git ~/buildkit | ||
cd ~/buildkit | ||
./bin/civi-download-tools | ||
``` | ||
|
||
### Troubleshooting | ||
|
||
* Nodejs version too old or npm update does not work | ||
|
||
Download the latest version from nodejs.org and follow to their instructions | ||
|
||
* Nodejs problems | ||
|
||
It might be handy to run | ||
|
||
```bash | ||
npm update | ||
npm install fs-extra | ||
$ git clone https://github.com/civicrm/civicrm-buildkit.git ~/buildkit | ||
$ cd ~/buildkit | ||
$ ./bin/civi-download-tools | ||
``` | ||
|
||
## Applying a patch | ||
|
||
Using buildkit, you can create a CiviCRM environment with the PR applied. | ||
|
||
For example: | ||
## Post-install configuration {:#config} | ||
|
||
```bash | ||
civibuild create dmaster \ | ||
--url http://localhost:8001 \ | ||
--patch https://github.com/civicrm/civicrm-core/pull/8494 \ | ||
--admin-pass s3cr3t | ||
``` | ||
|
||
This will create a test environment with the Drupal, CiviCRM master branch | ||
and the patch in PR 8494. More detailed information is in the | ||
[Civibuild documentation](https://github.com/civicrm/civicrm-buildkit/blob/master/doc/civibuild.md) | ||
|
||
## Configuring buildkit after installation {:#configuring} | ||
### Configuring your path {:#path} | ||
|
||
!!! note "Not needed for Vagrant/Docker installations" | ||
If you set up buildkit using Vagrant or Docker, then you don't need to perform the configuration steps listed here. | ||
|
@@ -135,6 +108,84 @@ If you want to ensure that the buildkit CLI tools are always available, then: | |
Each time you open a new terminal while working on Civi development, you would need to re-run the `export` command. | ||
|
||
|
||
### Configuring `amp` {:#amp-config} | ||
|
||
Buildkit provides a tool called `amp` which [civibuild](/tools/civibuild.md) uses when it needs to set up a new site. Before you can use `civibuild`, need to configure `amp` by telling it a bit about your system (e.g. what webserver you're using). | ||
|
||
#### Interactive config | ||
|
||
``` | ||
$ amp config | ||
``` | ||
|
||
!!! tip "tips" | ||
* Run this as a non-`root` user who has `sudo` permission. This will ensure that new files are owned by a regular user, and (if necessary) it enables `civibuild` to restart your webserver and edit `/etc/hosts`. | ||
* Pay close attention to any instructions given in the output of this command. They may involve adding a line to your Apache or nginx configuration file. | ||
* To check which version of apache you have, run `apachectl -v` | ||
|
||
#### Testing amp's configuration {:#amp-test} | ||
|
||
Test that `amp` is correctly configured. | ||
|
||
``` | ||
$ amp test | ||
``` | ||
|
||
!!! failure "Troubleshooting errors from `amp test`" | ||
|
||
* Try manually adding settings to your sebserver, as described below. | ||
* Re-run `amp config`. | ||
|
||
#### Manually adding settings to your webserver {:#amp-webserver} | ||
|
||
During one of the steps in the `amp config` process, `amp` will *attempt to* alter the system-wide settings for your local webserver (apache or nginx). On some platforms, `amp` is not able to perform the necessary configuration and you must do it manually by following these steps: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems like a misunderstanding -- Random:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree that it doesn't alter apache or nginx it does modify the hostfile which is http related, I suppose the most sensible thing i can think amp doing would be is to write out the include as a new file in the right directory. But as Chris pointed out finding that correct directory maybe tricky There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup. Currently the In an ideal world, that script would stop and ask the user what to do. Depending on what config files/directories are around, it would present a menu like:
If they choose 1-3, it would call This way, it's harder for a user to ignore the step, but we still rely on their judgment for where/how to make the change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
1. Identify the location of your `amp` installation. It is probably a `.amp` folder within your home directory. Make sure to *use the full path* to this directory in the settings below. We will use `<amp-installation>` henceforth to refer to the full path of this directory. | ||
|
||
1. Identify your webserver. (If using Apache, use `apachectl -v` to see which version you have.) | ||
|
||
* For Apache 2.2: | ||
|
||
Create a new file `/etc/apache2/conf.d/buildkit.conf` with the following contents: | ||
|
||
``` | ||
Include <amp-installation>/apache.d/*conf | ||
``` | ||
|
||
* For Apache 2.4: | ||
|
||
Create a new file `/etc/apache2/conf.d/buildkit.conf` with the following contents: | ||
|
||
``` | ||
IncludeOptional <amp-installation>/apache.d/*conf | ||
``` | ||
|
||
* For nginx: | ||
|
||
Create a new file `/etc/nginx/conf.d/buildkit.conf` with the following contents: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did I get this path correct @xurizaemon ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "It depends" ... For Debian, the path above is correct assuming they're using the Debian NginX packages yes. But maybe not all ... eg Debian and CentOS differ on Apache ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. Do you think it's okay to merge this as-is and assume that people will figure it out? Or do you have something better to propose here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMHO, you should only document Without that, it's easier to (a) just tell people to use apache or (b) turn off amp's httpd integration and do that stuff manually. |
||
|
||
``` | ||
include <amp-installation>/nginx.d/*.conf; | ||
``` | ||
|
||
1. Restart your webserver. | ||
|
||
|
||
## Troubleshooting {:#troubleshooting} | ||
|
||
Nodejs version too old or npm update does not work | ||
|
||
: Download the latest version from nodejs.org and follow to their instructions | ||
|
||
Nodejs problems | ||
|
||
: It might be handy to run | ||
|
||
```bash | ||
npm update | ||
npm install fs-extra | ||
``` | ||
|
||
|
||
## Upgrading buildkit {:#upgrading} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
webserver
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @tschuettler. Fixed in 3485d72