Skip to content

Commit

Permalink
Merge conflict with main
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Clifford committed Jun 4, 2021
2 parents 118f175 + d1037fd commit 8d191e0
Show file tree
Hide file tree
Showing 144 changed files with 4,960 additions and 1,796 deletions.
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pipeline {
agent any
agent { label 'lagoon' }
environment {
// configure build params
CI_BUILD_TAG = env.BUILD_TAG.replaceAll('%2f','').replaceAll('[^A-Za-z0-9]+', '').toLowerCase()
Expand Down
32 changes: 20 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ K3D_NAME := k3s-$(shell echo $(CI_BUILD_TAG) | sed -E 's/.*(.{31})$$/\1/')

# Name of the Branch we are currently in
BRANCH_NAME := $(shell git rev-parse --abbrev-ref HEAD)
SAFE_BRANCH_NAME := $(shell echo $(BRANCH_NAME) | sed -E 's:/:_:g')
SAFE_BRANCH_NAME := $(shell echo $(BRANCH_NAME) | sed -E 's/[^[:alnum:]_.-]//g' | cut -c 1-128)

# Skip image scanning to make building images substantially faster
SKIP_SCAN := false

# Init the file that is used to hold the image tag cross-reference table
$(shell >build.txt)
Expand All @@ -102,9 +105,15 @@ $(shell >scan.txt)

# Builds a docker image. Expects as arguments: name of the image, location of Dockerfile, path of
# Docker Build Context
docker_build = docker build $(DOCKER_BUILD_PARAMS) --build-arg LAGOON_VERSION=$(LAGOON_VERSION) --build-arg IMAGE_REPO=$(CI_BUILD_TAG) --build-arg UPSTREAM_REPO=$(UPSTREAM_REPO) --build-arg UPSTREAM_TAG=$(UPSTREAM_TAG) -t $(CI_BUILD_TAG)/$(1) -f $(2) $(3)
docker_build = DOCKER_SCAN_SUGGEST=false docker build $(DOCKER_BUILD_PARAMS) --build-arg LAGOON_VERSION=$(LAGOON_VERSION) --build-arg IMAGE_REPO=$(CI_BUILD_TAG) --build-arg UPSTREAM_REPO=$(UPSTREAM_REPO) --build-arg UPSTREAM_TAG=$(UPSTREAM_TAG) -t $(CI_BUILD_TAG)/$(1) -f $(2) $(3)

scan_cmd = docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v $(HOME)/Library/Caches:/root/.cache/ aquasec/trivy --timeout 5m0s $(CI_BUILD_TAG)/$(1) >> scan.txt

scan_image = docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v $(HOME)/Library/Caches:/root/.cache/ aquasec/trivy --timeout 5m0s $(CI_BUILD_TAG)/$(1) >> scan.txt
ifeq ($(SKIP_SCAN),false)
scan_image = $(scan_cmd)
else
scan_image =
endif

# Tags an image with the `testlagoon` repository and pushes it
docker_publish_testlagoon = docker tag $(CI_BUILD_TAG)/$(1) testlagoon/$(2) && docker push testlagoon/$(2) | cat
Expand All @@ -122,8 +131,6 @@ images := oc \
kubectl \
oc-build-deploy-dind \
kubectl-build-deploy-dind \
rabbitmq \
rabbitmq-cluster \
athenapdf-service \
curator \
docker-host
Expand Down Expand Up @@ -152,8 +159,6 @@ $(build-images):
# if the parent has been built
# 2. Dockerfiles of the Images itself, will cause make to rebuild the images if something has
# changed on the Dockerfiles
build/rabbitmq: images/rabbitmq/Dockerfile
build/rabbitmq-cluster: build/rabbitmq images/rabbitmq-cluster/Dockerfile
build/docker-host: images/docker-host/Dockerfile
build/oc: images/oc/Dockerfile
build/kubectl: images/kubectl/Dockerfile
Expand Down Expand Up @@ -245,8 +250,8 @@ build/auth-server build/logs2email build/logs2slack build/logs2rocketchat build/
build/api-db: services/api-db/Dockerfile
build/api-redis: services/api-redis/Dockerfile
build/auto-idler: build/oc
build/broker-single: build/rabbitmq
build/broker: build/rabbitmq-cluster build/broker-single
build/broker-single: services/broker/Dockerfile
build/broker: build/broker-single
build/drush-alias: services/drush-alias/Dockerfile
build/keycloak-db: services/keycloak-db/Dockerfile
build/keycloak: services/keycloak/Dockerfile
Expand Down Expand Up @@ -444,7 +449,7 @@ local-registry-up: build/local-registry
# broker-up is used to ensure the broker is running before the lagoon-builddeploy operator is installed
# when running kubernetes tests
.PHONY: broker-up
broker-up: build/broker
broker-up: build/broker-single
IMAGE_REPO=$(CI_BUILD_TAG) docker-compose -p $(CI_BUILD_TAG) --compatibility up -d broker

openshift-run-api-tests = $(foreach image,$(api-tests),openshift-tests/$(image))
Expand Down Expand Up @@ -935,11 +940,11 @@ rebuild-push-oc-build-deploy-dind:


.PHONY: ui-development
ui-development: build/api build/api-db build/local-api-data-watcher-pusher build/ui build/keycloak build/keycloak-db build/broker build/broker-single build/api-redis
ui-development: build/api build/api-db build/local-api-data-watcher-pusher build/ui build/keycloak build/keycloak-db build/broker-single build/api-redis
IMAGE_REPO=$(CI_BUILD_TAG) docker-compose -p $(CI_BUILD_TAG) --compatibility up -d api api-db local-api-data-watcher-pusher ui keycloak keycloak-db broker api-redis

.PHONY: api-development
api-development: build/api build/api-db build/local-api-data-watcher-pusher build/keycloak build/keycloak-db build/broker build/broker-single build/api-redis
api-development: build/api build/api-db build/local-api-data-watcher-pusher build/keycloak build/keycloak-db build/broker-single build/api-redis
IMAGE_REPO=$(CI_BUILD_TAG) docker-compose -p $(CI_BUILD_TAG) --compatibility up -d api api-db local-api-data-watcher-pusher keycloak keycloak-db broker api-redis

## CI targets
Expand Down Expand Up @@ -1152,3 +1157,6 @@ kind/retest:
.PHONY: kind/clean
kind/clean: local-dev/kind
KIND_CLUSTER_NAME="$(CI_BUILD_TAG)" ./local-dev/kind delete cluster
ifeq ($(ARCH), darwin)
docker rm --force $(CI_BUILD_TAG)-kind-proxy-32080
endif
Binary file added docs/.gitbook/assets/1-docker-setup.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/.gitbook/assets/2-cli-interpreter.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/.gitbook/assets/4-configure-runner.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/.gitbook/assets/5-going-green-1-.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
6 changes: 6 additions & 0 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@
* [Base Images](using-lagoon-advanced/base-images.md)
* [Workflows](using-lagoon-advanced/workflows.md)
* [Active/Standby](using-lagoon-advanced/active_standby.md)
* [Triggering Deployments](using-lagoon-advanced/triggering-deployments.md)
* [Backups](using-lagoon-advanced/backups.md)
* [Remote Shell](using-lagoon-advanced/remote-shell.md)
* [GraphQL](using-lagoon-advanced/graphql.md)
* [Private Repositories](using-lagoon-advanced/private-repositories.md)
* [SimpleSAML](using-lagoon-advanced/simplesaml.md)
* [Project Default Users and SSH keys](using-lagoon-advanced/project-default-users-keys.md)
* [Node.js Graceful Shutdown](using-lagoon-advanced/nodejs.md)
* [Setting up Xdebug with Lagoon](using-lagoon-advanced/setting-up-xdebug-with-lagoon.md)
Expand All @@ -34,6 +37,7 @@
## Drupal

* [Services](drupal/services/README.md)
* [Untitled](drupal/services/untitled.md)
* [MariaDB](drupal/services/mariadb.md)
* [Redis](drupal/services/redis.md)
* [Solr](drupal/services/solr.md)
Expand All @@ -42,6 +46,8 @@
* [First Deployment of Drupal](drupal/first-deployment-of-drupal.md)
* [Drush 9](drupal/drush-9.md)
* [Subfolders](drupal/subfolders.md)
* [Integrate Drupal & Fastly](drupal/integrate-drupal-and-fastly.md)
* [PHPUnit and PhpStorm](drupal/phpunit-and-phpstorm.md)

## Logging

Expand Down
44 changes: 44 additions & 0 deletions docs/docker-images/nginx/nginx-drupal.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,47 @@ RUN fix-permissions /etc/nginx/conf.d/drupal/location_drupal_prepend.conf
{% endtab %}
{% endtabs %}

## Drupal Core Statistics Module Configuration

If you're using the core Statistics module, you may run into an issue that needs a quick configuration change.

With the default NGINX configuration, the request to the tracking endpoint `/core/modules/statistics/statistics.php` is denied \(404\).

This is related to the default Nginx configuration:

{% tabs %}
{% tab title="drupal.conf" %}
```text
location ~* ^.+\.php$ {
try_files /dev/null @drupal;
}
```
{% endtab %}
{% endtabs %}

To fix the issue, we instead define a specific location rule and inject this as a location prepend configuration:

{% tabs %}
{% tab title="drupal.conf" %}
```text
## Allow access to to the statistics endpoint.
location ~* ^(/core/modules/statistics/statistics.php) {
try_files /dev/null @php;
}
```
{% endtab %}
{% endtabs %}

And copy this during the NGINX container build:

{% tabs %}
{% tab title="dockerfile.nginx" %}
```text
# Add specific Drupal statistics module NGINX configuration.
COPY .lagoon/nginx/location_prepend_allow_statistics.conf /etc/nginx/conf.d/drupal/location_prepend_allow_statistics.conf
```
{% endtab %}
{% endtabs %}



Binary file removed docs/docs/.gitbook/assets/1.png
Binary file not shown.
Binary file removed docs/docs/.gitbook/assets/3.png
Binary file not shown.
Binary file removed docs/docs/.gitbook/assets/4.gif
Binary file not shown.
Binary file removed docs/docs/.gitbook/assets/5.gif
Binary file not shown.
Binary file removed docs/docs/.gitbook/assets/6.gif
Binary file not shown.
Binary file removed docs/docs/.gitbook/assets/7.gif
Binary file not shown.
Binary file removed docs/docs/.gitbook/assets/8.png
Binary file not shown.
Binary file removed docs/docs/.gitbook/assets/9.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed docs/docs/.gitbook/assets/gh_wehbook_0.png
Binary file not shown.
Binary file removed docs/docs/.gitbook/assets/gl_webhook_1.png
Binary file not shown.
Binary file not shown.
Binary file removed docs/docs/.gitbook/assets/kibana_example1.png
Binary file not shown.
Binary file removed docs/docs/.gitbook/assets/kibana_example2.png
Diff not rendered.
Binary file removed docs/docs/.gitbook/assets/kibana_example3.png
Diff not rendered.
Binary file removed docs/docs/.gitbook/assets/kibana_example4.png
Diff not rendered.
Binary file removed docs/docs/.gitbook/assets/kibana_example5.png
Diff not rendered.
Binary file removed docs/docs/.gitbook/assets/lagoon-logo.png
Diff not rendered.
Binary file removed docs/docs/.gitbook/assets/topgun.gif
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
10 changes: 0 additions & 10 deletions docs/docs/examples/clamav_scanning.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/docs/examples/drupal7-mariadb/.dockerignore

This file was deleted.

24 changes: 0 additions & 24 deletions docs/docs/examples/drupal7-mariadb/.lagoon.yml

This file was deleted.

3 changes: 0 additions & 3 deletions docs/docs/examples/drupal7-mariadb/cli.dockerfile

This file was deleted.

120 changes: 0 additions & 120 deletions docs/docs/examples/drupal7-mariadb/docker-compose.yml

This file was deleted.

37 changes: 0 additions & 37 deletions docs/docs/examples/drupal7-mariadb/drush/aliases.drushrc.php

This file was deleted.

15 changes: 0 additions & 15 deletions docs/docs/examples/drupal7-mariadb/drush/drushrc.php

This file was deleted.

0 comments on commit 8d191e0

Please sign in to comment.