only generate the necessary branch in CI environments

This commit is contained in:
Spencer Alger
2014-02-05 09:06:52 -07:00
parent 6c5838fbfa
commit 4680930487
3 changed files with 16 additions and 11 deletions

View File

@ -43,7 +43,7 @@ fi
if [[ "$NODE_INTEGRATION" != "0" ]]; then
group "generating tests"
call node scripts/generate --no-api
call node scripts/generate --no-api --branch $TESTING_BRANCH
group "running integration tests"
if [[ -n "$JENKINS" ]]; then

View File

@ -19,6 +19,10 @@ var argv = require('optimist')
update: {
default: true,
boolean: true
},
branch: {
default: null,
string: true
}
});
@ -29,12 +33,6 @@ var utils = require(fromRoot('grunt/utils'));
var esUrl = 'https://github.com/elasticsearch/elasticsearch.git';
var branches;
if (process.env.ES_GIT_BRANCH) {
branches = [process.env.ES_GIT_BRANCH.split('/').slice(1).join('/')];
} else {
branches = utils.branches;
}
if (process.env.npm_config_argv) {
// when called by NPM
argv = argv.parse(JSON.parse(process.env.npm_config_argv).original);
@ -43,6 +41,13 @@ if (process.env.npm_config_argv) {
argv = argv.argv;
}
if (argv.branch) {
branches = [argv.branch];
} else {
branches = utils.branches;
}
function isDirectory(dir) {
var stat;
try { stat = fs.statSync(dir); } catch (e) {}

View File

@ -17,11 +17,11 @@ re_10='^1\.0\..*$';
if [[ "$ES_V" =~ $re_nightly ]]; then
export ES_BRANCH=${BASH_REMATCH[1]}
elif [[ "$ES_V" =~ $re_090 ]]; then
ES_BRANCH='0.90'
ES_RELEASE=$ES_V
export ES_BRANCH='0.90'
export ES_RELEASE=$ES_V
elif [[ "$ES_V" =~ $re_10 ]]; then
ES_BRANCH='1.0'
ES_RELEASE=$ES_V
export ES_BRANCH='1.0'
export ES_RELEASE=$ES_V
else
echo "unable to parse ES_V $ES_V"
exit 1