Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to define environments which are used in tasks #8

Open
maxklenk opened this issue Jun 22, 2015 · 3 comments
Open

Allow to define environments which are used in tasks #8

maxklenk opened this issue Jun 22, 2015 · 3 comments

Comments

@maxklenk
Copy link
Member

I use these environments which allow me to execute the same task with different environments to deploy or build the application.

var environments = {
  development: {
    rev: false,
    deployBranch: false,
    constants: {
      ENV: {
        name: 'development',
        html5Mode: true,
        apiEndpoint: 'local.server'
      }
    }
  },
  testing: {
    rev: true,
    deployBranch: 'deploy/test',
    constants: {
      ENV: {
        name: 'testing',
        html5Mode: true,
        apiEndpoint: 'test.server'
      }
    }
  },
  production: {
    rev: true,
    deployBranch: 'deploy/production',
    constants: {
      ENV: {
        name: 'production',
        html5Mode: true,
        apiEndpoint: 'server'
      }
    }
  }


// ENVIRONMENT FLAG
var env = environments.development;
for (var index in environments) {
  if (!!argv[index]) {
    env = environments[index];
  }
}
@sebastianhenneberg
Copy link
Contributor

I'm not completely sure if this functionality belongs into the tasks. Don't you think it would be better to handle the environment switch in the userspace (gulpfile.js or gulp_config.js)? We could consider some convenience tasks for the environment selection.

@maxklenk
Copy link
Member Author

The code I pasted should be inside the gulp_config.js, it just allows you to define different configurations. The tasks just access config.env.

@sebastianhenneberg
Copy link
Contributor

I know, I looked it up the private repo. However, then I do not understand the intention of this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants