mirror of
https://github.com/Alfresco/SearchServices.git
synced 2025-09-10 14:11:25 +00:00
building custom images (migrated from BuildScripts)
This commit is contained in:
@@ -4,13 +4,12 @@ UNAME := $(shell uname)
|
|||||||
SHELL := /bin/bash
|
SHELL := /bin/bash
|
||||||
export COMPOSE_INTERACTIVE_NO_CLI=1
|
export COMPOSE_INTERACTIVE_NO_CLI=1
|
||||||
|
|
||||||
# CURRENT_DIR is the current location of this script: qa/search
|
# CURRENT_DIR is the folder where this Makefile is saved
|
||||||
CURRENT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
CURRENT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
||||||
# ROOT_DIR is the location of 'qa' folder
|
|
||||||
|
# the root dir where E2E maven project resides
|
||||||
ROOT_DIR:=$(shell dirname $(CURRENT_DIR))
|
ROOT_DIR:=$(shell dirname $(CURRENT_DIR))
|
||||||
|
|
||||||
# TEST_DIR is the location of POM
|
|
||||||
POM_DIR:=$(shell dirname $(ROOT_DIR))
|
|
||||||
|
|
||||||
help: ## main: output this help
|
help: ## main: output this help
|
||||||
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
|
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
|
||||||
@@ -60,4 +59,8 @@ standard: ## main: start with standard docker-compose.yml file
|
|||||||
make clean && $(dc) config && $(dc) up -d && make wait
|
make clean && $(dc) config && $(dc) up -d && make wait
|
||||||
|
|
||||||
run-mvn-tests: ## run e2e maven suite: $make run-mvn-tests suiteXmlFile=src/path-to-suite.xml
|
run-mvn-tests: ## run e2e maven suite: $make run-mvn-tests suiteXmlFile=src/path-to-suite.xml
|
||||||
cd $(POM_DIR) && $(mvn) test -DsuiteXmlFile=$(suiteXmlFile)
|
ifndef suiteXmlFile
|
||||||
|
@echo suiteXmlFile not specified! Usage: make run-mvn-tests suiteXmlFile=src/path-to-suite.xml
|
||||||
|
exit 1
|
||||||
|
endif
|
||||||
|
cd $(ROOT_DIR) && $(mvn) test -DsuiteXmlFile=$(suiteXmlFile)
|
@@ -6,19 +6,31 @@ This folder contains code for provisioning ACS with SearchServices or InsightEng
|
|||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
.
|
.
|
||||||
├── README.md # this readme file
|
├── README.md
|
||||||
└── search # code related to search product
|
├── insight # INSIGHT ENGINE
|
||||||
├── Makefile # main Makefile (with common tasks)
|
│ ├── docker-compose.yml
|
||||||
├── backup # related to backup testing of Search Service
|
│ └── upgrade
|
||||||
│ ├── Makefile # start here if you want to test backup
|
│ └── Makefile
|
||||||
│ ├── README.md # how you can use it
|
└── search # SEARCH SERVICES
|
||||||
│ └── docker-compose.backup.yml # overrides standard docker-compose.yml with backup data
|
├── Makefile # main Makefile - inherited by all Makefiles bellow
|
||||||
└── docker-compose.yml # standard docker-compose.yml for Search Service
|
├── backup
|
||||||
├── sharding # related to Sharding
|
│ ├── Makefile
|
||||||
|
│ ├── README.md # start here if you want to test the backup
|
||||||
|
│ └── docker-compose.backup.yml
|
||||||
|
├── custom
|
||||||
|
│ ├── Dockerfile
|
||||||
|
│ ├── Makefile
|
||||||
|
│ ├── README.md # start here if you want to built/test a custom image
|
||||||
|
│ ├── docker-compose.custom.yml
|
||||||
|
│ └── spellcheck
|
||||||
|
│ └── enable-spellcheck.sh
|
||||||
|
├── docker-compose.yml
|
||||||
|
├── sharding
|
||||||
│ ├── Makefile
|
│ ├── Makefile
|
||||||
│ ├── README.md
|
│ ├── README.md
|
||||||
│ └── docker-compose.sharding.yml
|
│ └── docker-compose.sharding.yml
|
||||||
└── upgrade
|
└── upgrade
|
||||||
├── Makefile # start here if you want to test the upgrade
|
├── Makefile
|
||||||
|
├── README.md
|
||||||
└── docker-compose.upgrade.yml
|
└── docker-compose.upgrade.yml
|
||||||
```
|
```
|
||||||
|
@@ -1,11 +1,13 @@
|
|||||||
include ../Makefile
|
include ../../Makefile
|
||||||
include .env
|
include .env
|
||||||
|
|
||||||
# the suffix of the backup taken in time. It can be overriden on runtime: make SUFIX=T1 backup-perform
|
# the suffix of the backup taken in time. It can be overriden on runtime: make SUFIX=T1 backup-perform
|
||||||
SUFIX ?=T0
|
SUFIX ?=T0
|
||||||
|
# CURRENT_DIR is the folder where this Makefile is saved
|
||||||
|
CURRENT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
||||||
|
|
||||||
# this is used also in compose yml files
|
# this is used also in compose yml files
|
||||||
export HOST_BACKUP_LOCATION:=$(CURRENT_DIR)/backup/host-bkp
|
export HOST_BACKUP_LOCATION:=$(CURRENT_DIR)/host-bkp
|
||||||
|
|
||||||
ifeq ($(dc-backup),)
|
ifeq ($(dc-backup),)
|
||||||
dc-backup:=$(dc) -f ../docker-compose.yml -f docker-compose.backup.yml
|
dc-backup:=$(dc) -f ../docker-compose.yml -f docker-compose.backup.yml
|
||||||
|
11
e2e-test/qa/search/custom/.env
Normal file
11
e2e-test/qa/search/custom/.env
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# docker-compose related environments
|
||||||
|
ALFRESCO_IMAGE=alfresco/alfresco-content-repository
|
||||||
|
ALFRESCO_TAG=6.1.0-EA3
|
||||||
|
SHARE_IMAGE=alfresco/alfresco-share
|
||||||
|
SHARE_TAG=6.0
|
||||||
|
POSTGRES_IMAGE=postgres
|
||||||
|
POSTGRES_TAG=10.1
|
||||||
|
SEARCH_IMAGE=quay.io/alfresco/search-services
|
||||||
|
SEARCH_TAG=latest
|
||||||
|
ACTIVEMQ_IMAGE=alfresco/alfresco-activemq
|
||||||
|
ACTIVEMQ_TAG=5.15.6
|
16
e2e-test/qa/search/custom/Dockerfile
Normal file
16
e2e-test/qa/search/custom/Dockerfile
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
ARG SEARCH_TAG=latest
|
||||||
|
FROM quay.io/alfresco/search-services:$SEARCH_TAG
|
||||||
|
LABEL creator="Paul Brodner" maintainer="Alfresco Search Services Team"
|
||||||
|
|
||||||
|
ARG SCRIPTS_FOLDER=
|
||||||
|
|
||||||
|
USER root
|
||||||
|
RUN echo " &" >> $DIST_DIR/solr/bin/search_config_setup.sh && \
|
||||||
|
echo "bash -c \"find $DIST_DIR/scripts/ -maxdepth 1 -type f -executable -name '*.sh' -exec {} \\;\"" >> $DIST_DIR/solr/bin/search_config_setup.sh && \
|
||||||
|
echo "bash -c \"tail -f $DIST_DIR/logs/solr.log\"" >> $DIST_DIR/solr/bin/search_config_setup.sh
|
||||||
|
|
||||||
|
USER solr
|
||||||
|
COPY ${SCRIPTS_FOLDER}/* ${DIST_DIR}/scripts/
|
||||||
|
|
||||||
|
# we need this, because we tail on it in the search_config_setup.sh (see above)
|
||||||
|
RUN touch ./logs/solr.log
|
21
e2e-test/qa/search/custom/Makefile
Normal file
21
e2e-test/qa/search/custom/Makefile
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
include ../../Makefile
|
||||||
|
include .env
|
||||||
|
|
||||||
|
# CURRENT_DIR is the folder where this Makefile is saved
|
||||||
|
CURRENT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
||||||
|
|
||||||
|
ifeq ($(dc-custom),)
|
||||||
|
dc-custom:=$(dc) -f ../docker-compose.yml -f docker-compose.custom.yml
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
## ---- CUSTOM
|
||||||
|
build: ## 1 - build a custom image: $ make SCRIPTS_FOLDER=spellcheck custom-build
|
||||||
|
ifndef SCRIPTS_FOLDER
|
||||||
|
@echo SCRIPTS_FOLDER not defined "Usage: make SCRIPTS_FOLDER=spellcheck custom-build"
|
||||||
|
exit 1
|
||||||
|
endif
|
||||||
|
$(dc-custom) build --force-rm --no-cache --pull --build-arg SCRIPTS_FOLDER=$(SCRIPTS_FOLDER)
|
||||||
|
|
||||||
|
start: ## 2 - starts the custom image built: $ make start
|
||||||
|
$(dc-custom) up -d && make wait
|
25
e2e-test/qa/search/custom/README.md
Normal file
25
e2e-test/qa/search/custom/README.md
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
# About
|
||||||
|
|
||||||
|
Start Search Service with a custom configuration
|
||||||
|
|
||||||
|
# Steps
|
||||||
|
|
||||||
|
* **a)** under `custom` folder create a new folder that will hold all settings
|
||||||
|
>checkout [spellcheck](.spellcheck) folder for example
|
||||||
|
|
||||||
|
>add here any shell scripts that will enable/disable a particular setting
|
||||||
|
|
||||||
|
* **b)** build the new image setting SCRIPTS_FOLDER to you folder already created
|
||||||
|
```shel
|
||||||
|
make SCRIPTS_FOLDER=spellcheck build
|
||||||
|
```
|
||||||
|
>notice that out [docker-compose.custom.yml](.custom/docker-compose.custom.yml) file is using a [Dockerfile](.custom/Dockerfile) to built you new image.
|
||||||
|
> at runtime, all shell scripts from your folder are executed and the settings are applied.
|
||||||
|
|
||||||
|
* **c)** the image is built locally, now start it up
|
||||||
|
```shel
|
||||||
|
make start
|
||||||
|
```
|
||||||
|
|
||||||
|
# Environment Settings
|
||||||
|
Pay attention at the values that exist in [.env](.env) file. These settings will be picked up in custom docker-compose.*.yml file(s)
|
9
e2e-test/qa/search/custom/docker-compose.custom.yml
Normal file
9
e2e-test/qa/search/custom/docker-compose.custom.yml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
search:
|
||||||
|
build:
|
||||||
|
context: ./custom
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
image: quay.io/alfresco/search-services-custom:${SEARCH_TAG}
|
||||||
|
volumes:
|
||||||
|
- .:/backup
|
19
e2e-test/qa/search/custom/spellcheck/enable-spellcheck.sh
Executable file
19
e2e-test/qa/search/custom/spellcheck/enable-spellcheck.sh
Executable file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
echo "Enabling SpellCheck"
|
||||||
|
cat <<EOF >> /opt/alfresco-search-services/solrhome/conf/shared.properties
|
||||||
|
|
||||||
|
# Enabling SpellCheck
|
||||||
|
# configuration:
|
||||||
|
# * http://docs.alfresco.com/6.0/concepts/solr-shared-properties.html
|
||||||
|
# * https://docs.alfresco.com/5.2/tasks/solr6-install-withoutSSL.html
|
||||||
|
# test it: http://docs.alfresco.com/6.0/concepts/search-api-spellcheck.html
|
||||||
|
|
||||||
|
# Suggestable Properties
|
||||||
|
alfresco.suggestable.property.0={http://www.alfresco.org/model/content/1.0}name
|
||||||
|
alfresco.suggestable.property.1={http://www.alfresco.org/model/content/1.0}title
|
||||||
|
alfresco.suggestable.property.2={http://www.alfresco.org/model/content/1.0}description
|
||||||
|
alfresco.suggestable.property.3={http://www.alfresco.org/model/content/1.0}content
|
||||||
|
|
||||||
|
EOF
|
@@ -1,6 +1,9 @@
|
|||||||
include ../Makefile
|
include ../../Makefile
|
||||||
include .env
|
include .env
|
||||||
|
|
||||||
|
# CURRENT_DIR is the folder where this Makefile is saved
|
||||||
|
CURRENT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
||||||
|
|
||||||
ifeq ($(sharding),)
|
ifeq ($(sharding),)
|
||||||
sharding:=$(dc) -f ../docker-compose.yml -f docker-compose.sharding.yml
|
sharding:=$(dc) -f ../docker-compose.yml -f docker-compose.sharding.yml
|
||||||
endif
|
endif
|
||||||
|
@@ -1,6 +1,9 @@
|
|||||||
include ../Makefile
|
include ../../Makefile
|
||||||
include .env
|
include .env
|
||||||
|
|
||||||
|
# CURRENT_DIR is the folder where this Makefile is saved
|
||||||
|
CURRENT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
||||||
|
|
||||||
ifeq ($(dc-upgrade),)
|
ifeq ($(dc-upgrade),)
|
||||||
dc-upgrade:=$(dc) -f ../docker-compose.yml -f docker-compose.upgrade.yml
|
dc-upgrade:=$(dc) -f ../docker-compose.yml -f docker-compose.upgrade.yml
|
||||||
endif
|
endif
|
||||||
|
Reference in New Issue
Block a user