Try a clean git-clone if pulling fails
This commit is contained in:
		
							parent
							
								
									0d7b92f3d2
								
							
						
					
					
						commit
						4c22604a83
					
				| @ -15,6 +15,15 @@ set -e -v | ||||
| 		true | ||||
| 	else | ||||
| 		# repo URL set | ||||
| 		if [ -d /repo ]; then | ||||
| 			# repo already exists, try to pull | ||||
| 			cd /repo && git pull --recurse-submodules | ||||
| 			if [ "$?" -ne 0 ]; then | ||||
| 				# pull failed, clean and retry to clone | ||||
| 				echo "Pull failed, attempting to clean clone" | ||||
| 				rm -rf /repo | ||||
| 			fi | ||||
| 		fi | ||||
| 		if [ ! -d /repo ]; then | ||||
| 			# repo needs to be cloned | ||||
| 			# check if there is a specific branch to clone | ||||
| @ -22,9 +31,6 @@ set -e -v | ||||
| 				BRANCHCMD="--branch $REPO_BRANCH" | ||||
| 			fi | ||||
| 			git clone --recurse-submodules $BRANCHCMD $REPO_URL /repo | ||||
| 		else | ||||
| 			# no - pull existing repo | ||||
| 			cd /repo && git pull --recurse-submodules | ||||
| 		fi | ||||
| 	fi | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user