Beispiel #1
0
        public void Execute()
        {
            var publisher = new PublishingWebService(output,
                                                     webServiceRootUrl,
                                                     webServiceControllerPath,
                                                     webServiceLogin,
                                                     webServicePassword);
            var slacker = new SlackService(output, slackIntegrationSubUrl);

            var binDir = new DirectoryInfo(packageBinPath);

            var targetVersionDatFile = new FileInfo(Path.Combine(binDir.FullName, "version.dat"));

            File.WriteAllText(targetVersionDatFile.FullName, version.ConvertIntoVersionDatContents());

            var zipper  = new FastZip();
            var zipFile = new FileInfo(Path.Combine(tempDir, string.Format("{0}.zip", BuildFileName())));

            zipper.CreateZip(zipFile.FullName, binDir.FullName, true, null);

            RetryManager.AutoRetry(() => publisher.Publish(zipFile, version.BuildCode, version.BuildNumber));
            output.Write("Publishing operation completed.");

            RetryManager.AutoRetry(
                () => slacker.SendMessage(string.Format("Published {0} to {1}", BuildFileName(), webServiceRootUrl)));
        }
Beispiel #2
0
        static void RetryTest()
        {
            int    count  = 0;
            Action action = () =>
            {
                count++;
                throw new Exception("123");
            };

            RetryManager.AutoRetry(action);
        }