mirror of
				https://github.com/zokradonh/kopano-docker
				synced 2025-10-31 02:17:47 +00:00 
			
		
		
		
	Cure some quoting issues
* Double quotes not needed by docker compose Same issue as here https://github.com/zokradonh/kopano-docker/issues/216 * move deletion of tmpfile into an exit trap otherwise the file is not cleaned up when supported images are built * repair sourcing of env by removing kopano ldap settings from env before sourcing * additional packages env vars should be quoted in .env * adapt start scripts to handle quotes additional packages * treat update-tag script with ldap variable fix from setup.sh fixes #216 * run version.sh in travis (to fail early if something is wrong there) commit forgotten fixes to start scripts
This commit is contained in:
		
							parent
							
								
									b8885da14e
								
							
						
					
					
						commit
						b0236bf0d8
					
				| @ -27,8 +27,10 @@ before_install: | ||||
|   - sudo pip install --upgrade pip && sudo pip install yamllint | ||||
|   - npm install -g eclint | ||||
| install: | ||||
|   - "./version.sh" | ||||
|   - make lint | ||||
|   - "./test.exp" | ||||
|   - "./version.sh" | ||||
|   - make lint # rerun lint to see if output is different with .env in place | ||||
|   - echo "docker_repo=$docker_repo" >> .env | ||||
|   - echo "DOCKERREADME=yes" >> .env # add DOCKERREADME env var so that make publish also updates readme files on docker hub | ||||
|  | ||||
							
								
								
									
										4
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								Makefile
									
									
									
									
									
								
							| @ -66,8 +66,8 @@ endif | ||||
| 		--build-arg KOPANO_ZPUSH_REPOSITORY_URL=$(KOPANO_ZPUSH_REPOSITORY_URL) \
 | ||||
| 		--build-arg RELEASE_KEY_DOWNLOAD=$(RELEASE_KEY_DOWNLOAD) \
 | ||||
| 		--build-arg DOWNLOAD_COMMUNITY_PACKAGES=$(DOWNLOAD_COMMUNITY_PACKAGES) \
 | ||||
| 		--build-arg ADDITIONAL_KOPANO_PACKAGES="$(ADDITIONAL_KOPANO_PACKAGES)" \
 | ||||
| 		--build-arg ADDITIONAL_KOPANO_WEBAPP_PLUGINS="$(ADDITIONAL_KOPANO_WEBAPP_PLUGINS)" \
 | ||||
| 		--build-arg ADDITIONAL_KOPANO_PACKAGES=$(ADDITIONAL_KOPANO_PACKAGES) \
 | ||||
| 		--build-arg ADDITIONAL_KOPANO_WEBAPP_PLUGINS=$(ADDITIONAL_KOPANO_WEBAPP_PLUGINS) \
 | ||||
| 		--cache-from $(docker_repo)/kopano_$(component):builder \
 | ||||
| 		-t $(docker_repo)/kopano_$(component) $(component)/ | ||||
| 
 | ||||
|  | ||||
| @ -11,7 +11,7 @@ if [ ! -e /kopano/"$SERVICE_TO_START".py ]; then | ||||
| fi | ||||
| 
 | ||||
| [ -n "${ADDITIONAL_KOPANO_PACKAGES// }" ] && apt update | ||||
| [ -n "${ADDITIONAL_KOPANO_PACKAGES// }" ] && for installpkg in $ADDITIONAL_KOPANO_PACKAGES; do | ||||
| [ -n "${ADDITIONAL_KOPANO_PACKAGES// }" ] && for installpkg in $(echo "$ADDITIONAL_KOPANO_PACKAGES" | tr -d '"'); do | ||||
| 	# shellcheck disable=SC2016 disable=SC2086 | ||||
| 	if [ "$(dpkg-query -W -f='${Status}' $installpkg 2>/dev/null | grep -c 'ok installed')" -eq 0 ]; then | ||||
| 		apt --assume-yes --no-upgrade install "$installpkg" | ||||
|  | ||||
| @ -3,6 +3,13 @@ | ||||
| set -euo pipefail | ||||
| IFS=$'\n\t' | ||||
| 
 | ||||
| function finish { | ||||
| 	if [ -e "$tmpfile" ]; then | ||||
| 		rm "$tmpfile" | ||||
| 	fi | ||||
| } | ||||
| trap finish EXIT | ||||
| 
 | ||||
| if ! command -v reg > /dev/null; then | ||||
| 	echo "Please install reg in order to run this script." | ||||
| 	exit 1 | ||||
| @ -19,6 +26,8 @@ tmpfile=$(mktemp /tmp/kopano-docker-env.XXXXXX) | ||||
| cp ./.env "$tmpfile" | ||||
| sed -i '/LDAP_QUERY_FILTER/s/^/#/g' "$tmpfile" | ||||
| sed -i '/SASLAUTHD_LDAP_FILTER/s/^/#/g' "$tmpfile" | ||||
| sed -i '/KCUNCOMMENT_LDAP_1/s/^/#/g' "$tmpfile" | ||||
| sed -i '/KCCOMMENT_LDAP_1/s/^/#/g' "$tmpfile" | ||||
| # shellcheck disable=SC1090 | ||||
| source "$tmpfile" | ||||
| 
 | ||||
| @ -112,7 +121,3 @@ update_env_file SSL_VERSION "$return_value" | ||||
| 
 | ||||
| tag_question kopano_ldap "${LDAP_VERSION:-latest}" "LDAP container" | ||||
| update_env_file LDAP_VERSION "$return_value" | ||||
| 
 | ||||
