1
0
mirror of https://github.com/zokradonh/kopano-docker synced 2025-06-07 07:56:12 +00:00

add tests for downloading archive from kopano download server (#311)

* add tests for downloading archive from kopano download server
add some makefile defaults

Signed-off-by: Felix Bartels <felix@host-consultants.de>

* linting

Signed-off-by: Felix Bartels <felix@host-consultants.de>
This commit is contained in:
Felix Bartels 2019-12-22 13:31:34 +01:00 committed by GitHub
parent b36093d074
commit f5ff9393ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 43 additions and 5 deletions

View File

@ -1,4 +1,10 @@
SHELL := /bin/bash # Use bash syntax
# define some defaults https://tech.davis-hansson.com/p/make/
SHELL := bash
.ONESHELL:
.SHELLFLAGS := -eu -o pipefail -c
.DELETE_ON_ERROR:
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
docker_repo := zokradonh
# if not run in travis, get docker_login and _pwd from file

View File

@ -17,7 +17,7 @@ function h5ai_query {
filename=$(curl -s -XPOST "https://download.kopano.io/$channel/?action=get&items\[href\]=/$channel/$component:/$branch&items\[what\]=1" | \
jq -r '.items[].href' | \
grep "$distribution-all\|$distribution-amd64" | sed "s#/$channel/$component:/##")
grep "$distribution-all\|$distribution-amd64" | sed "s#/$channel/$component:/##" | sed "s#/$channel/$component%3A/##")
if [ -z "${filename// }" ]; then
echo "unknown component"
@ -44,8 +44,8 @@ function dl_and_package_community {
tar xf "$filename2"
# save buildversion
currentVersion=$(version_from_filename "$filename")
echo "$component-$currentVersion" >> /kopano/buildversion
#currentVersion=$(version_from_filename "$filename")
#echo "$component-$currentVersion" >> /kopano/buildversion
# save disk space
rm "$filename2"

20
base/test.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
DEBUG=true
WORK_DIR=$(mktemp -d)
component=${1:-core}
function cleanup {
rm -rf "$WORK_DIR"
echo "Deleted temp working directory $WORK_DIR"
}
trap cleanup EXIT
cd "$WORK_DIR"
# shellcheck source=base/create-kopano-repo.sh
. "$DIR"/create-kopano-repo.sh
dl_and_package_community "$component"

View File

@ -51,4 +51,16 @@ tests:
not-contains:
- Debian
- amd64
- tar.gz
- tar.gz
download core nightly:
command: ./base/test.sh core
exit-code: 0
stderr:
not-contains:
- "tar: This does not look like a tar archive"
download webapp nightly:
command: ./base/test.sh webapp
exit-code: 0
stderr:
not-contains:
- "tar: This does not look like a tar archive"