mirror of
https://github.com/zokradonh/kopano-docker
synced 2025-06-07 16:06:14 +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:
parent
b36093d074
commit
f5ff9393ff
8
Makefile
8
Makefile
@ -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
|
||||
|
@ -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
20
base/test.sh
Executable 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"
|
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user