docker-atlassian-confluence.../func-tests/run-functests
Nasser Ghazali-Beiklar 2a28ea5182 Merged in DCKUBE-136-RunSmoketestsInReleasePipeline (pull request #83)
DCKUBE-135, DCKUBE-136, DCKUBE_137, and DCKUBE-138: Add Smoke tests in Confluence Pipeline
This PR contains code change for three tickets which are related and should merge to master together.

KUBEDCKUBE-135:
Applied security scan to bitbucket pipeline for branch builds in confluence - for releases, the test script will run by run.py for releases and for branch builds and custom releases will directly runs snyk scanner
Created a smoke testing suite via REST and included these scenarios: Create a space, Create a page, Search for the page, View page, Add attachments, Delete the page, and Delete the space

KUBEDCKUBE-136:
Added a separated docker for confluence to based on the docker image to copy confluence home directory
Injected target confluence image to Dockerfile
set the number of concurrent builds to one in pipeline
clean docker-compose before start and force to recreate the containers
Modified the script in order to install netcat-openbsd using apkfor Alpine (apt-getis not available in Alpine)
Replaced colfuence-home directory and postgres scripts with confluence 6.0.1 compatible to avoid downgrade version in release images
Increased database connection numbers to 125
Addressed some review points, replaced the confluence home directory and sql with version 6.0.1
Addressed a review points, renamed CONFLUENCE_USER to CONFLUENCE_ADMIN
divided pipeline into batches to avoid pipeline timeout

KUBEDCKUBE-137:
Run smoketests in branch builds after each commit
Completed smoketests and also addressed some review points

KUBEDCKUBE-138:
Added development document

Approved-by: Adam Brokes
2021-03-12 03:30:51 +00:00

25 lines
680 B
Bash
Executable File

#!/bin/sh
latest_image=$(docker images --format "{{.ID}} {{.CreatedAt}}" | sort -rk 2 | awk 'NR==1{print $1}')
TEST_TARGET_IMAGE=${1:-$latest_image}
DIR=$(dirname "$0")
export TEST_TARGET_IMAGE
export DIR
# Assumes this script is in the func-tests base dir
cd "$DIR" || exit
if [ -z "$CONFLUENCE_TEST_LICENSE" ]; then
echo "You need to define CONFLUENCE_TEST_LICENSE env variable"
exit 1
fi
unzip -o confluence-home-6.0.1.zip -d confluence
# NOTE: This expects the license to have been injected
sh ./confluence/inject-license
docker-compose rm -f && \
docker-compose up --force-recreate --always-recreate-deps --abort-on-container-exit --exit-code-from smoketests