From 754e56b6055332a5deda8ebea945c366fc7d8a43 Mon Sep 17 00:00:00 2001 From: Karl Date: Mon, 19 Aug 2019 16:05:45 +1000 Subject: [PATCH 1/9] Add support for gitlab-ci --- .docker/push.sh | 21 ++++++++++------- .gitlab-ci.yml | 63 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 8 deletions(-) create mode 100644 .gitlab-ci.yml diff --git a/.docker/push.sh b/.docker/push.sh index 19354e86..a7b4800c 100755 --- a/.docker/push.sh +++ b/.docker/push.sh @@ -11,11 +11,13 @@ IMAGE_VERSION_TAG=${IMAGE_VERSION_TAG:-} # prevent stripping of the version. IMAGE_VERSION_TAG_PREFIX=${IMAGE_VERSION_TAG_PREFIX:-8.x-} # Docker image edge tag. -IMAGE_TAG_EDGE=${IMAGE_TAG_EDGE:-beta} +IMAGE_TAG_EDGE=${IMAGE_TAG_EDGE:-} # Flag to force image build. FORCE_IMAGE_BUILD=${FORCE_IMAGE_BUILD:-} # Path prefix to Dockerfiles extension that is used as a name of the service. FILE_EXTENSION_PREFIX=${FILE_EXTENSION_PREFIX:-.docker/Dockerfile.} +# CLI Image name +CLI_IMAGE=${DOCKERHUB_NAMESPACE:-govcms8lagoon}/govcms8 for file in $(echo $FILE_EXTENSION_PREFIX"*"); do service=${file/$FILE_EXTENSION_PREFIX/} @@ -28,18 +30,21 @@ for file in $(echo $FILE_EXTENSION_PREFIX"*"); do # Only rebuild images if they do not exist or rebuild is forced. if [ "$existing_image" == "" ] || [ "$FORCE_IMAGE_BUILD" != "" ]; then echo "==> Building \"$service\" image from file $file for service \"$DOCKERHUB_NAMESPACE/$service\"" - docker build -f $file -t $DOCKERHUB_NAMESPACE/$service . + docker build -f $file -t $DOCKERHUB_NAMESPACE/$service --build-arg CLI_IMAGE=${CLI_IMAGE} . fi # Tag images with 'edge' tag and push. - echo "==> Tagged and pushed \"$service\" image to $DOCKERHUB_NAMESPACE/$service:$IMAGE_TAG_EDGE" - docker tag $DOCKERHUB_NAMESPACE/$service $DOCKERHUB_NAMESPACE/$service:$IMAGE_TAG_EDGE - docker push $DOCKERHUB_NAMESPACE/$service:$IMAGE_TAG_EDGE + if [ "$IMAGE_TAG_EDGE" != "" ]; then + echo "==> Tagged and pushed \"$service\" image to $DOCKERHUB_NAMESPACE/$service:$IMAGE_TAG_EDGE" + docker tag $DOCKERHUB_NAMESPACE/$service $DOCKERHUB_NAMESPACE/$service:$IMAGE_TAG_EDGE + docker push $DOCKERHUB_NAMESPACE/$service:$IMAGE_TAG_EDGE + fi # Tag images with version tag, if provided, and push. if [ "$version_tag" != "" ]; then - echo "==> Tagging and pushing \"$service\" image to $DOCKERHUB_NAMESPACE/$service:$version_tag" - docker tag $DOCKERHUB_NAMESPACE/$service $DOCKERHUB_NAMESPACE/$service:$version_tag - docker push $DOCKERHUB_NAMESPACE/$service:$version_tag + CI_IMAGE_NAME=${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/$service; + echo "==> Tagging and pushing \"$service\" image to $CI_IMAGE_NAME:$version_tag" + docker tag $DOCKERHUB_NAMESPACE/$service $CI_IMAGE_NAME:$version_tag + docker push $CI_IMAGE_NAME:$version_tag fi done diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..31ada9b7 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,63 @@ +--- + +image: govcmsdev/gitlab-ci + +services: + - "docker:dind" + +stages: + - build + +build: + + stage: build + + script: + + # Export dynamic variables + - export DOCKERHUB_NAMESPACE="${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}" + - export IMAGE_VERSION_TAG_PREFIX=""; + + # Handle master branch for IMAGE_VERSION_TAG gracefully. + - if [[ "${CI_COMMIT_REF_NAME}" == "master" ]]; then + export IMAGE_VERSION_TAG="latest"; + else + export IMAGE_VERSION_TAG="${CI_COMMIT_REF_NAME//\//-}"; + fi + + # Add Edge tag for when tagging is used: + - IMAGE_TAG_EDGE=${CI_COMMIT_TAG:-} + + # Docker-Compose file linting (check for syntax errors) + - docker-compose config -q + # Add Environment variables stored in code. + - cp .env.default .env + # Ensure docker network amazeeio-network is present. + - docker network prune -f && docker network inspect amazeeio-network >/dev/null || docker network create amazeeio-network + # Build the project + - docker-compose build + # Start the project + - docker-compose up -d + - docker image ls + + # Log in to the private registry. + - docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY} + + # Push the images to the registry. + - .docker/push.sh + + # Run container-diff checks + - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/govcms8:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/govcms8:${IMAGE_VERSION_TAG} + - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/mariadb-drupal:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/mariadb-drupal:${IMAGE_VERSION_TAG} + - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/nginx-drupal:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/nginx-drupal:${IMAGE_VERSION_TAG} + - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/php:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/php:${IMAGE_VERSION_TAG} + - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/redis:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/redis:${IMAGE_VERSION_TAG} + - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/solr:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/solr:${IMAGE_VERSION_TAG} + - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/test:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/test:${IMAGE_VERSION_TAG} + - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/varnish-drupal:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/varnish-drupal:${IMAGE_VERSION_TAG} + + # Clean-up. + - docker-compose down + +before_script: + - curl -LO https://storage.googleapis.com/container-diff/latest/container-diff-linux-amd64 && chmod +x container-diff-linux-amd64 && mkdir -p $HOME/bin && export PATH=$PATH:$HOME/bin && mv container-diff-linux-amd64 $HOME/bin/container-diff From f119900cf46fb9afa7225893dba2b62a20815954 Mon Sep 17 00:00:00 2001 From: Karl Date: Mon, 2 Sep 2019 16:30:42 +1000 Subject: [PATCH 2/9] Output container-diffs to file --- .gitlab-ci.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 31ada9b7..6cedb1a4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -47,14 +47,15 @@ build: - .docker/push.sh # Run container-diff checks - - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/govcms8:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/govcms8:${IMAGE_VERSION_TAG} - - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/mariadb-drupal:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/mariadb-drupal:${IMAGE_VERSION_TAG} - - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/nginx-drupal:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/nginx-drupal:${IMAGE_VERSION_TAG} - - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/php:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/php:${IMAGE_VERSION_TAG} - - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/redis:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/redis:${IMAGE_VERSION_TAG} - - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/solr:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/solr:${IMAGE_VERSION_TAG} - - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/test:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/test:${IMAGE_VERSION_TAG} - - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/varnish-drupal:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/varnish-drupal:${IMAGE_VERSION_TAG} + - mkdir /var/log/container-diff/ + - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/govcms8:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/govcms8:${IMAGE_VERSION_TAG} --output /var/log/container-diff/govcms8.txt + - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/mariadb-drupal:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/mariadb-drupal:${IMAGE_VERSION_TAG} --output /var/log/container-diff/mariadb-drupal.txt + - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/nginx-drupal:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/nginx-drupal:${IMAGE_VERSION_TAG} --output /var/log/container-diff/nginx-drupal.txt + - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/php:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/php:${IMAGE_VERSION_TAG} --output /var/log/container-diff/php.txt + - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/redis:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/redis:${IMAGE_VERSION_TAG} --output /var/log/container-diff/redis.txt + - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/solr:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/solr:${IMAGE_VERSION_TAG} --output /var/log/container-diff/solr.txt + - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/test:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/test:${IMAGE_VERSION_TAG} --output /var/log/container-diff/test.txt + - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/varnish-drupal:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/varnish-drupal:${IMAGE_VERSION_TAG} --output /var/log/container-diff/varnish-drupal.txt # Clean-up. - docker-compose down From 72e30a3fd8b67e9617998e23c8c378d85b248c8e Mon Sep 17 00:00:00 2001 From: Karl Date: Mon, 2 Sep 2019 16:31:02 +1000 Subject: [PATCH 3/9] Install container-diff over multiple lines --- .gitlab-ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6cedb1a4..37353fcc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -61,4 +61,7 @@ build: - docker-compose down before_script: - - curl -LO https://storage.googleapis.com/container-diff/latest/container-diff-linux-amd64 && chmod +x container-diff-linux-amd64 && mkdir -p $HOME/bin && export PATH=$PATH:$HOME/bin && mv container-diff-linux-amd64 $HOME/bin/container-diff + - curl -LO https://storage.googleapis.com/container-diff/latest/container-diff-linux-amd64 && chmod +x container-diff-linux-amd64 + - mkdir -p $HOME/bin + - export PATH=$PATH:$HOME/bin + - mv container-diff-linux-amd64 $HOME/bin/container-diff \ No newline at end of file From 767a24c23fad3edbab52dd94e36fdad7a1311712 Mon Sep 17 00:00:00 2001 From: Karl Date: Mon, 2 Sep 2019 16:33:47 +1000 Subject: [PATCH 4/9] Add artifact path for container-diff output --- .gitlab-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 37353fcc..28eb786e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,6 +12,10 @@ build: stage: build + artifacts: + paths: + - /var/log/container-diff/ + script: # Export dynamic variables From c207571904fa93ff33587cf2efe2d4862cfd0363 Mon Sep 17 00:00:00 2001 From: Karl Date: Mon, 9 Sep 2019 11:13:46 +1000 Subject: [PATCH 5/9] Logging attempts in local folder Signed-off-by: Karl --- .gitlab-ci.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 28eb786e..a1c992d1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,7 +14,7 @@ build: artifacts: paths: - - /var/log/container-diff/ + - $CI_PROJECT_DIR/logs script: @@ -51,15 +51,15 @@ build: - .docker/push.sh # Run container-diff checks - - mkdir /var/log/container-diff/ - - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/govcms8:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/govcms8:${IMAGE_VERSION_TAG} --output /var/log/container-diff/govcms8.txt - - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/mariadb-drupal:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/mariadb-drupal:${IMAGE_VERSION_TAG} --output /var/log/container-diff/mariadb-drupal.txt - - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/nginx-drupal:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/nginx-drupal:${IMAGE_VERSION_TAG} --output /var/log/container-diff/nginx-drupal.txt - - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/php:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/php:${IMAGE_VERSION_TAG} --output /var/log/container-diff/php.txt - - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/redis:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/redis:${IMAGE_VERSION_TAG} --output /var/log/container-diff/redis.txt - - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/solr:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/solr:${IMAGE_VERSION_TAG} --output /var/log/container-diff/solr.txt - - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/test:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/test:${IMAGE_VERSION_TAG} --output /var/log/container-diff/test.txt - - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/varnish-drupal:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/varnish-drupal:${IMAGE_VERSION_TAG} --output /var/log/container-diff/varnish-drupal.txt + - mkdir logs + - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/govcms8:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/govcms8:${IMAGE_VERSION_TAG} --output logs/govcms8.txt + - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/mariadb-drupal:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/mariadb-drupal:${IMAGE_VERSION_TAG} --output logs/mariadb-drupal.txt + - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/nginx-drupal:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/nginx-drupal:${IMAGE_VERSION_TAG} --output logs/nginx-drupal.txt + - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/php:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/php:${IMAGE_VERSION_TAG} --output logs/php.txt + - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/redis:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/redis:${IMAGE_VERSION_TAG} --output logs/redis.txt + - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/solr:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/solr:${IMAGE_VERSION_TAG} --output logs/solr.txt + - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/test:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/test:${IMAGE_VERSION_TAG} --output logs/test.txt + - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/varnish-drupal:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/varnish-drupal:${IMAGE_VERSION_TAG} --output logs/varnish-drupal.txt # Clean-up. - docker-compose down From 41436df019d98bc257db29d3486f010fa8239645 Mon Sep 17 00:00:00 2001 From: Karl Date: Mon, 9 Sep 2019 12:07:23 +1000 Subject: [PATCH 6/9] Add chrome container-diff. Signed-off-by: Karl --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a1c992d1..2d985b2a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -52,6 +52,7 @@ build: # Run container-diff checks - mkdir logs + - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/chrome:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/chrome:${IMAGE_VERSION_TAG} --output logs/chrome.txt || true - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/govcms8:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/govcms8:${IMAGE_VERSION_TAG} --output logs/govcms8.txt - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/mariadb-drupal:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/mariadb-drupal:${IMAGE_VERSION_TAG} --output logs/mariadb-drupal.txt - $HOME/bin/container-diff diff --type=file registry.hub.docker.com/${CI_PROJECT_NAME}/nginx-drupal:latest ${CI_REGISTRY}/${DOCKERHUB_NAMESPACE}/nginx-drupal:${IMAGE_VERSION_TAG} --output logs/nginx-drupal.txt From b8157ed8db79d73a5820576d958beeee16200972 Mon Sep 17 00:00:00 2001 From: Karl Date: Mon, 9 Sep 2019 16:04:48 +1000 Subject: [PATCH 7/9] Upgrade base image to quay.io/govcms/govcms-ci --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2d985b2a..499f9d39 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,6 @@ --- -image: govcmsdev/gitlab-ci +image: quay.io/govcms/govcms-ci services: - "docker:dind" From d605716165307ebef1b5b9284634f693f28188c4 Mon Sep 17 00:00:00 2001 From: Karl Date: Tue, 28 Jan 2020 15:34:55 +1100 Subject: [PATCH 8/9] Provide basic solr defaults --- ...ock.block.exposedformsolr_searchpage_1.yml | 22 ++ .../install/search_api.index.solr_index.yml | 56 +++ .../install/search_api.server.lagoon_solr.yml | 2 + .../config/install/views.view.solr_search.yml | 332 ++++++++++++++++++ 4 files changed, 412 insertions(+) create mode 100644 modules/lagoon/lagoon_search/config/install/block.block.exposedformsolr_searchpage_1.yml create mode 100644 modules/lagoon/lagoon_search/config/install/search_api.index.solr_index.yml create mode 100644 modules/lagoon/lagoon_search/config/install/views.view.solr_search.yml diff --git a/modules/lagoon/lagoon_search/config/install/block.block.exposedformsolr_searchpage_1.yml b/modules/lagoon/lagoon_search/config/install/block.block.exposedformsolr_searchpage_1.yml new file mode 100644 index 00000000..b73aab53 --- /dev/null +++ b/modules/lagoon/lagoon_search/config/install/block.block.exposedformsolr_searchpage_1.yml @@ -0,0 +1,22 @@ +langcode: en +status: true +dependencies: + config: + - views.view.solr_search + module: + - views + theme: + - govcms8_uikit_starter +id: exposedformsolr_searchpage_1 +theme: govcms8_uikit_starter +region: search +weight: 0 +provider: null +plugin: 'views_exposed_filter_block:solr_search-page_1' +settings: + id: 'views_exposed_filter_block:solr_search-page_1' + label: '' + provider: views + label_display: visible + views_label: '' +visibility: { } diff --git a/modules/lagoon/lagoon_search/config/install/search_api.index.solr_index.yml b/modules/lagoon/lagoon_search/config/install/search_api.index.solr_index.yml new file mode 100644 index 00000000..d8531996 --- /dev/null +++ b/modules/lagoon/lagoon_search/config/install/search_api.index.solr_index.yml @@ -0,0 +1,56 @@ +langcode: en +status: true +dependencies: + module: + - search_api_solr + - node + - search_api + config: + - field.storage.node.body + - search_api.server.lagoon_solr +third_party_settings: + search_api_solr: + finalize: false + commit_before_finalize: false + commit_after_finalize: false +id: solr_index +name: 'solr index' +description: '' +read_only: false +field_settings: + title: + label: Title + datasource_id: 'entity:node' + property_path: title + type: text + dependencies: + module: + - node + body: + label: Body + datasource_id: 'entity:node' + property_path: body + type: text + dependencies: + config: + - field.storage.node.body +datasource_settings: + 'entity:node': + bundles: + default: true + selected: { } + languages: + default: true + selected: { } +processor_settings: + add_url: { } + aggregated_field: { } + rendered_item: { } + solr_date_range: { } +tracker_settings: + default: + indexing_order: fifo +options: + index_directly: true + cron_limit: 50 +server: lagoon_solr diff --git a/modules/lagoon/lagoon_search/config/install/search_api.server.lagoon_solr.yml b/modules/lagoon/lagoon_search/config/install/search_api.server.lagoon_solr.yml index 8603bcee..9da3b367 100644 --- a/modules/lagoon/lagoon_search/config/install/search_api.server.lagoon_solr.yml +++ b/modules/lagoon/lagoon_search/config/install/search_api.server.lagoon_solr.yml @@ -1,6 +1,8 @@ langcode: en status: true dependencies: + config: + - search_api_solr.solr_field_type.text_und_6_0_0 module: - search_api_solr id: lagoon_solr diff --git a/modules/lagoon/lagoon_search/config/install/views.view.solr_search.yml b/modules/lagoon/lagoon_search/config/install/views.view.solr_search.yml new file mode 100644 index 00000000..4bbabdfe --- /dev/null +++ b/modules/lagoon/lagoon_search/config/install/views.view.solr_search.yml @@ -0,0 +1,332 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.body + - search_api.index.solr_index + module: + - search_api + - text +id: solr_search +label: 'Solr Search' +module: views +description: '' +tag: '' +base_table: search_api_index_solr_index +base_field: search_api_id +display: + default: + display_plugin: default + id: default + display_title: Master + position: 0 + display_options: + access: + type: none + options: { } + cache: + type: tag + options: { } + query: + type: views_query + options: + bypass_access: false + skip_access: false + exposed_form: + type: basic + options: + submit_button: Apply + reset_button: false + reset_button_label: Reset + exposed_sorts_label: 'Sort by' + expose_sort_order: true + sort_asc_label: Asc + sort_desc_label: Desc + pager: + type: mini + options: + items_per_page: 20 + offset: 0 + id: 0 + total_pages: null + expose: + items_per_page: false + items_per_page_label: 'Items per page' + items_per_page_options: '5, 10, 25, 50' + items_per_page_options_all: false + items_per_page_options_all_label: '- All -' + offset: false + offset_label: Offset + tags: + previous: ‹‹ + next: ›› + style: + type: default + row: + type: fields + options: + default_field_elements: true + inline: + title: title + body: body + separator: '' + hide_empty: false + fields: + title: + id: title + table: search_api_index_solr_index + field: title + relationship: none + group_type: group + admin_label: '' + label: '' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: h2 + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: value + type: string + settings: + link_to_entity: true + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + field_rendering: true + fallback_handler: search_api + fallback_options: + link_to_item: false + use_highlighting: false + multi_type: separator + multi_separator: ', ' + plugin_id: search_api_field + body: + id: body + table: search_api_index_solr_index + field: body + relationship: none + group_type: group + admin_label: '' + label: '' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: value + type: text_summary_or_trimmed + settings: + trim_length: 600 + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + field_rendering: true + fallback_handler: search_api + fallback_options: + link_to_item: false + use_highlighting: false + multi_type: separator + multi_separator: ', ' + plugin_id: search_api_field + filters: + search_api_fulltext: + id: search_api_fulltext + table: search_api_index_solr_index + field: search_api_fulltext + relationship: none + group_type: group + admin_label: '' + operator: or + value: '' + group: 1 + exposed: true + expose: + operator_id: search_api_fulltext_op + label: Search + description: '' + use_operator: false + operator: search_api_fulltext_op + operator_limit_selection: false + operator_list: { } + identifier: fulltext_search + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + anonymous: '0' + content_author: '0' + content_approver: '0' + site_administrator: '0' + placeholder: '' + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + parse_mode: terms + min_length: null + fields: { } + plugin_id: search_api_fulltext + sorts: { } + title: '' + header: { } + footer: { } + empty: { } + relationships: { } + arguments: + search_api_fulltext: + id: search_api_fulltext + table: search_api_index_solr_index + field: search_api_fulltext + relationship: none + group_type: group + admin_label: '' + default_action: default + exception: + value: all + title_enable: false + title: All + title_enable: false + title: '' + default_argument_type: query_parameter + default_argument_options: + query_param: fulltext_search + fallback: '' + multiple: and + default_argument_skip_url: false + summary_options: { } + summary: + sort_order: asc + number_of_records: 0 + format: default_summary + specify_validation: false + validate: + type: none + fail: 'not found' + validate_options: { } + break_phrase: false + not: false + parse_mode: terms + fields: { } + conjunction: OR + plugin_id: search_api_fulltext + display_extenders: { } + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url + - url.query_args + tags: + - 'config:field.storage.node.body' + page_1: + display_plugin: page + id: page_1 + display_title: Page + position: 1 + display_options: + display_extenders: { } + path: search/% + exposed_block: true + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - url + - url.query_args + tags: + - 'config:field.storage.node.body' From b1d96780302e5bb5bff593c4dd4a98898f0f0ac1 Mon Sep 17 00:00:00 2001 From: Karl Date: Wed, 29 Jan 2020 16:23:41 +1100 Subject: [PATCH 9/9] Update default solr configuration --- ...ock.block.exposedformsolr_searchpage_1.yml | 10 ++- .../install/search_api.index.solr_index.yml | 6 +- .../install/search_api.server.lagoon_solr.yml | 2 +- .../config/install/views.view.solr_search.yml | 81 ++++++++----------- 4 files changed, 44 insertions(+), 55 deletions(-) diff --git a/modules/lagoon/lagoon_search/config/install/block.block.exposedformsolr_searchpage_1.yml b/modules/lagoon/lagoon_search/config/install/block.block.exposedformsolr_searchpage_1.yml index b73aab53..b84a8887 100644 --- a/modules/lagoon/lagoon_search/config/install/block.block.exposedformsolr_searchpage_1.yml +++ b/modules/lagoon/lagoon_search/config/install/block.block.exposedformsolr_searchpage_1.yml @@ -4,6 +4,7 @@ dependencies: config: - views.view.solr_search module: + - system - views theme: - govcms8_uikit_starter @@ -17,6 +18,11 @@ settings: id: 'views_exposed_filter_block:solr_search-page_1' label: '' provider: views - label_display: visible + label_display: '0' views_label: '' -visibility: { } +visibility: + request_path: + id: request_path + pages: '/search/*' + negate: true + context_mapping: { } \ No newline at end of file diff --git a/modules/lagoon/lagoon_search/config/install/search_api.index.solr_index.yml b/modules/lagoon/lagoon_search/config/install/search_api.index.solr_index.yml index d8531996..e2176688 100644 --- a/modules/lagoon/lagoon_search/config/install/search_api.index.solr_index.yml +++ b/modules/lagoon/lagoon_search/config/install/search_api.index.solr_index.yml @@ -2,9 +2,9 @@ langcode: en status: true dependencies: module: - - search_api_solr - node - search_api + - search_api_solr config: - field.storage.node.body - search_api.server.lagoon_solr @@ -14,8 +14,8 @@ third_party_settings: commit_before_finalize: false commit_after_finalize: false id: solr_index -name: 'solr index' -description: '' +name: 'Solr Index' +description: 'Default search index using the solr search server' read_only: false field_settings: title: diff --git a/modules/lagoon/lagoon_search/config/install/search_api.server.lagoon_solr.yml b/modules/lagoon/lagoon_search/config/install/search_api.server.lagoon_solr.yml index 9da3b367..5469e75f 100644 --- a/modules/lagoon/lagoon_search/config/install/search_api.server.lagoon_solr.yml +++ b/modules/lagoon/lagoon_search/config/install/search_api.server.lagoon_solr.yml @@ -7,7 +7,7 @@ dependencies: - search_api_solr id: lagoon_solr name: 'Lagoon Solr' -description: '' +description: 'Default solr search server' backend: search_api_solr backend_config: connector: standard diff --git a/modules/lagoon/lagoon_search/config/install/views.view.solr_search.yml b/modules/lagoon/lagoon_search/config/install/views.view.solr_search.yml index 4bbabdfe..ff6fe4b4 100644 --- a/modules/lagoon/lagoon_search/config/install/views.view.solr_search.yml +++ b/modules/lagoon/lagoon_search/config/install/views.view.solr_search.yml @@ -10,7 +10,7 @@ dependencies: id: solr_search label: 'Solr Search' module: views -description: '' +description: 'Default content search using the solr search' tag: '' base_table: search_api_index_solr_index base_field: search_api_id @@ -61,16 +61,24 @@ display: previous: ‹‹ next: ›› style: - type: default + type: html_list + options: + grouping: { } + row_class: '' + default_row_class: true + type: ul + wrapper_class: item-list + class: '' row: - type: fields + type: search_api options: - default_field_elements: true - inline: - title: title - body: body - separator: '' - hide_empty: false + view_modes: + 'entity:node': + govcms_blog_article: search + govcms_event: search + govcms_foi: search + govcms_news_and_media: search + govcms_standard_page: search fields: title: id: title @@ -220,7 +228,7 @@ display: relationship: none group_type: group admin_label: '' - operator: or + operator: and value: '' group: 1 exposed: true @@ -242,7 +250,7 @@ display: content_author: '0' content_approver: '0' site_administrator: '0' - placeholder: '' + placeholder: 'What are you looking for?' is_grouped: false group_info: label: '' @@ -261,48 +269,23 @@ display: plugin_id: search_api_fulltext sorts: { } title: '' - header: { } - footer: { } - empty: { } - relationships: { } - arguments: - search_api_fulltext: - id: search_api_fulltext - table: search_api_index_solr_index - field: search_api_fulltext + header: + result: + id: result + table: views + field: result relationship: none group_type: group admin_label: '' - default_action: default - exception: - value: all - title_enable: false - title: All - title_enable: false - title: '' - default_argument_type: query_parameter - default_argument_options: - query_param: fulltext_search - fallback: '' - multiple: and - default_argument_skip_url: false - summary_options: { } - summary: - sort_order: asc - number_of_records: 0 - format: default_summary - specify_validation: false - validate: - type: none - fail: 'not found' - validate_options: { } - break_phrase: false - not: false - parse_mode: terms - fields: { } - conjunction: OR - plugin_id: search_api_fulltext + empty: false + content: 'Displaying @start - @end of @total' + plugin_id: result + footer: { } + empty: { } + relationships: { } + arguments: { } display_extenders: { } + css_class: 'views--layout views--layout--full-width' cache_metadata: max-age: -1 contexts: