mirror of
https://github.com/Alfresco/SearchServices.git
synced 2025-09-17 14:21:20 +00:00
migrate upgrade code from BuildScripts
This commit is contained in:
3
e2e-test/.gitignore
vendored
3
e2e-test/.gitignore
vendored
@@ -32,3 +32,6 @@ target
|
|||||||
*.ear
|
*.ear
|
||||||
qa/search/backup/host-bkp
|
qa/search/backup/host-bkp
|
||||||
qa/search/backup/host-bkp_T0
|
qa/search/backup/host-bkp_T0
|
||||||
|
image-digests.txt
|
||||||
|
qa/search/upgrade/solr-data
|
||||||
|
qa/search/upgrade/solr-contentstore
|
||||||
|
@@ -14,4 +14,11 @@ This folder contains code for provisioning ACS with SearchServices or InsightEng
|
|||||||
│ ├── README.md # how you can use it
|
│ ├── README.md # how you can use it
|
||||||
│ └── docker-compose.backup.yml # overrides standard docker-compose.yml with backup data
|
│ └── docker-compose.backup.yml # overrides standard docker-compose.yml with backup data
|
||||||
└── docker-compose.yml # standard docker-compose.yml for Search Service
|
└── docker-compose.yml # standard docker-compose.yml for Search Service
|
||||||
|
├── sharding # related to Sharding
|
||||||
|
│ ├── Makefile
|
||||||
|
│ ├── README.md
|
||||||
|
│ └── docker-compose.sharding.yml
|
||||||
|
└── upgrade
|
||||||
|
├── Makefile # start here if you want to test the upgrade
|
||||||
|
└── docker-compose.upgrade.yml
|
||||||
```
|
```
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
# execute any on the task that are found here from your terminal
|
# execute any on the task that are found here from your terminal
|
||||||
UNAME := $(shell uname)
|
UNAME := $(shell uname)
|
||||||
SHELL := /bin/bash
|
SHELL := /bin/bash
|
||||||
|
export COMPOSE_INTERACTIVE_NO_CLI=1
|
||||||
|
|
||||||
# CURRENT_DIR is the current location of this script: qa/search
|
# CURRENT_DIR is the current location of this script: qa/search
|
||||||
CURRENT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
CURRENT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
||||||
@@ -47,7 +48,7 @@ shell: ## main: open a shell to search service: $ make shell
|
|||||||
@$(dc) exec search sh
|
@$(dc) exec search sh
|
||||||
|
|
||||||
# kill all containers on default docker-compose.yml file
|
# kill all containers on default docker-compose.yml file
|
||||||
clean: ## kill containers
|
clean: ## main: kill containers
|
||||||
$(dc) kill && $(dc) rm -fv
|
$(dc) kill && $(dc) rm -fv
|
||||||
|
|
||||||
# just waits for a alfresco and solr to start
|
# just waits for a alfresco and solr to start
|
||||||
@@ -55,5 +56,8 @@ wait: ## main: wait for alfresco service && solr to startup
|
|||||||
$(helpers)/wait-service-to-start.sh && \
|
$(helpers)/wait-service-to-start.sh && \
|
||||||
$(helpers)/wait-service-to-start.sh http://localhost:8083/solr
|
$(helpers)/wait-service-to-start.sh http://localhost:8083/solr
|
||||||
|
|
||||||
standard: ## start with standard docker-compose.yml file
|
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
|
||||||
|
cd $(POM_DIR) && $(mvn) test -DsuiteXmlFile=$(suiteXmlFile)
|
@@ -3,9 +3,6 @@ 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
|
||||||
suiteXmlFile ?=./src/test/resources/search-pre-backup-suite.xml
|
|
||||||
|
|
||||||
export COMPOSE_INTERACTIVE_NO_CLI=1
|
|
||||||
|
|
||||||
# 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)/backup/host-bkp
|
||||||
@@ -45,9 +42,6 @@ backup-restore: ## 3 - start restoring from backup location
|
|||||||
docker-compose exec postgres bash -c 'psql --dbname=postgresql://alfresco:alfresco@127.0.0.1:5432/alfresco < /backup/db/alfresco.pg' && \
|
docker-compose exec postgres bash -c 'psql --dbname=postgresql://alfresco:alfresco@127.0.0.1:5432/alfresco < /backup/db/alfresco.pg' && \
|
||||||
$(dc-backup) up -d
|
$(dc-backup) up -d
|
||||||
|
|
||||||
run-mvn-tests: ## run e2e suiteXmlFile: $make run-e2e-tests suiteXmlFile=./src/test/resources/search-post-backup-suite.xml
|
|
||||||
cd $(POM_DIR) && $(mvn) test -DsuiteXmlFile=$(suiteXmlFile)
|
|
||||||
|
|
||||||
all: show-config ## 0 - executes the entire backup process
|
all: show-config ## 0 - executes the entire backup process
|
||||||
# perform the backup and waits until the server is starting
|
# perform the backup and waits until the server is starting
|
||||||
# do some change on backed up data
|
# do some change on backed up data
|
||||||
|
38
e2e-test/qa/search/upgrade/Makefile
Normal file
38
e2e-test/qa/search/upgrade/Makefile
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
include ../Makefile
|
||||||
|
include .env
|
||||||
|
|
||||||
|
ifeq ($(dc-upgrade),)
|
||||||
|
dc-upgrade:=$(dc) -f ../docker-compose.yml -f docker-compose.upgrade.yml
|
||||||
|
endif
|
||||||
|
|
||||||
|
## ---- UPGRADE
|
||||||
|
set_version ?=latest # default version that will be used in tasks
|
||||||
|
|
||||||
|
as-previous: clean ## 1 - install the previous version: $ make set_version=1.2.1 as-previous
|
||||||
|
rm -rf ./solr-data && \
|
||||||
|
rm -rf ./solr-contentstore && \
|
||||||
|
rm -f ./image-digests.txt
|
||||||
|
export SEARCH_TAG=$(set_version) && \
|
||||||
|
$(dc-upgrade) pull && \
|
||||||
|
echo "\n====Previous====" > image-digests.txt && \
|
||||||
|
$(dc-upgrade) config --resolve-image-digests >> image-digests.txt && \
|
||||||
|
$(dc-upgrade) up -d && \
|
||||||
|
docker ps
|
||||||
|
|
||||||
|
as-current: ## 2 - upgrade previous to this version $ make set_version=2.0.x as-current
|
||||||
|
$(dc-upgrade) kill search && \
|
||||||
|
$(dc-upgrade) rm -f search && \
|
||||||
|
export SEARCH_TAG=$(set_version) && \
|
||||||
|
$(dc-upgrade) pull search && \
|
||||||
|
echo "\n====Current====" >> image-digests.txt && \
|
||||||
|
$(dc-upgrade) config --resolve-image-digests >> image-digests.txt && \
|
||||||
|
$(dc-upgrade) up -d search && \
|
||||||
|
docker ps
|
||||||
|
|
||||||
|
#
|
||||||
|
# Run the following commands if you need to test the upgrade e2e
|
||||||
|
#
|
||||||
|
#make set_version=1.2.1 as-previous wait
|
||||||
|
#make run-mvn-tests suiteXmlFile=./src/test/resources/search-pre-upgrade-suite.xml
|
||||||
|
#make set_version=2.0.x as-current wait
|
||||||
|
#make run-mvn-tests suiteXmlFile=./src/test/resources/search-post-upgrade-suite.xml
|
27
e2e-test/qa/search/upgrade/README.md
Normal file
27
e2e-test/qa/search/upgrade/README.md
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
# About
|
||||||
|
|
||||||
|
Testing the Upgrade of SearchService product
|
||||||
|
|
||||||
|
# Steps
|
||||||
|
|
||||||
|
* **a)** start the initial version
|
||||||
|
```shel
|
||||||
|
make set_version=1.2.1 as-previous wait
|
||||||
|
```
|
||||||
|
>notice that new folders will appear on you "upgrade" folder with data from container(s)
|
||||||
|
|
||||||
|
* **b)** create some data manually or using automated tests found on this project
|
||||||
|
```shel
|
||||||
|
make run-mvn-tests suiteXmlFile=./src/test/resources/search-pre-upgrade-suite.xml
|
||||||
|
```
|
||||||
|
* **c)** now upgrade to new version
|
||||||
|
```shel
|
||||||
|
make set_version=2.0.x as-current wait
|
||||||
|
```
|
||||||
|
* **d)** and test that upgrade data exist
|
||||||
|
```shel
|
||||||
|
make run-mvn-tests suiteXmlFile=./src/test/resources/search-post-upgrade-suite.xml
|
||||||
|
```
|
||||||
|
|
||||||
|
# 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)
|
10
e2e-test/qa/search/upgrade/docker-compose.upgrade.yml
Normal file
10
e2e-test/qa/search/upgrade/docker-compose.upgrade.yml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
search:
|
||||||
|
environment:
|
||||||
|
- VERSION=${SEARCH_TAG}
|
||||||
|
image: quay.io/alfresco/search-services:${SEARCH_TAG}
|
||||||
|
volumes:
|
||||||
|
- "./upgrade/solr-data:/opt/alfresco-search-services/data"
|
||||||
|
- "./upgrade/solr-contentstore:/opt/alfresco-search-services/contentstore"
|
||||||
|
|
Reference in New Issue
Block a user