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];
}
}
I use these environments which allow me to execute the same task with different environments to deploy or build the application.