install.js
function fetchCdnVersion(cdnUrl) {
        var fullUrl = cdnUrl + path.sep + SONAR_RUNNER_DIST;
        console.log('Fetching sonar-runner from CDN url [' + fullUrl + '].');
        try {
            var response = request('GET', fullUrl);
            if(response.statusCode === 200) {
                var destination = path.join('.tmp', SONAR_RUNNER_DIST);
                fs.mkdirsSync('.tmp', '0775');
                fs.writeFileSync(destination, response.getBody(), {replace: true});
                return destination;
            } else if(response.statusCode === 404) {
                console.error('Could not find '+ SONAR_RUNNER_DIST + ' on the specified CDN url[' + fullUrl +'].');
            } else {
                console.error('Something went wrong while fetching '+ SONAR_RUNNER_DIST + ' on the specified CDN url[' + fullUrl +'], statusCode [' + response.statusCode + '] was received.');
            }
        } catch (e) {
            console.error('Could not connect to CDN url[' + cdnUrl +'], received message [' + e + ']');
        }
    }
function fetchCdnVersion(cdnUrl) {
        var fullUrl = cdnUrl + path.sep + SONAR_RUNNER_DIST;
        console.log('Fetching sonar-runner from CDN url [' + fullUrl + '].');
        try {
            var response = request('GET', fullUrl);
            if(response.statusCode === 200) {
                var destination = path.join('.tmp', SONAR_RUNNER_DIST);
                fs.mkdirsSync('.tmp', '0775');
                fs.writeFileSync(destination, response.getBody(), {replace: true});
                return destination;
            } else if(response.statusCode === 404) {
                console.error('Could not find '+ SONAR_RUNNER_DIST + ' on the specified CDN url[' + fullUrl +'].');
            } else {
                console.error('Something went wrong while fetching '+ SONAR_RUNNER_DIST + ' on the specified CDN url[' + fullUrl +'], statusCode [' + response.statusCode + '] was received.');
            }
        } catch (e) {
            console.error('Could not connect to CDN url[' + cdnUrl +'], received message [' + e + ']');
        }
    }
function fetchCdnVersion ( cdnUrl ) { var fullUrl = cdnUrl + path . sep + SONAR_RUNNER_DIST ; console . log ( 'Fetching sonar-runner from CDN url [' + fullUrl + '].' ) ; try { var response = request ( 'GET' , fullUrl ) ; if ( response . statusCode === 200 ) { var destination = path . join ( '.tmp' , SONAR_RUNNER_DIST ) ; fs . mkdirsSync ( '.tmp' , '0775' ) ; fs . writeFileSync ( destination , response . getBody ( ) , { replace : true } ) ; return destination ; } else if ( response . statusCode === 404 ) { console . error ( 'Could not find ' + SONAR_RUNNER_DIST + ' on the specified CDN url[' + fullUrl + '].' ) ; } else { console . error ( 'Something went wrong while fetching ' + SONAR_RUNNER_DIST + ' on the specified CDN url[' + fullUrl + '], statusCode [' + response . statusCode + '] was received.' ) ; } } catch ( e ) { console . error ( 'Could not connect to CDN url[' + cdnUrl + '], received message [' + e + ']' ) ; } }
Fetch the cdn release of sonar-runner from nexus.
@param cdnDir The cdn url.
@return destination The location where the cdn sonar-runner is copied to.
Fetch the cdn release of sonar - runner from nexus .