当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript nconf.get函数代码示例

本文整理汇总了TypeScript中nconf.get函数的典型用法代码示例。如果您正苦于以下问题:TypeScript get函数的具体用法?TypeScript get怎么用?TypeScript get使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: it

        it('should be able to download jenkins artifact as zip', function (done) {
            this.timeout(15000);
            let processor = new engine.ArtifactEngine();

            let processorOptions = new engine.ArtifactEngineOptions();
            processorOptions.itemPattern = "**";
            processorOptions.parallelProcessingLimit = 8;
            processorOptions.retryIntervalInSeconds = 2;
            processorOptions.retryLimit = 2;
            processorOptions.verbose = true;

            var itemsUrl = "http://rmcdpjenkins2.southindia.cloudapp.azure.com:8080/job/ReleaseManagement/job/RMCDP/job/ArtifactEngineTests/job/SmallProject/10/artifact/*zip*/";
            var handler = new BasicCredentialHandler(nconf.get('JENKINS:USERNAME'), nconf.get('JENKINS:PASSWORD')  || tl.getVariable('JENKINS:PASSWORD'));
            var zipProvider = new providers.ZipProvider(itemsUrl, handler, { ignoreSslError: false });
            var dropLocation = path.join(nconf.get('DROPLOCATION'), "jenkinsDropWithMultipleFiles.zip");
            var filesystemProvider = new providers.FilesystemProvider(dropLocation);

            processor.processItems(zipProvider, filesystemProvider, processorOptions)
                .then((tickets) => {
                    fs.existsSync(path.join(nconf.get('DROPLOCATION'), 'jenkinsDropWithMultipleFiles.zip'));
                    assert.equal(tickets.find(x => x.artifactItem.path == "").retryCount, 0);
                    assert.notEqual(tickets.find(x => x.artifactItem.path == "").fileSizeInBytes, 0);
                    done();
                }, (error) => {
                    throw error;
                });
        });
开发者ID:Microsoft,项目名称:vsts-rm-extensions,代码行数:27,代码来源:jenkins.e2e.ts

示例2: it

        it('should be able to download jenkins artifact with large volume of files', function (done) {
            this.timeout(1800000);  //30mins
            let processor = new engine.ArtifactEngine();

            let processorOptions = new engine.ArtifactEngineOptions();
            processorOptions.itemPattern = "**";
            processorOptions.parallelProcessingLimit = 8;
            processorOptions.retryIntervalInSeconds = 2;
            processorOptions.retryLimit = 4;
            processorOptions.verbose = true;

            var itemsUrl = "http://rmcdpjenkins2.southindia.cloudapp.azure.com:8080/job/ReleaseManagement/job/RMCDP/job/ArtifactEngineTests/job/LargeVolumeProject/6/api/json?tree=artifacts[*]";
            var variables = {
                "endpoint": {
                    "url": "http://rmcdpjenkins2.southindia.cloudapp.azure.com:8080"
                },
                "definition": "ReleaseManagement/job/RMCDP/job/ArtifactEngineTests/job/LargeVolumeProject",
                "version": "6"
            };

            var handler = new BasicCredentialHandler(nconf.get('JENKINS:USERNAME'), nconf.get('JENKINS:PASSWORD'));
            var webProvider = new providers.WebProvider(itemsUrl, "jenkins.handlebars", variables, handler, { ignoreSslError: false });
            var dropLocation = path.join(nconf.get('DROPLOCATION'), "jenkinsDropWithLargeVolumeFiles");
            var filesystemProvider = new providers.FilesystemProvider(dropLocation);

            processor.processItems(webProvider, filesystemProvider, processorOptions)
                .then((tickets) => {
                    let fileTickets = tickets.filter(x => x.artifactItem.itemType == ItemType.File && x.state === TicketState.Processed);
                    assert.equal(fileTickets.length, 20377);
                    assert(getDownloadSizeInMB(fileTickets) > 20);
                    done();
                }, (error) => {
                    throw error;
                });
        });
开发者ID:Microsoft,项目名称:vsts-rm-extensions,代码行数:35,代码来源:jenkins.perf.ts

示例3: start

async function start() {
    const server = new Hapi.Server();

    const env = process.env.NODE_ENV || 'development';
    process.env.NODE_ENV = env; //So the plugins load right
    const configFilePath = path.join(__dirname, "config", env + ".json");
    const userConfigFilePath = path.join(__dirname, "config", env + ".user.json");
    nconf
        .file("user_overrides", userConfigFilePath)
        .file("defaults", configFilePath);

    server.connection({
        host: nconf.get('hapi:host'),
        port: nconf.get('hapi:port')
    });

    const appLogger = new AppLogger();
    server.app.logger = await appLogger.initialize(nconf);

    await Plugin.registerAll(server, nconf);
    await Api.loadRoutes(server);

    await server.start();
    if (server.info !== null) {
        server.app.logger.info(`Server running at ${server.info.uri}`);
    }
}
开发者ID:dangelspencer,项目名称:typed-hapi,代码行数:27,代码来源:index.ts

