-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into shell-run-as-root
- Loading branch information
Showing
12 changed files
with
89 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
# Running CLI Commands | ||
|
||
You can run any command on the web server container using the `composer local-server exec` command. You need to prepend the command with the options delimiter `--`. | ||
You can run any command on the web server container using the `composer server exec` command. You need to prepend the command with the options delimiter `--`. | ||
|
||
For example to run a composer installed binary like `phpcs` run: | ||
|
||
```sh | ||
composer local-server exec -- vendor/bin/phpcs | ||
composer server exec -- vendor/bin/phpcs | ||
``` | ||
|
||
Or to show all environment variables: | ||
|
||
```sh | ||
composer local-server exec -- printenv | ||
composer server exec -- printenv | ||
``` | ||
|
||
## WP CLI | ||
|
||
Local Server provides special support for [WP CLI](https://wp-cli.org/) commands via the `composer local-server cli --` command. Prepend all your commends with `composer local-server cli --` and drop the proceeding `wp`. For example, to list all posts: | ||
Local Server provides special support for [WP CLI](https://wp-cli.org/) commands via the `composer server cli --` command. Prepend all your commends with `composer server cli --` and drop the proceeding `wp`. For example, to list all posts: | ||
|
||
```sh | ||
composer local-server cli -- post list | ||
composer server cli -- post list | ||
``` | ||
|
||
To install a new language file and activate it: | ||
|
||
```sh | ||
composer local-server cli -- language core install fr_FR | ||
composer server cli -- language core install fr_FR | ||
``` | ||
|
||
CLI commands via Local Server also support piping, for example import a database SQL file: | ||
|
||
```sh | ||
composer local-server cli -- db import - < ~/Downloads/database.sql | ||
composer server cli -- db import - < ~/Downloads/database.sql | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# ElasticSearch | ||
|
||
ElasticSearch is an integral component of Altis, enabling enhanced search and relevancy as well as powering the analytics data query layer. | ||
|
||
## Kibana | ||
|
||
Local Server provides [Kibana](https://www.elastic.co/products/kibana) out of the box, a powerful tool for viewing indexes, creating and debugging queries and more. | ||
|
||
Kibana is available at [`/kibana/`](internal://site/kibana/). | ||
|
||
### Adding Index Patterns | ||
|
||
Before you can get started querying in Kibana you'll need to [add some index patterns at `/kibana/app/kibana#/management/kibana/index/`](internal://site/kibana/app/kibana#/management/kibana/index/). | ||
|
||
![Kibana Index Patterns UI](./assets/kibana-index-patterns.png) | ||
|
||
Enter an index pattern into the field (available indexes are shown below) using wildcards if you wish to work across multiple indexes at a time. You will then be prompted to choose a date field to use for time series filters, make your selection, for example `post_date`, and save your index pattern to start analysing your data. | ||
|
||
You can add additional index patterns from the Kibana Management page in future. | ||
|
||
**Note**: When adding an index pattern for the `analytics` index choose "I don't want to use the Time Filter" from the dropdown on the next screen. Analytics event timestamps are stored in milliseconds and Kibana's time filter does not currently work with this by default. | ||
|
||
### Developing & Debugging Queries | ||
|
||
Use the [Dev Tools tab at `/kibana/app/kibana#/dev_tools/console`](internal://site/kibana/app/kibana#/dev_tools/console) to enter and run queries. This provides useful features including autocomplete based on your data and linting. | ||
|
||
![Kibana Dev Tools panel](./assets/kibana-dev-tools.png) | ||
|
||
### Viewing & Understanding Data | ||
|
||
The easiest way to view your data is in the [Discover tab at `/kibana/app/kibana#/discover`](internal://site/kibana/app/kibana#/discover). Here you can create basic queries, select and sort by columns as well drill down into the indexed data to see it's structure and data types. | ||
|
||
![Kibana Discover panel](./assets/kibana-discover.png) | ||
|
||
|
||
## Accessing ElasticSearch Directly | ||
|
||
The ElasticSearch hostname is not directly exposed however you can find the dynamic port and IP to connect to by running `composer server status | grep elasticsearch`. | ||
|
||
You should see output similar to this: | ||
|
||
<pre><code> | ||
project_elasticsearch_1 /elastic-entrypoint.sh ela ... Up (healthy) <strong>0.0.0.0:32871</strong>->9200/tcp, 9300/tcp | ||
</code></pre> | ||
|
||
Copy the mapped IP and port (highlighted in bold above) and use it to query ElasticSearch directly: | ||
|
||
``` | ||
curl -XGET http://0.0.0.0:32871 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Email Debugging | ||
|
||
Local server comes with [Mailhog](https://github.com/mailhog/Mailhog) pre-configured. This is an app that catches all outgoing email and provides a UI to view and debug those emails. | ||
|
||
The app is available at [`https://<project>.altis.dev/mailhog/`](internal://site/mailhog/). | ||
The app is available at [`/mailhog/`](internal://site/mailhog/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Viewing Logs | ||
|
||
Often you'll want to access logs from the services that Local Server provides. For example, PHP Errors Logs, Nginx Access Logs, or MySQL Logs. To do so, run the `composer local-server logs <service>` command. `<service>` can be any of `php`, `nginx`, `db`, `elasticsearch`, `s3`, `xray`, `cavalcade` or `redis`. This command will tail the logs (live update). To exit the log view, press `Ctrl+C`. | ||
Often you'll want to access logs from the services that Local Server provides. For example, PHP Errors Logs, Nginx Access Logs, or MySQL Logs. To do so, run the `composer server logs <service>` command. `<service>` can be any of `php`, `nginx`, `db`, `elasticsearch`, `s3`, `xray`, `cavalcade` or `redis`. This command will tail the logs (live update). To exit the log view, press `Ctrl+C`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters