Add parameters handling to update-all script
This commit is contained in:
		
							parent
							
								
									309b89864f
								
							
						
					
					
						commit
						4ed6b00440
					
				|  | @ -1,5 +1,19 @@ | ||||||
| #!/bin/bash | #!/bin/bash | ||||||
| 
 | 
 | ||||||
|  | SKIP_PULL=0 | ||||||
|  | 
 | ||||||
|  | for i in "$@"; do | ||||||
|  |   case $i in | ||||||
|  |     --no-pull) | ||||||
|  |       SKIP_PULL=1 | ||||||
|  |       ;; | ||||||
|  |     *) | ||||||
|  |       echo "[$0] ❌ ERROR: unknown parameter \"$i\"" | ||||||
|  |       exit 1 | ||||||
|  |       ;; | ||||||
|  |   esac | ||||||
|  | done | ||||||
|  | 
 | ||||||
| # Create/update http_auth file according to values in .env file | # Create/update http_auth file according to values in .env file | ||||||
| source .env | source .env | ||||||
| echo "${HTTP_USER}:${HTTP_PASSWORD}" > traefik/http_auth | echo "${HTTP_USER}:${HTTP_PASSWORD}" > traefik/http_auth | ||||||
|  | @ -16,8 +30,11 @@ done < <(grep "disable" services.conf | awk -F : '{print  $1}' ) | ||||||
| SERVICES=$(find services -mindepth 1 -maxdepth 1 -name "*.yaml" ${disabled_pattern} | sed -e 's/^/-f /') | SERVICES=$(find services -mindepth 1 -maxdepth 1 -name "*.yaml" ${disabled_pattern} | sed -e 's/^/-f /') | ||||||
| ALL_SERVICES="-f docker-compose.yaml $SERVICES" | ALL_SERVICES="-f docker-compose.yaml $SERVICES" | ||||||
| 
 | 
 | ||||||
|  | if [[ "${SKIP_PULL}" != "1" ]]; then | ||||||
|   echo "[$0] ***** Pulling all images... *****" |   echo "[$0] ***** Pulling all images... *****" | ||||||
|   docker-compose ${ALL_SERVICES} pull |   docker-compose ${ALL_SERVICES} pull | ||||||
|  | fi | ||||||
|  | 
 | ||||||
| echo "[$0] ***** Recreating containers if required... *****" | echo "[$0] ***** Recreating containers if required... *****" | ||||||
| docker-compose ${ALL_SERVICES} up -d --remove-orphans | docker-compose ${ALL_SERVICES} up -d --remove-orphans | ||||||
| echo "[$0] ***** Done updating containers *****" | echo "[$0] ***** Done updating containers *****" | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue