build and push works, somewhat
This commit is contained in:
		@@ -23,7 +23,7 @@ check_file() {
 | 
			
		||||
        shift # Remove build from positional parameters
 | 
			
		||||
        ;;
 | 
			
		||||
      push)
 | 
			
		||||
        push=push
 | 
			
		||||
        push=true
 | 
			
		||||
        shift # Remove build from positional parameters
 | 
			
		||||
        ;;
 | 
			
		||||
      pull)
 | 
			
		||||
@@ -170,10 +170,28 @@ push(){
 | 
			
		||||
    if [ -z "$context" ]; then
 | 
			
		||||
        context="."
 | 
			
		||||
    fi
 | 
			
		||||
echo	push both tags cmd: $engine push $new_image_tag
 | 
			
		||||
	$engine push $new_image_tag
 | 
			
		||||
done
 | 
			
		||||
################################################################ BOTH IMAGES PUSHED
 | 
			
		||||
manifest_create_cmd="$engine manifest create $image"
 | 
			
		||||
echo $manifest_create_cmd
 | 
			
		||||
services=$(yq e '.services | keys | .[]' "$file")
 | 
			
		||||
	for service in $services; do
 | 
			
		||||
		platform=$(yq e ".services.$service.platform" "$file")
 | 
			
		||||
		image=$(yq e ".services.$service.image" "$file")
 | 
			
		||||
		# Replace '/' and ':' with '-' in the platform string to make it suitable for a tag
 | 
			
		||||
		platform_tag=$(echo "$platform" | tr '/:' '-')
 | 
			
		||||
		# Append platform information to the image tag
 | 
			
		||||
		new_image_tag="${image}-${platform_tag}"
 | 
			
		||||
 | 
			
		||||
	$engine manifest create $image 
 | 
			
		||||
		manifest_create_cmd+=" $new_image_tag"
 | 
			
		||||
	done
 | 
			
		||||
echo Manifest Create cmd: $manifest_create_cmd
 | 
			
		||||
     $manifest_create_cmd
 | 
			
		||||
#########################################
 | 
			
		||||
echo  manifest push cmd:	$engine manifest push $image
 | 
			
		||||
	$engine manifest push $image
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
pull(){
 | 
			
		||||
@@ -188,4 +206,7 @@ if [ "$pull" = true ]; then
 | 
			
		||||
	pull
 | 
			
		||||
elif [ "$build" = true ]; then
 | 
			
		||||
	build
 | 
			
		||||
elif [ "$push" = true ]; then
 | 
			
		||||
#	echo push
 | 
			
		||||
	push
 | 
			
		||||
fi
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user