New function assertVarsNotEmpty()
This commit is contained in:
		@@ -80,6 +80,23 @@ fetchVarsFromVaultByFile() {
 | 
			
		||||
	return 0
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
assertVarsNotEmpty() {
 | 
			
		||||
	MISSING_VARS=""
 | 
			
		||||
 | 
			
		||||
	for VAR in $@; do
 | 
			
		||||
	if [ -z "${!VAR}" ]; then
 | 
			
		||||
			MISSING_VARS+="$VAR "
 | 
			
		||||
		fi
 | 
			
		||||
	done
 | 
			
		||||
 | 
			
		||||
	if [ -n "$MISSING_VARS" ]; then
 | 
			
		||||
		log "ERROR" "Mandatory variables not defined: $MISSING_VARS"
 | 
			
		||||
		return 1
 | 
			
		||||
	fi
 | 
			
		||||
 | 
			
		||||
	return 0
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
##Setting Network properties
 | 
			
		||||
export HOSTIP=$(MSYS_NO_PATHCONV=1 docker run --rm --add-host=host.docker.internal:host-gateway ubuntu cat /etc/hosts | grep 'host.docker.internal' | awk '{print $1}');
 | 
			
		||||
export HOST=$(hostname)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user