terra-ops / terra-cli

The Terra Command Line Interface
http://terra.readthedocs.org
GNU General Public License v2.0
48 stars 17 forks source link

environment:enable overwrites terra configuration #63

Closed badri closed 9 years ago

badri commented 9 years ago

terra status gives the following error:

$ terra status
Hello Terra!

  [Exception]                                                                                                                        
  There is an error with your configuration: The child node "name" at path "project.apps.d7.environments.local" must be configured.  

status [<app_name>] [<environment_name>]

Steps to reproduce:

  1. Add an app.
$ terra app:add d7 git@github.com:jonpugh/terra-drush-make --description="agile deploy"
  1. Create a new environment for the app.
$ terra environment:add d7 local ~/Apps/d7-local

Likely reason:

  1. environment add saves the env config fully in terra config(https://github.com/terra-ops/terra-app/blob/master/src/terra/Command/Environment/EnvironmentAdd.php#L128).
  2. environment enable overwrites this config with just the url info(https://github.com/terra-ops/terra-app/blob/master/src/terra/Command/Environment/EnvironmentEnable.php#L56)
badri commented 9 years ago

terra config file before environment enable,

git: /usr/bin/git
apps_basepath: /home/lakshmi/Apps
apps:
    d7:
        name: d7
        description: 'agile deploy'
        repo: 'git@github.com:jonpugh/terra-drush-make'
        host: manomadhu
        environments:
            local:
                name: local
                path: /home/lakshmi/Apps/d7-local
                document_root: /www
                url: ''
                version: master

terra config after running environment enable,

git: /usr/bin/git
apps_basepath: /home/lakshmi/Apps
apps:
    d7:
        name: d7
        description: 'agile deploy'
        repo: 'git@github.com:jonpugh/terra-drush-make'
        host: manomadhu
        environments:
            local:
                url: 'http://manomadhu:32786'
jonpugh commented 9 years ago

I believe I just pushed the fix for this.

Pull code and try again?

Thanks! Jon

badri commented 9 years ago

works!