Fix potential race condition in the deployment

OK, got it. Didn’t see that you were using the job number now.

On Aug 14, 2014, at 7:45 AM, William Candillon <notifications@github.com> wrote:

> In Gruntfile.js:
> 
> > @@ -546,20 +558,25 @@ module.exports = function (grunt) {
> >      });
> >  
> >      grunt.registerTask('deploy', function() {
> > -        // only deploy if triggered by a pull request
> > -        if (process.env.TRAVIS_BRANCH !== undefined && process.env.TRAVIS_PULL_REQUEST !== undefined &&
> > -            process.env.TRAVIS_PULL_REQUEST !== 'false') {
> > +        var isPullRequest = process.env.TRAVIS_PULL_REQUEST !== 'false';
> > +        if(isPullRequest) {
> > +            grunt.log.writeln('Pull request #' + process.env.TRAVIS_PULL_REQUEST);
> > +            var id = 'secxbrl-' + process.env.TRAVIS_BRANCH + '-' + process.env.TRAVIS_JOB_NUMBER.replace('.', '-');
> @MatthiasBrantner here we use the job id to not delete a project while it's being deployed somewhere else and vice versa.
> 
> —
> Reply to this email directly or view it on GitHub.
>