mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	upgrade-postgres: Catch failed pg_upgradecluster exit code.
Because the command is part of a pipe sequence, the exitcode defaults to the last in the sequence, which is not the most important one here. Set pipefail, which sets the exit status to the exit code of the last program in the sequence to exit non-zero, or 0 if all succeeded. This prevents the upgrade from barreling onward and setting `postgres.version` improperly if the database upgrade step failed.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							78b92a51cc
						
					
				
				
					commit
					1fa4ef0271
				
			@@ -1,5 +1,5 @@
 | 
			
		||||
#!/usr/bin/env bash
 | 
			
		||||
set -e
 | 
			
		||||
set -eo pipefail
 | 
			
		||||
 | 
			
		||||
if [ "$EUID" -ne 0 ]; then
 | 
			
		||||
    echo "Error: This script must be run as root" >&2
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user