Optionally build migrations
This commit is contained in:
		
							parent
							
								
									6511e7f32e
								
							
						
					
					
						commit
						5e09fadc3b
					
				
					 1 changed files with 20 additions and 12 deletions
				
			
		
							
								
								
									
										32
									
								
								build.sh
									
										
									
									
									
								
							
							
						
						
									
										32
									
								
								build.sh
									
										
									
									
									
								
							|  | @ -2,6 +2,7 @@ | ||||||
| 
 | 
 | ||||||
| BUILD_DATE=$(date) | BUILD_DATE=$(date) | ||||||
| VERSION=$1 | VERSION=$1 | ||||||
|  | MIGRATIONS=$2 | ||||||
| 
 | 
 | ||||||
| function require() { | function require() { | ||||||
|     if [ "$1" = "" ]; then |     if [ "$1" = "" ]; then | ||||||
|  | @ -15,10 +16,11 @@ function print_help() { | ||||||
|     echo "build.sh" |     echo "build.sh" | ||||||
|     echo "" |     echo "" | ||||||
|     echo "Usage:" |     echo "Usage:" | ||||||
|     echo "      build.sh [version]" |     echo "      build.sh [version] [migrations]" | ||||||
|     echo "" |     echo "" | ||||||
|     echo "Args:" |     echo "Args:" | ||||||
|     echo "      version: The version of the current container" |     echo "      version: The version of the current container" | ||||||
|  |     echo "      migrations: (optional) Whether to build the migrations container as well" | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| require "$VERSION" "version" | require "$VERSION" "version" | ||||||
|  | @ -46,17 +48,23 @@ docker build \ | ||||||
|     -t "asonix/relay:latest" \ |     -t "asonix/relay:latest" \ | ||||||
|     ./artifacts |     ./artifacts | ||||||
| 
 | 
 | ||||||
| docker build \ |  | ||||||
|     --pull \ |  | ||||||
|     --no-cache \ |  | ||||||
|     --build-arg BUILD_DATE="${BUILD_DATE}" \ |  | ||||||
|     --build-arg TAG="${TAG}" \ |  | ||||||
|     -f Dockerfile.migrations.arm64v8 \ |  | ||||||
|     -t "asonix/relay-migrations:${VERSION}-arm64v8" \ |  | ||||||
|     -t "asonix/relay-migrations:latest-arm64v8" \ |  | ||||||
|     -t "asonix/relay-migrations:latest" \ |  | ||||||
|     ./artifacts |  | ||||||
| 
 |  | ||||||
| docker push "asonix/relay:${VERSION}-arm64v8" | docker push "asonix/relay:${VERSION}-arm64v8" | ||||||
| docker push "asonix/relay:latest-arm64v8" | docker push "asonix/relay:latest-arm64v8" | ||||||
| docker push "asonix/relay:latest" | docker push "asonix/relay:latest" | ||||||
|  | 
 | ||||||
|  | if [ "${MIGRATIONS}" = "" ]; then | ||||||
|  |     docker build \ | ||||||
|  |         --pull \ | ||||||
|  |         --no-cache \ | ||||||
|  |         --build-arg BUILD_DATE="${BUILD_DATE}" \ | ||||||
|  |         --build-arg TAG="${TAG}" \ | ||||||
|  |         -f Dockerfile.migrations.arm64v8 \ | ||||||
|  |         -t "asonix/relay-migrations:${VERSION}-arm64v8" \ | ||||||
|  |         -t "asonix/relay-migrations:latest-arm64v8" \ | ||||||
|  |         -t "asonix/relay-migrations:latest" \ | ||||||
|  |         ./artifacts | ||||||
|  | 
 | ||||||
|  |     docker push "asonix/relay-migrations:${VERSION}-arm64v8" | ||||||
|  |     docker push "asonix/relay-migrations:latest-arm64v8" | ||||||
|  |     docker push "asonix/relay-migrations:latest" | ||||||
|  | fi | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue