Skip to content

Commit

Permalink
Merge branch 'master' into 1088-xdebug-wrong-host
Browse files Browse the repository at this point in the history
  • Loading branch information
Schnitzel authored Jul 10, 2020
2 parents d71c6ba + 93490de commit 21e0394
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 9 deletions.
54 changes: 48 additions & 6 deletions docs/using_lagoon/active_standby.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
Lagoon supports Active/Standby (also known as blue/green) deployments.

## Configuration
To change an existing project to support active/standby you'll need to configure some project settings in the Lagoon API
To change an existing project to support active/standby you'll need to configure some project settings in the Lagoon API.

`productionEnviromment` should be set to the branch name of the current environment that is active
`standbyProductionEnvironment` should be set to the branch name of the current environment that is in standby
* `productionEnviromment` should be set to the branch name of the current environment that is active.
* `standbyProductionEnvironment` should be set to the branch name of the environment that will be in standby.

```
mutation updateProject {
Expand All @@ -23,6 +23,7 @@ mutation updateProject {
}
}
```

### `.lagoon.yml` - `production_routes`
To configure a project for active/standby in the `.lagoon.yml` file, you'll need to configure the `production_routes` section with any routes you want to attach to the `active` environment, and any routes to the `standby` environment. During an Active/Standby switch, these routes will migrate between the two environments.

Expand Down Expand Up @@ -52,10 +53,14 @@ production_routes:

> Note: Any routes that are under the section `environments.<branch>.routes` will not be moved as part of active/standby, these routes will always be attached to the environment as defined. Ensure that if you do need a specific route to be migrated during an active/standby switch, that you remove them from the `environments` section and place them under the `production_routes` section specific to if it should be an `active` or `standby` route.
## Triggering a switch event
## Triggering the active/standby switch
### via the UI
To trigger the switching of environment routes, you can visit the standby environment in the Lagoon UI and click on the button labeled `Switch Active/Standby environments`. You will be prompted to confirm your action.

To trigger an event to switch the environments, you can run the following graphQL mutation, this will inform lagoon to begin the process.
Once confirmed, it will take you to the tasks page where you can view the progress of the switch.

### via the API
The following graphQL mutation can be executed which will start the process of switching the environment routes.
```
mutation ActiveStandby {
switchActiveStandby(
Expand Down Expand Up @@ -94,7 +99,9 @@ By default, projects will be created with the following aliases that will be ava
* `lagoon-production`
* `lagoon-standby`

The `lagoon-production` alias will resolve point to whichever site is defined as `productionEnvironment`, where `lagoon-standby` will always resolve to the site that is defined as `standbyProductionEnvironment`
The `lagoon-production` alias will resolve to whichever environment is currently in the API as `productionEnvironment`, where `lagoon-standby` will always resolve to the environment that is defined as `standbyProductionEnvironment`.

> As the active/standby switch updates these as required, `lagoon-production` will always be the `active` environment.
These alias are configurable by updating the project, but be aware that changing them may require you to update any scripts that rely on them.

Expand All @@ -112,4 +119,39 @@ mutation updateProject {
standbyAlias
}
}
```

## Notes

When the active/standby trigger has been executed, the `productionEnvironment` and `standbyProductionEnvironments` will switch within the Lagoon API. Both environments are still classed as `production` environment types. We use the `productionEnvironment` to determine which one is labelled as `active`. For more information on the differences between environment types, read the [documentation for `environment types`](environment_types.md#environment-types)

```
query projectByName {
projectByName(name:"drupal-example"){
productionEnvironment
standbyProductionEnvironment
}
}
```
Before switching environments
```
{
"data": {
"projectByName": {
"productionEnvironment": "production-brancha",
"standbyProductionEnvironment": "production-branchb"
}
}
}
```
After switching environments
```
{
"data": {
"projectByName": {
"productionEnvironment": "production-branchb",
"standbyProductionEnvironment": "production-brancha"
}
}
}
```
8 changes: 6 additions & 2 deletions docs/using_lagoon/drupal/services/solr.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# Solr

## Standard use
For Solr 5.5 and 6.6 we ship the default schema files provided by [search_api_solr](https://www.drupal.org/project/search_api_solr) version 8.x-1.2. Add the Solr version you would like to use in your docker-compose.yml file, following [our example](https://github.com/amazeeio/drupal-example/blob/master/docker-compose.yml#L103-L111).
We provide you with the default schema files provided by [search_api_solr](https://www.drupal.org/project/search_api_solr) version 8.x-1.2. This works for Solr 5.5 and 6.6

Specify the Solr version you would like to use in your docker-compose.yml file, following [our example](https://github.com/amazeeio/drupal-example/blob/master/docker-compose.yml#L103-L111).

## Custom schema
To implement schema customizations for Solr in your project, look to how Lagoon [creates our standard images](https://github.com/amazeeio/lagoon/blob/master/images/solr-drupal/Dockerfile).
If you use a different version of the search_api_solr module, you may need to add your own custom schema. The module allows you to download an easy config.zip file containing what you need.

Also if for any other reason you would like to implement schema customizations for Solr in your project, look to how Lagoon [creates our standard images](https://github.com/amazeeio/lagoon/blob/master/images/solr-drupal/Dockerfile).

* In the `solr` section of your docker-compose file replace `image: amazeeio/solr:6.6` with:

Expand Down
2 changes: 1 addition & 1 deletion images/mariadb/entrypoints/9999-mariadb-init.bash
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ if [ -n "$MARIADB_COPY_DATA_DIR_SOURCE" ]; then
fi
fi

ln -s ${MARIADB_DATA_DIR:-/var/lib/mysql}/.my.cnf /home/.my.cnf
ln -sf ${MARIADB_DATA_DIR:-/var/lib/mysql}/.my.cnf /home/.my.cnf

if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then
if [ ! -d "/run/mysqld" ]; then
Expand Down

0 comments on commit 21e0394

Please sign in to comment.