HELMFILE_ENVIRONMENT variable (#1425)
Co-authored-by: Pawel Przeszlo <pawel.przeszlo@comarch.pl>
This commit is contained in:
		
							parent
							
								
									7b11ce851a
								
							
						
					
					
						commit
						6b4b76e2bc
					
				| 
						 | 
					@ -420,6 +420,9 @@ GLOBAL OPTIONS:
 | 
				
			||||||
   --interactive, -i                       Request confirmation before attempting to modify clusters
 | 
					   --interactive, -i                       Request confirmation before attempting to modify clusters
 | 
				
			||||||
   --help, -h                              show help
 | 
					   --help, -h                              show help
 | 
				
			||||||
   --version, -v                           print the version
 | 
					   --version, -v                           print the version
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Environment variables:
 | 
				
			||||||
 | 
					  HELMFILE_ENVIRONMENT                     specify the environment name, the command line option '-e' have precedence
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### sync
 | 
					### sync
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										3
									
								
								main.go
								
								
								
								
							
							
						
						
									
										3
									
								
								main.go
								
								
								
								
							| 
						 | 
					@ -680,9 +680,12 @@ func (c configImpl) Logger() *zap.SugaredLogger {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (c configImpl) Env() string {
 | 
					func (c configImpl) Env() string {
 | 
				
			||||||
	env := c.c.GlobalString("environment")
 | 
						env := c.c.GlobalString("environment")
 | 
				
			||||||
 | 
						if env == "" {
 | 
				
			||||||
 | 
							env = os.Getenv("HELMFILE_ENVIRONMENT")
 | 
				
			||||||
		if env == "" {
 | 
							if env == "" {
 | 
				
			||||||
			env = state.DefaultEnv
 | 
								env = state.DefaultEnv
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	return env
 | 
						return env
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue