mirror of
				https://github.com/zokradonh/kopano-docker
				synced 2025-10-30 18:07:46 +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 | docker_repo := zokradonh | ||||||
| # if not run in travis, get docker_login and _pwd from file
 | # 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" | \ | 	filename=$(curl -s -XPOST "https://download.kopano.io/$channel/?action=get&items\[href\]=/$channel/$component:/$branch&items\[what\]=1" | \ | ||||||
| 			jq -r '.items[].href' | \ | 			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 | 	if [ -z "${filename// }" ]; then | ||||||
| 		echo "unknown component" | 		echo "unknown component" | ||||||
| @ -44,8 +44,8 @@ function dl_and_package_community { | |||||||
| 	tar xf "$filename2" | 	tar xf "$filename2" | ||||||
| 
 | 
 | ||||||
| 	# save buildversion | 	# save buildversion | ||||||
| 	currentVersion=$(version_from_filename "$filename") | 	#currentVersion=$(version_from_filename "$filename") | ||||||
| 	echo "$component-$currentVersion" >> /kopano/buildversion | 	#echo "$component-$currentVersion" >> /kopano/buildversion | ||||||
| 
 | 
 | ||||||
| 	# save disk space | 	# save disk space | ||||||
| 	rm "$filename2" | 	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: |       not-contains: | ||||||
|         - Debian |         - Debian | ||||||
|         - amd64 |         - 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