示例4: it

        it('should be able to download build artifact with large volume of files from vsts drop', function (done) {
            this.timeout(1800000);  //30mins
            let processor = new engine.ArtifactEngine();

            let processorOptions = new engine.ArtifactEngineOptions();
            processorOptions.itemPattern = "**";
            processorOptions.parallelProcessingLimit = 64;
            processorOptions.retryIntervalInSeconds = 2;
            processorOptions.retryLimit = 4;
            processorOptions.verbose = true;

            var itemsUrl = "https://testking123.visualstudio.com/_apis/resources/Containers/1976011?itemPath=files20k&isShallow=false";
            var variables = {};

            var handler = new PersonalAccessTokenCredentialHandler(nconf.get('VSTS:PAT'));
            var webProvider = new providers.WebProvider(itemsUrl, "vsts.handlebars", variables, handler, { ignoreSslError: false });
            var dropLocation = path.join(nconf.get('DROPLOCATION'), "vstsDropWithLargeFiles");
            var filesystemProvider = new providers.FilesystemProvider(dropLocation);

            processor.processItems(webProvider, filesystemProvider, processorOptions)
                .then((tickets) => {
                    let fileTickets = tickets.filter(x => x.artifactItem.itemType == ItemType.File && x.state === TicketState.Processed);
                    assert.equal(fileTickets.length, 20391);
                    assert(getDownloadSizeInMB(fileTickets) > 15);
                    done();
                }, (error) => {
                    throw error;
                });
        });
开发者ID:Microsoft,项目名称:vsts-rm-extensions,代码行数:29,代码来源:vsts.perf.ts

示例5: sendResetMail

 // send it
 (emailContent, user, done) => {
     sendResetMail(
         user.email,                 // to
         nconf.get("mailer").from,   // from
         emailContent,               // what
         nconf.get("mailer").options,// options
         (err) => {
             if (!err)
                 return res.status(200).send({ key: "info_password_change_mail_sent" });
             done(err);
         })
 }
开发者ID:cm0s,项目名称:mea2n,代码行数:13,代码来源:user.api.controller.ts

示例6: runWindowsBasedTest

        runWindowsBasedTest('should be able to download build artifact from fileshare', function (done) {
            this.timeout(15000);
            let processor = new engine.ArtifactEngine();

            let processorOptions = new engine.ArtifactEngineOptions();
            processorOptions.itemPattern = "fileshareWithMultipleFiles\\**";
            processorOptions.parallelProcessingLimit = 8;
            processorOptions.retryIntervalInSeconds = 2;
            processorOptions.retryLimit = 2;
            processorOptions.verbose = true;

            var itemsUrl = "//vscsstor/Users/gykuma/ArtifactEngineTestData/dropz/";
            var variables = {};

            var sourceProvider = new providers.FilesystemProvider(itemsUrl, "fileshareWithMultipleFiles");
            var dropLocation = path.join(nconf.get('DROPLOCATION'));
            var destProvider = new providers.FilesystemProvider(dropLocation);

            processor.processItems(sourceProvider, destProvider, processorOptions)
                .then((tickets) => {
                    fs.readFile(path.join(nconf.get('DROPLOCATION'), 'fileshareWithMultipleFiles/folder1/file2.txt'), 'utf8', function (err, data) {
                        if (err) {
                            throw err;
                        }
                        assert.equal(data, "dummyFolderContent");
                        done();
                    });

                    assert.equal(tickets.find(x => x.artifactItem.path == path.join("fileshareWithMultipleFiles", "file1.pdb")).retryCount, 0);
                    assert.equal(tickets.find(x => x.artifactItem.path == path.join("fileshareWithMultipleFiles", "folder1", "file2.txt")).retryCount, 0);
                }, (error) => {
                    throw error;
                });
        });
开发者ID:Microsoft,项目名称:vsts-rm-extensions,代码行数:34,代码来源:fileshare.e2e.ts

示例7: HandleAsync

    async HandleAsync(request: JoinIdeaRequest): Promise<JoinIdeaResponse> {

        let businessRules = nconf.get("BusinessRules");

        let idea = await this.GetIdea(request.ideaId);

        if (idea.joinedList.length >= businessRules.MaxTeamSize) {
            throw new Error(`This project already has ${businessRules.MaxTeamSize} team members. ` +
                "Please select a different project.");
        }

        let ideas = await this.GetIdeasThatUserAlreadyJoined(request.user);
        ideas.map(async (idea) => {
            await this.UnJoinIdea(idea.id, request.user);
        });

        var index = _.findIndex(idea.joinedList, item => item.id === request.user.id);
        if (index < 0) {
            idea.joinedList.push({
                id: request.user.id,
                name: request.user.displayName,
                login: request.user.username
            });
        }

        await this.UpsertIdea(idea, request.user);

        return new JoinIdeaResponse();
    }
开发者ID:hakant,项目名称:HackathonPlannerAPI,代码行数:29,代码来源:JoinIdea.ts

示例8: loadConfiguration

export function loadConfiguration() {
    nconf.file({
        file: fileName
    });

    const gpioConfigs = nconf.get('gpio');
    const mockGpio = nconf.get('mock_gpio');

    console.log('reading gpio configs, useMock:' + mockGpio);
    console.log(JSON.stringify(gpioConfigs, null, 4));

    return {
        useMock: mockGpio,
        configs: validateGpioConfigurations(gpioConfigs)
    };
}
开发者ID:kaga,项目名称:Home-Sensor,代码行数:16,代码来源:configurationManager.ts

示例9: run

async function run() {
    // Load configuration
    nconf.argv()
        .env({ separator: "_" })
        .file("user", { file: process.env.SMU_CONFIG || "/etc/smu.yml", format: nconfYaml })
        .file("defaults", { file: join(__dirname, "../conf/defaults.yml"), format: nconfYaml });

    const config = nconf.get(null);

    // Initialize Hapi
    const server = promisify(new hapi.Server());
    server.connection(config.server);

    // init server
    try {
        await server.register(plugins);
        setupAuthentication(server, config.authentication);
        setupCommands(server, config.commands);
        await server.start();
    } catch (err) {
        server.log(["error"], "Error starting server: " + err);
        process.exit(1);
    }
    server.log(["info"], `Server running at: ${server.info.uri}`);
}
开发者ID:msurdi,项目名称:smu,代码行数:25,代码来源:index.ts


注:本文中的nconf.get函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。