예제 #1
0
        public async Task RunAsync(CancellationToken token)
        {
            var photonVars = Context.ServerVariables["photon"];

            if (photonVars == null)
            {
                throw new ApplicationException("Photon Variables were not found!");
            }

            nugetPackageDir = Path.Combine(Context.WorkDirectory, "Packages");
            var nugetApiKey = Context.ServerVariables["global"]["nuget/apiKey"];

            apiUrl  = photonVars["apiUrl"];
            ftpUrl  = photonVars["ftp/url"];
            ftpUser = photonVars["ftp/user"];
            ftpPass = photonVars["ftp/pass"];

            msbuild = new MSBuildCommand(Context)
            {
                Exe = Context.AgentVariables["global"]["msbuild_exe"],
                WorkingDirectory = Context.ContentDirectory,
            };

            await BuildSolution(token);

            nugetCore = new NuGetCore(Context)
            {
                ApiKey = nugetApiKey,
            };
            nugetCore.Initialize();

            nugetCmd = new NuGetCommand(Context)
            {
                Exe = Path.Combine(Context.ContentDirectory, "bin", "NuGet.exe"), //Context.AgentVariables["global"]["nuget_exe"];
                WorkingDirectory = Context.ContentDirectory,
            };

            await Task.WhenAll(
                PublishServer(token),
                PublishAgent(token),
                PublishCLI(token));

            PathEx.CreatePath(nugetPackageDir);

            var projectPath      = Path.Combine(Context.ContentDirectory, "Photon.Framework");
            var assemblyFilename = Path.Combine(projectPath, "bin", "Release", "Photon.Framework.dll");

            frameworkVersion = AssemblyTools.GetVersion(assemblyFilename);

            await PublishFrameworkPackage(token);
            await PublishPluginPackage("Photon.MSBuild", token);
            await PublishPluginPackage("Photon.WindowsServices", token);
            await PublishPluginPackage("Photon.Config", token);
            await PublishPluginPackage("Photon.NuGet", token);
            await PublishPluginPackage("Photon.NuGet.Core", token);
            await PublishPluginPackage("Photon.IIS", token);
            await PublishPluginPackage("Photon.NUnit", token);
            await PublishPluginPackage("Photon.DotNet", token);
        }
예제 #2
0
        public async Task RunAsync(CancellationToken token)
        {
            nugetCore = new NuGetCore(Context)
            {
                ApiKey = Context.ServerVariables["global"]["nuget/apiKey"],
            };
            nugetCore.Initialize();

            var packageDir = Path.Combine(Context.BinDirectory, "PublishPackage");

            var packageFilename = Directory
                                  .GetFiles(packageDir, "jenkinsnet.*.nupkg")
                                  .FirstOrDefault();

            if (string.IsNullOrEmpty(packageFilename))
            {
                throw new ApplicationException("No package found matching package ID 'jenkinsnet'!");
            }

            await nugetCore.PushAsync(packageFilename, token);
        }
예제 #3
0
        public async Task RunAsync(CancellationToken token)
        {
            var photonVars = Context.ServerVariables["photon"];

            if (photonVars == null)
            {
                throw new ApplicationException("Photon Variables were not found!");
            }

            nugetPackageDir = Path.Combine(Context.WorkDirectory, "Packages");
            nugetApiKey     = Context.ServerVariables.Global["nuget.apiKey"];
            nugetExe        = Context.AgentVariables.Global["nuget.exe"];
            apiUrl          = photonVars["apiUrl"];
            ftpUrl          = photonVars["ftp.url"];
            ftpUser         = photonVars["ftp.user"];
            ftpPass         = photonVars["ftp.pass"];

            nugetClient = new NuGetCore {
                EnableV3 = true,
                Output   = Context.Output,
                ApiKey   = nugetApiKey,
            };
            nugetClient.Initialize();

            await BuildSolution();
            await PublishServer();
            await PublishAgent();
            await PublishCLI();

            if (!Directory.Exists(nugetPackageDir))
            {
                Directory.CreateDirectory(nugetPackageDir);
            }

            await PublishFrameworkPackage(token);
            await PublishPluginPackage("Photon.IIS", token);
            await PublishPluginPackage("Photon.NuGet", token);
            await PublishPluginPackage("Photon.WindowsServices", token);
            await PublishPluginPackage("Photon.Config", token);
        }