forked from toolshed/abra
		
	Compare commits
	
		
			3 Commits
		
	
	
		
			abra-app-m
			...
			fix-integr
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 02b4035409 | |||
| 213d4a9214 | |||
| ba0c0c793d | 
| @ -303,12 +303,8 @@ func getDeployVersion(cliArgs []string, deployMeta stack.DeployMeta, app app.App | ||||
| 		if err != nil { | ||||
| 			return "", "", err | ||||
| 		} | ||||
| 		cv, err := app.Recipe.GetVersionLabelLocal() | ||||
| 		if err != nil { | ||||
| 			return "", "", err | ||||
| 		} | ||||
| 		log.Debugf("version: taking chaos version: %s, %s", v, cv) | ||||
| 		return v, cv, nil | ||||
| 		log.Debugf("version: taking chaos version: %s", v) | ||||
| 		return v, v, nil | ||||
| 	} | ||||
|  | ||||
| 	// Check if the deploy version is set with a cli argument | ||||
|  | ||||
| @ -59,16 +59,16 @@ Passing "--prune/-p" does not remove those volumes.`, | ||||
| 			chaosVersion = deployMeta.ChaosVersion | ||||
| 		} | ||||
|  | ||||
| 		toWriteVersion := deployMeta.Version | ||||
| 		version := deployMeta.Version | ||||
| 		if deployMeta.IsChaos { | ||||
| 			toWriteVersion = chaosVersion | ||||
| 			version = chaosVersion | ||||
| 		} | ||||
|  | ||||
| 		if err := internal.UndeployOverview( | ||||
| 			app, | ||||
| 			deployMeta.Version, | ||||
| 			chaosVersion, | ||||
| 			toWriteVersion, | ||||
| 			version, | ||||
| 		); err != nil { | ||||
| 			log.Fatal(err) | ||||
| 		} | ||||
| @ -86,10 +86,6 @@ Passing "--prune/-p" does not remove those volumes.`, | ||||
| 				log.Fatal(err) | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 		if err := app.WriteRecipeVersion(toWriteVersion, false); err != nil { | ||||
| 			log.Fatalf("writing recipe version failed: %s", err) | ||||
| 		} | ||||
| 	}, | ||||
| } | ||||
|  | ||||
|  | ||||
| @ -64,10 +64,7 @@ func NewVersionOverview( | ||||
|  | ||||
| 	upperKind := strings.ToUpper(kind) | ||||
|  | ||||
| 	envVersion, err := recipe.GetEnvVersionRaw(app.Recipe.Name) | ||||
| 	if err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	envVersion := app.Recipe.EnvVersionRaw | ||||
|  | ||||
| 	if envVersion == "" { | ||||
| 		envVersion = config.NO_VERSION_DEFAULT | ||||
|  | ||||
| @ -135,6 +135,8 @@ func GetEnvVersionRaw(name string) (string, error) { | ||||
|  | ||||
| func Get(name string) Recipe { | ||||
| 	version := "" | ||||
| 	versionRaw := "" | ||||
| 	dirty := false | ||||
| 	if strings.Contains(name, ":") { | ||||
| 		split := strings.Split(name, ":") | ||||
| 		if len(split) > 2 { | ||||
| @ -143,7 +145,9 @@ func Get(name string) Recipe { | ||||
| 		name = split[0] | ||||
|  | ||||
| 		version = split[1] | ||||
| 		versionRaw = version | ||||
| 		if strings.HasSuffix(version, config.DIRTY_DEFAULT) { | ||||
| 			dirty = true | ||||
| 			version = strings.Replace(split[1], config.DIRTY_DEFAULT, "", 1) | ||||
| 			log.Debugf("removed dirty suffix from .env version: %s -> %s", split[1], version) | ||||
| 		} | ||||
| @ -167,11 +171,13 @@ func Get(name string) Recipe { | ||||
| 	dir := path.Join(config.RECIPES_DIR, escapeRecipeName(name)) | ||||
|  | ||||
| 	r := Recipe{ | ||||
| 		Name:       name, | ||||
| 		EnvVersion: version, | ||||
| 		Dir:        dir, | ||||
| 		GitURL:     gitURL, | ||||
| 		SSHURL:     sshURL, | ||||
| 		Name:          name, | ||||
| 		EnvVersion:    version, | ||||
| 		EnvVersionRaw: versionRaw, | ||||
| 		Dirty:         dirty, | ||||
| 		Dir:           dir, | ||||
| 		GitURL:        gitURL, | ||||
| 		SSHURL:        sshURL, | ||||
|  | ||||
| 		ComposePath:   path.Join(dir, "compose.yml"), | ||||
| 		ReadmePath:    path.Join(dir, "README.md"), | ||||
| @ -187,12 +193,14 @@ func Get(name string) Recipe { | ||||
| } | ||||
|  | ||||
| type Recipe struct { | ||||
| 	Name       string | ||||
| 	EnvVersion string | ||||
| 	Dirty      bool // NOTE(d1): git terminology for unstaged changes | ||||
| 	Dir        string | ||||
| 	GitURL     string | ||||
| 	SSHURL     string | ||||
| 	Name string | ||||
| 	// EnvVersion without +U | ||||
| 	EnvVersion    string | ||||
| 	EnvVersionRaw string | ||||
| 	Dirty         bool // NOTE(d1): git terminology for unstaged changes | ||||
| 	Dir           string | ||||
| 	GitURL        string | ||||
| 	SSHURL        string | ||||
|  | ||||
| 	ComposePath   string | ||||
| 	ReadmePath    string | ||||
|  | ||||
| @ -165,14 +165,13 @@ teardown(){ | ||||
|   run $ABRA app rollback "$TEST_APP_DOMAIN" "0.1.1+1.20.2" --no-input --no-converge-checks | ||||
|   assert_success | ||||
|   assert_output --partial "0.1.1+1.20.2" | ||||
|   assert_output --partial "${tagHash:0:8}" | ||||
|   assert_output --partial "0.2.0+1.21.0" | ||||
|   refute_output --partial "false" | ||||
|  | ||||
|   run $ABRA app rollback "$TEST_APP_DOMAIN" "0.1.0+1.20.0" --no-input --no-converge-checks | ||||
|   assert_success | ||||
|   assert_output --partial "0.1.1+1.20.2" | ||||
|   assert_output --partial "0.1.0+1.20.0" | ||||
|  | ||||
|   tagHash=$(_get_tag_hash "0.1.1+1.20.2") | ||||
|   refute_output --partial "${tagHash:0:8}" | ||||
|   assert_output --partial "false" | ||||
| } | ||||
|  | ||||
|  | ||||
| @ -64,10 +64,6 @@ teardown(){ | ||||
|   # env version | ||||
|   assert_output --regexp 'CURRENT VERSION.*' + "${latestRelease}" | ||||
|   assert_output --regexp 'NEW VERSION.*' + "${headHash:0:8}" | ||||
|  | ||||
|   run grep -q "TYPE=$TEST_RECIPE:${headHash:0:8}" \ | ||||
|     "$ABRA_DIR/servers/$TEST_SERVER/$TEST_APP_DOMAIN.env" | ||||
|   assert_success | ||||
| } | ||||
|  | ||||
| @test "chaos deploy with unstaged commits and undeploy" { | ||||
| @ -93,10 +89,6 @@ teardown(){ | ||||
|   assert_output --regexp 'CURRENT VERSION.*' + "${latestRelease}" | ||||
|   assert_output --regexp 'NEW VERSION.*' + "${headHash:0:8}+U" | ||||
|  | ||||
|   run grep -q "TYPE=$TEST_RECIPE:${headHash:0:8}" \ | ||||
|     "$ABRA_DIR/servers/$TEST_SERVER/$TEST_APP_DOMAIN.env" | ||||
|   assert_success | ||||
|  | ||||
|   run rm -rf "$ABRA_DIR/recipes/$TEST_RECIPE/foo" | ||||
|   assert_not_exists "$ABRA_DIR/recipes/$TEST_RECIPE/foo" | ||||
| } | ||||
|  | ||||
| @ -217,7 +217,7 @@ teardown(){ | ||||
|   run $ABRA app upgrade "$TEST_APP_DOMAIN" "0.1.1+1.20.2" --no-input --no-converge-checks | ||||
|   assert_success | ||||
|   assert_output --partial "0.1.1+1.20.2" | ||||
|   assert_output --partial "${tagHash:0:8}" | ||||
|   assert_output --partial "0.1.0+1.20.0" | ||||
|  | ||||
|   run $ABRA app upgrade "$TEST_APP_DOMAIN" "0.2.0+1.21.0" --no-input --no-converge-checks | ||||
|   assert_success | ||||
|  | ||||
		Reference in New Issue
	
	Block a user