| if [ -e "$tmpfile" ]; then | ||||
| 	rm "$tmpfile" | ||||
| fi | ||||
|  | ||||
							
								
								
									
										8
									
								
								setup.sh
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								setup.sh
									
									
									
									
									
								
							| @ -282,8 +282,8 @@ SELF_SERVICE_PASSWORD_MIN_DIGIT=1 | ||||
| SELF_SERVICE_PASSWORD_MIN_SPECIAL=1 | ||||
| 
 | ||||
| # switch the value of these two variables to use the activedirectory configuration | ||||
| KCUNCOMMENT_LDAP_1="!include /usr/share/kopano/ldap.openldap.cfg" | ||||
| KCCOMMENT_LDAP_1="!include /usr/share/kopano/ldap.active-directory.cfg" | ||||
| KCUNCOMMENT_LDAP_1=!include /usr/share/kopano/ldap.openldap.cfg | ||||
| KCCOMMENT_LDAP_1=!include /usr/share/kopano/ldap.active-directory.cfg | ||||
| 
 | ||||
| MYSQL_HOST=$MYSQL_HOST | ||||
| MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD | ||||
| @ -333,8 +333,8 @@ COMPOSE_FILE=docker-compose.yml:docker-compose.ports.yml | ||||
| #DOWNLOAD_COMMUNITY_PACKAGES=0 | ||||
| 
 | ||||
| # Additional packages to install | ||||
| ADDITIONAL_KOPANO_PACKAGES= | ||||
| ADDITIONAL_KOPANO_WEBAPP_PLUGINS=$ADDITIONAL_KOPANO_WEBAPP_PLUGINS | ||||
| ADDITIONAL_KOPANO_PACKAGES="" | ||||
| ADDITIONAL_KOPANO_WEBAPP_PLUGINS="$ADDITIONAL_KOPANO_WEBAPP_PLUGINS" | ||||
| 
 | ||||
| EOF | ||||
| else | ||||
|  | ||||
							
								
								
									
										12
									
								
								version.sh
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								version.sh
									
									
									
									
									
								
							| @ -4,6 +4,13 @@ if ! command -v jq > /dev/null; then | ||||
| 	exit 1 | ||||
| fi | ||||
| 
 | ||||
| function finish { | ||||
| 	if [ -e "$tmpfile" ]; then | ||||
| 		rm "$tmpfile" | ||||
| 	fi | ||||
| } | ||||
| trap finish EXIT | ||||
| 
 | ||||
| source base/create-kopano-repo.sh | ||||
| 
 | ||||
| component=${1:-core} | ||||
| @ -16,6 +23,8 @@ if [ -e ./.env ]; then | ||||
| 	cp ./.env "$tmpfile" | ||||
| 	sed -i '/LDAP_QUERY_FILTER/s/^/#/g' "$tmpfile" | ||||
| 	sed -i '/SASLAUTHD_LDAP_FILTER/s/^/#/g' "$tmpfile" | ||||
| 	sed -i '/KCUNCOMMENT_LDAP_1/s/^/#/g' "$tmpfile" | ||||
| 	sed -i '/KCCOMMENT_LDAP_1/s/^/#/g' "$tmpfile" | ||||
| 	# shellcheck disable=SC1090 | ||||
| 	source "$tmpfile" | ||||
| else | ||||
| @ -58,6 +67,3 @@ filename=$(h5ai_query "$component" "$distribution") | ||||
| currentVersion=$(version_from_filename "$filename") | ||||
| 
 | ||||
| echo "$currentVersion" | ||||
| if [ -e "$tmpfile" ]; then | ||||
| 	rm "$tmpfile" | ||||
| fi | ||||
|  | ||||
| @ -14,7 +14,7 @@ source /kopano/start-helper.sh | ||||
| ADDITIONAL_KOPANO_PACKAGES="$ADDITIONAL_KOPANO_PACKAGES $ADDITIONAL_KOPANO_WEBAPP_PLUGINS" | ||||
| 
 | ||||
| [ -n "${ADDITIONAL_KOPANO_PACKAGES// }" ] && apt update | ||||
| [ -n "${ADDITIONAL_KOPANO_PACKAGES// }" ] && for installpkg in $ADDITIONAL_KOPANO_PACKAGES; do | ||||
| [ -n "${ADDITIONAL_KOPANO_PACKAGES// }" ] && for installpkg in $(echo "$ADDITIONAL_KOPANO_PACKAGES" | tr -d '"'); do | ||||
| 	# shellcheck disable=SC2016 disable=SC2086 | ||||
| 	if [ "$(dpkg-query -W -f='${Status}' $installpkg 2>/dev/null | grep -c 'ok installed')" -eq 0 ]; then | ||||
| 		apt --assume-yes --no-upgrade install "$installpkg" | ||||
|  | ||||
| @ -38,7 +38,7 @@ php_cfg_gen() { | ||||
| } | ||||
| 
 | ||||
| [ -n "${ADDITIONAL_KOPANO_PACKAGES// }" ] && apt update | ||||
| [ -n "${ADDITIONAL_KOPANO_PACKAGES// }" ] && for installpkg in $ADDITIONAL_KOPANO_PACKAGES; do | ||||
| [ -n "${ADDITIONAL_KOPANO_PACKAGES// }" ] && for installpkg in $(echo "$ADDITIONAL_KOPANO_PACKAGES" | tr -d '"'); do | ||||
| 	# shellcheck disable=SC2016 disable=SC2086 | ||||
| 	if [ "$(dpkg-query -W -f='${Status}' $installpkg 2>/dev/null | grep -c 'ok installed')" -eq 0 ]; then | ||||
| 		apt --assume-yes --no-upgrade install "$installpkg" | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user