const scanner = require('sonarqube-scanner');

const apiKey = process.env.bamboo_sonarqube_api_token_secret;

console.log('Running with api key for sonar: ', apiKey);

scanner(
    {
        serverUrl: 'https://sonarqube.iqser.com',
        token: apiKey,
        options: {
            'sonar.projectKey': 'RED_ui',
            'sonar.sources': 'apps/red-ui,libs/common-ui',
        },
    },
    () => process.exit(),
);
