forked from toolshed/abra
		
	Compare commits
	
		
			2 Commits
		
	
	
		
			app-new-fi
			...
			private-re
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 7a24bf9cd5 | |||
| 7c3b740e14 | 
| @ -32,12 +32,12 @@ func ValidateRecipe(args []string, cmdName string) recipe.Recipe { | ||||
|  | ||||
| 		localRecipes, err := recipe.GetRecipesLocal() | ||||
| 		if err != nil { | ||||
| 			log.Debugf("can't read local recipes: %s", err) | ||||
| 		} else { | ||||
| 			for _, recipeLocal := range localRecipes { | ||||
| 				if _, ok := knownRecipes[recipeLocal]; !ok { | ||||
| 					knownRecipes[recipeLocal] = true | ||||
| 				} | ||||
| 			log.Fatal(err) | ||||
| 		} | ||||
|  | ||||
| 		for _, recipeLocal := range localRecipes { | ||||
| 			if _, ok := knownRecipes[recipeLocal]; !ok { | ||||
| 				knownRecipes[recipeLocal] = true | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
|  | ||||
| @ -17,6 +17,7 @@ import ( | ||||
| 	"coopcloud.tech/abra/pkg/log" | ||||
| 	"coopcloud.tech/abra/pkg/ui" | ||||
| 	"coopcloud.tech/abra/pkg/upstream/convert" | ||||
| 	"github.com/docker/cli/cli/command" | ||||
| 	"github.com/docker/cli/cli/command/stack/formatter" | ||||
| 	composetypes "github.com/docker/cli/cli/compose/types" | ||||
| 	"github.com/docker/docker/api/types" | ||||
| @ -426,7 +427,8 @@ func deployServices( | ||||
| 	services map[string]swarm.ServiceSpec, | ||||
| 	namespace convert.Namespace, | ||||
| 	sendAuth bool, | ||||
| 	resolveImage string) ([]ui.ServiceMeta, error) { | ||||
| 	resolveImage string, | ||||
| ) ([]ui.ServiceMeta, error) { | ||||
| 	var servicesMeta []ui.ServiceMeta | ||||
|  | ||||
| 	existingServices, err := GetStackServices(ctx, cl, namespace.Name()) | ||||
| @ -446,6 +448,21 @@ func deployServices( | ||||
| 			encodedAuth string | ||||
| 		) | ||||
|  | ||||
| 		// When sendAuth is set, use the docker cli to retrieve the auth token | ||||
| 		// for the image we are deploying. | ||||
| 		// This enables using a private registry by running docker login on the | ||||
| 		// machine, that abra is executed. | ||||
| 		if sendAuth { | ||||
| 			dockerCLI, err := command.NewDockerCli() | ||||
| 			if err != nil { | ||||
| 				log.Errorf("retrieving docker auth token: failed create docker cli: %s", err) | ||||
| 			} | ||||
| 			encodedAuth, err = command.RetrieveAuthTokenFromImage(dockerCLI.ConfigFile(), image) | ||||
| 			if err != nil { | ||||
| 				log.Errorf("failed to retrieve registry auth for image %s: %s", image, err) | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 		if service, exists := existingServiceMap[name]; exists { | ||||
| 			log.Debugf("updating %s", name) | ||||
|  | ||||
| @ -587,7 +604,7 @@ func WaitOnServices(ctx context.Context, cl *dockerClient.Client, opts WaitOpts) | ||||
| 				fmt.Sprintf("%s_%s", opts.AppName, timestamp()), | ||||
| 			) | ||||
|  | ||||
| 			if err := os.MkdirAll(filepath.Join(config.LOGS_DIR, opts.ServerName), 0764); err != nil { | ||||
| 			if err := os.MkdirAll(filepath.Join(config.LOGS_DIR, opts.ServerName), 0o764); err != nil { | ||||
| 				return fmt.Errorf("waitOnServices: error creating log dir: %s", err) | ||||
| 			} | ||||
|  | ||||
|  | ||||
| @ -3,5 +3,5 @@ STACK := abra_installer_script | ||||
| default: deploy | ||||
|  | ||||
| deploy: | ||||
| 	@DOCKER_CONTEXT=swarm.autonomic.zone docker stack rm $(STACK) && \ | ||||
| 		DOCKER_CONTEXT=swarm.autonomic.zone docker stack deploy -c compose.yml $(STACK) | ||||
| 	@DOCKER_CONTEXT=swarm-0.coopcloud.tech docker stack rm $(STACK) && \ | ||||
| 		DOCKER_CONTEXT=swarm-0.coopcloud.tech docker stack deploy -c compose.yml $(STACK) | ||||
|  | ||||
		Reference in New Issue
	
	Block a user