Example #1
0
        public static void ConfigureTfsEnvironment(ICakeContext ctx, TaskConfig cfg)
        {
            IAzurePipelinesProvider azurePipelines = ctx.AzurePipelines();

            ctx.LogInfo(azurePipelines.Dump());

            //if (!azurePipelines.IsRunningOnAzurePipelines || !azurePipelines.IsRunningOnAzurePipelinesHosted)
            //    throw new TaskConfigException("Not running in Azure Pipelines");

            EnvConfig env = cfg.Load <EnvConfig>();

            env.IsCi = true;

            // If the build number is configured as an integer, use it. Otherwise use the build ID.
            // Basically, we need something unique.
            env.Version.BuildNumber = azurePipelines.Environment.Build.Number;
        }