[tarantino] r164 committed - - Reworked console application to work with new package downloader ...

1 view
Skip to first unread message

codesite...@google.com

unread,
Jan 8, 2011, 2:44:17 PM1/8/11
to tarantino...@googlegroups.com
Revision: 164
Author: kwhurwitz
Date: Sat Jan 8 11:43:27 2011
Log: - Reworked console application to work with new package downloader
- Renamed Revision to Version everywhere
http://code.google.com/p/tarantino/source/detail?r=164

Added:
/trunk/src/Tarantino.Deployer.Core/Services/IVersionCertifier.cs
/trunk/src/Tarantino.Deployer.Core/Services/IVersionNumberParser.cs
/trunk/src/Tarantino.Deployer.Core/Services/Impl/VersionCertifier.cs
/trunk/src/Tarantino.Deployer.Core/Services/Impl/VersionNumberParser.cs
/trunk/src/Tarantino.Deployer.Infrastructure/PackageDownloader.cs

/trunk/src/Tarantino.Deployer.UnitTests/Core/Services/VersionCertifierTester.cs

/trunk/src/Tarantino.Deployer.UnitTests/Core/Services/VersionNumberParserTester.cs
Deleted:
/trunk/src/Tarantino.Deployer/Deploy.bat
/trunk/src/Tarantino.Deployer/Deployer.build
/trunk/src/Tarantino.Deployer/PackageDownloader.cs
/trunk/src/Tarantino.Deployer.Core/Services/IRevisionCertifier.cs
/trunk/src/Tarantino.Deployer.Core/Services/IRevisionNumberParser.cs
/trunk/src/Tarantino.Deployer.Core/Services/Impl/RevisionCertifier.cs
/trunk/src/Tarantino.Deployer.Core/Services/Impl/RevisionNumberParser.cs

/trunk/src/Tarantino.Deployer.UnitTests/Core/Services/RevisionCertifierTester.cs

/trunk/src/Tarantino.Deployer.UnitTests/Core/Services/RevisionNumberParserTester.cs
Modified:
/trunk/src/BatchJobs.Console/Properties/AssemblyInfo.cs
/trunk/src/BatchJobs.Core/Properties/AssemblyInfo.cs
/trunk/src/BatchJobs.UnitTests/Properties/AssemblyInfo.cs
/trunk/src/Tarantino.DatabaseManager.Console/Properties/AssemblyInfo.cs
/trunk/src/Tarantino.DatabaseManager.Core/Properties/AssemblyInfo.cs
/trunk/src/Tarantino.DatabaseManager.UnitTests/Properties/AssemblyInfo.cs
/trunk/src/Tarantino.Deployer/DeployPackage.Designer.cs
/trunk/src/Tarantino.Deployer/DeployPackage.cs
/trunk/src/Tarantino.Deployer/DeployPackage.resx
/trunk/src/Tarantino.Deployer/Tarantino.Deployer.csproj
/trunk/src/Tarantino.Deployer.Console/Program.cs
/trunk/src/Tarantino.Deployer.Console/Properties/AssemblyInfo.cs
/trunk/src/Tarantino.Deployer.Core/Model/Deployment.cs
/trunk/src/Tarantino.Deployer.Core/Properties/AssemblyInfo.cs
/trunk/src/Tarantino.Deployer.Core/Services/IDeploymentFactory.cs
/trunk/src/Tarantino.Deployer.Core/Services/IDeploymentRecorder.cs
/trunk/src/Tarantino.Deployer.Core/Services/Impl/DeploymentFactory.cs
/trunk/src/Tarantino.Deployer.Core/Services/Impl/DeploymentRecorder.cs

/trunk/src/Tarantino.Deployer.Core/Services/UI/IDeploymentSelectionValidator.cs
/trunk/src/Tarantino.Deployer.Core/Services/UI/ILabelTextGenerator.cs
/trunk/src/Tarantino.Deployer.Core/Services/UI/Impl/DeploymentRowFactory.cs

/trunk/src/Tarantino.Deployer.Core/Services/UI/Impl/DeploymentSelectionValidator.cs
/trunk/src/Tarantino.Deployer.Core/Services/UI/Impl/LabelTextGenerator.cs
/trunk/src/Tarantino.Deployer.Core/Tarantino.Deployer.Core.csproj
/trunk/src/Tarantino.Deployer.Database/Update/001_CreateDeploymentTable.sql

/trunk/src/Tarantino.Deployer.Infrastructure/DataAccess/Mappings/Deployment.hbm.xml
/trunk/src/Tarantino.Deployer.Infrastructure/Properties/AssemblyInfo.cs

/trunk/src/Tarantino.Deployer.Infrastructure/Tarantino.Deployer.Infrastructure.csproj

/trunk/src/Tarantino.Deployer.IntegrationTests/Infrastructure/DataAccess/Mappings/DeploymentMappingsTester.cs

/trunk/src/Tarantino.Deployer.IntegrationTests/Infrastructure/DataAccess/Repositories/DeploymentRepositoryTester.cs
/trunk/src/Tarantino.Deployer.IntegrationTests/Properties/AssemblyInfo.cs

/trunk/src/Tarantino.Deployer.UnitTests/Core/Services/DeploymentFactoryTester.cs

/trunk/src/Tarantino.Deployer.UnitTests/Core/Services/DeploymentRecorderTester.cs

/trunk/src/Tarantino.Deployer.UnitTests/Core/Services/UI/DeploymentRowFactoryTester.cs

/trunk/src/Tarantino.Deployer.UnitTests/Core/Services/UI/DeploymentSelectionValidatorTester.cs
/trunk/src/Tarantino.Deployer.UnitTests/Properties/AssemblyInfo.cs
/trunk/src/Tarantino.Deployer.UnitTests/Tarantino.Deployer.UnitTests.csproj
/trunk/src/Tarantino.WebManagement/properties/AssemblyInfo.cs

=======================================
--- /dev/null
+++ /trunk/src/Tarantino.Deployer.Core/Services/IVersionCertifier.cs Sat
Jan 8 11:43:27 2011
@@ -0,0 +1,9 @@
+using Tarantino.Deployer.Core.Model;
+
+namespace Tarantino.Deployer.Core.Services
+{
+ public interface IVersionCertifier
+ {
+ void Certify(Deployment deployment);
+ }
+}
=======================================
--- /dev/null
+++ /trunk/src/Tarantino.Deployer.Core/Services/IVersionNumberParser.cs Sat
Jan 8 11:43:27 2011
@@ -0,0 +1,7 @@
+namespace Tarantino.Deployer.Core.Services
+{
+ public interface IVersionNumberParser
+ {
+ int Parse(string output);
+ }
+}
=======================================
--- /dev/null
+++ /trunk/src/Tarantino.Deployer.Core/Services/Impl/VersionCertifier.cs
Sat Jan 8 11:43:27 2011
@@ -0,0 +1,31 @@
+using Tarantino.Core.Commons.Services.Environment;
+using Tarantino.Core.Commons.Services.Security;
+using Tarantino.Deployer.Core.Model;
+
+namespace Tarantino.Deployer.Core.Services.Impl
+{
+ public class VersionCertifier : IVersionCertifier
+ {
+ private readonly ISystemClock _clock;
+ private readonly ISecurityContext _securityContext;
+ private readonly IDeploymentRepository _repository;
+
+ public VersionCertifier(ISystemClock clock, ISecurityContext
securityContext, IDeploymentRepository repository)
+ {
+ _clock = clock;
+ _securityContext = securityContext;
+ _repository = repository;
+ }
+
+ public void Certify(Deployment deployment)
+ {
+ if (deployment != null)
+ {
+ deployment.CertifiedBy = _securityContext.GetCurrentUsername();
+ deployment.CertifiedOn = _clock.GetCurrentDateTime();
+
+ _repository.Save(deployment);
+ }
+ }
+ }
+}
=======================================
--- /dev/null
+++ /trunk/src/Tarantino.Deployer.Core/Services/Impl/VersionNumberParser.cs
Sat Jan 8 11:43:27 2011
@@ -0,0 +1,35 @@
+using System;
+
+namespace Tarantino.Deployer.Core.Services.Impl
+{
+ public class VersionNumberParser : IVersionNumberParser
+ {
+ private const string _searchString = "Working Version Number: ";
+
+ public int Parse(string output)
+ {
+ int position = output.IndexOf(_searchString) + _searchString.Length;
+
+ if (position < _searchString.Length)
+ {
+ throw new ApplicationException("The term 'Working Version Number:' was
not found in the build output. Could not determine the version number or
record deployment occurence!");
+ }
+
+ string versionNumberString = string.Empty;
+ while (getChar(output, position) != " " && getChar(output,
position) != "\n")
+ {
+ versionNumberString += output.Substring(position, 1);
+ position++;
+ }
+
+ int versionNumber = int.Parse(versionNumberString);
+
+ return versionNumber;
+ }
+
+ private string getChar(string output, int position)
+ {
+ return output.Substring(position, 1);
+ }
+ }
+}
=======================================
--- /dev/null
+++ /trunk/src/Tarantino.Deployer.Infrastructure/PackageDownloader.cs Sat
Jan 8 11:43:27 2011
@@ -0,0 +1,101 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Net;
+using System.Xml;
+using Ionic.Zip;
+
+namespace Tarantino.Deployer.Infrastructure
+{
+ public class ExtractResult
+ {
+ public string Version { get; set; }
+ public string Executable { get; set; }
+ public string WorkingDirectory { get; set; }
+ }
+
+ public class PackageDownloader
+ {
+ public static ExtractResult DownloadAndExtract(string application,
string environment, string version, string downloadUrl, string zipFile,
string username, string password)
+ {
+ if (string.IsNullOrEmpty(version))
+ {
+ version = GetLatestVersion(username, password, downloadUrl);
+ }
+
+ var baseDirectory = AppDomain.CurrentDomain.BaseDirectory;
+ var applicationDirectory = baseDirectory + @"packages\" + application;
+ var versionDirectory = applicationDirectory + @"\" + version;
+
+ if (!Directory.Exists(versionDirectory))
+ {
+ var fullZipFile = baseDirectory + @"/" + zipFile + ".zip";
+ File.Delete(fullZipFile);
+
+ var client = new WebClient
+ {
+ Credentials = new NetworkCredential(username, password)
+ };
+
+ client.DownloadFile(downloadUrl + "/" + version + "/" + zipFile
+ ".zip", fullZipFile);
+
+ Directory.CreateDirectory(applicationDirectory);
+
+ try
+ {
+ Directory.Delete(versionDirectory, true);
+ }
+ catch (DirectoryNotFoundException) { }
+
+ Directory.CreateDirectory(versionDirectory);
+
+ using (var zip = ZipFile.Read(fullZipFile))
+ {
+ foreach (var entry in zip)
+ {
+ entry.Extract(versionDirectory,
ExtractExistingFileAction.OverwriteSilently);
+ }
+ }
+ }
+
+ var environmentDeploymentBat = versionDirectory + @"\" + environment
+ ".bat";
+
+ var result = new ExtractResult { Version = version, Executable =
environmentDeploymentBat, WorkingDirectory = versionDirectory };
+ return result;
+ }
+
+ private static string GetLatestVersion(string username, string password,
string downloadUrl)
+ {
+ var client = new WebClient
+ {
+ Credentials = new NetworkCredential(username, password)
+ };
+
+ var html = client.DownloadString(downloadUrl);
+ var xhtml = html.Replace("<br>", "<br />");
+
+ var document = new XmlDocument();
+ document.LoadXml(xhtml);
+
+ var anchors = document.GetElementsByTagName("a");
+
+ var filteredUrls = new List<string>();
+
+ foreach (XmlNode anchor in anchors)
+ {
+ if (!anchor.InnerText.Contains(".tcbuildid")
&& !anchor.InnerText.Contains("latest.lastFinished")
&& !anchor.InnerText.Contains("latest.lastSuccessful"))
+ {
+ var urlWithVersion = anchor.InnerText;
+ var urlParts = urlWithVersion.Split('/');
+
+ var version = urlParts[urlParts.Length - 1];
+ filteredUrls.Add(version);
+ }
+ }
+
+ return filteredUrls[0];
+ }
+
+
+ }
+}
=======================================
--- /dev/null
+++
/trunk/src/Tarantino.Deployer.UnitTests/Core/Services/VersionCertifierTester.cs
Sat Jan 8 11:43:27 2011
@@ -0,0 +1,52 @@
+using System;
+using Tarantino.Deployer.Core.Model;
+using Tarantino.Deployer.Core.Services;
+using Tarantino.Deployer.Core.Services.Impl;
+using Tarantino.Core.Commons.Services.Environment;
+using Tarantino.Core.Commons.Services.Security;
+using NUnit.Framework;
+using NUnit.Framework.SyntaxHelpers;
+using Rhino.Mocks;
+
+namespace Tarantino.Deployer.UnitTests.Core.Services
+{
+ [TestFixture]
+ public class VersionCertifierTester
+ {
+ [Test]
+ public void Certifies_deployment()
+ {
+ var deployment = new Deployment();
+
+ var mocks = new MockRepository();
+ var clock = mocks.CreateMock<ISystemClock>();
+ var securityContext = mocks.CreateMock<ISecurityContext>();
+ var repository = mocks.CreateMock<IDeploymentRepository>();
+
+ using (mocks.Record())
+ {
+ Expect.Call(clock.GetCurrentDateTime()).Return(new DateTime(2007, 4,
15));
+ Expect.Call(securityContext.GetCurrentUsername()).Return("khurwitz");
+ repository.Save(deployment);
+ }
+
+ using (mocks.Playback())
+ {
+ IVersionCertifier certifier = new VersionCertifier(clock,
securityContext, repository);
+ certifier.Certify(deployment);
+
+ Assert.That(deployment.CertifiedBy, Is.EqualTo("khurwitz"));
+ Assert.That(deployment.CertifiedOn, Is.EqualTo(new DateTime(2007, 4,
15)));
+ }
+
+ mocks.VerifyAll();
+ }
+
+ [Test]
+ public void Does_not_certify_undefined_deployment()
+ {
+ IVersionCertifier certifier = new VersionCertifier(null, null, null);
+ certifier.Certify(null);
+ }
+ }
+}
=======================================
--- /dev/null
+++
/trunk/src/Tarantino.Deployer.UnitTests/Core/Services/VersionNumberParserTester.cs
Sat Jan 8 11:43:27 2011
@@ -0,0 +1,39 @@
+using System;
+using NUnit.Framework;
+using NUnit.Framework.SyntaxHelpers;
+using Tarantino.Deployer.Core.Services;
+using Tarantino.Deployer.Core.Services.Impl;
+
+namespace Tarantino.Deployer.UnitTests.Core.Services
+{
+ [TestFixture]
+ public class VersionNumberParserTester
+ {
+ [Test]
+ public void Correctly_parses_version_number_using_space_as_delimiter()
+ {
+ IVersionNumberParser versionNumberParser = new VersionNumberParser();
+ int versionNumber = versionNumberParser.Parse("some text Working
Version Number: 1134 more text");
+
+ Assert.That(versionNumber, Is.EqualTo(versionNumber));
+ }
+
+ [Test]
+ public void
Correctly_parses_version_number_using_hard_return_as_delimiter()
+ {
+ IVersionNumberParser versionNumberParser = new VersionNumberParser();
+ int versionNumber = versionNumberParser.Parse("some text Working
Version Number: 1134\n more text");
+
+ Assert.That(versionNumber, Is.EqualTo(versionNumber));
+ }
+
+ [Test, ExpectedException(typeof(ApplicationException), ExpectedMessage
= "The term 'Working Version Number:' was not found in the build output.
Could not determine the version number or record deployment occurence!")]
+ public void
Handles_scenario_where_version_number_not_included_in_build_output()
+ {
+ IVersionNumberParser versionNumberParser = new VersionNumberParser();
+ int versionNumber = versionNumberParser.Parse("some text");
+
+ Assert.That(versionNumber, Is.EqualTo(versionNumber));
+ }
+ }
+}
=======================================
--- /trunk/src/Tarantino.Deployer/Deploy.bat Mon Feb 18 08:50:40 2008
+++ /dev/null
@@ -1,2 +0,0 @@
-NAnt\nant.exe -buildfile:Deployer.build deploy -D:application=%1 -D:url=%2
-D:zip.file=%3 -D:username=%4 -D:password=%5 -D:environment=%6
-D:revision=%7
-pause
=======================================
--- /trunk/src/Tarantino.Deployer/Deployer.build Wed Nov 12 08:54:42 2008
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--EXTERNAL_PROPERTIES:
application;environment;url;zip.file;username;password;revision;-->
-<project name="Deployer" default="deploy"
xmlns="http://nant.sf.net/release/0.85-rc4/nant.xsd">
-
- <target name="deploy">
-
- <property name="defined.revision" value="${revision}" />
-
- <property name="svnArgs" value="--username ${username} --password
${password} --non-interactive --no-auth-cache" />
-
- <if test="${defined.revision==''}">
- <exec program="Subversion/svn.exe" commandline="info ${url} ${svnArgs}
--xml" output="svninfo.xml" append="false" verbose="false"/>
- <xmlpeek file="svninfo.xml" xpath="/info/entry/commit/@revision"
property="defined.revision"/>
- </if>
-
- <echo message="Working Revision Number: ${defined.revision}" />
-
- <property name="revision.dir"
value="packages/${application}/${defined.revision}" />
-
- <if test="${not directory::exists(revision.dir)}">
- <delete dir="Application" failonerror="false" />
- <exec program="Subversion/svn.exe" workingdir="." commandline="checkout
${svnArgs} ${url}@${defined.revision} Application" verbose="true" />
-
- <mkdir dir="packages/${application}" />
-
- <delete dir="${revision.dir}" failonerror="false" />
-
- <unzip zipfile="Application/${zip.file}.zip" todir="${revision.dir}" />
- </if>
-
- <exec program="${revision.dir}/${environment}.bat"
workingdir="${revision.dir}" verbose="true" />
- </target>
-
-</project>
=======================================
--- /trunk/src/Tarantino.Deployer/PackageDownloader.cs Sat Jan 8 05:21:14
2011
+++ /dev/null
@@ -1,101 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Net;
-using System.Xml;
-using Ionic.Zip;
-
-namespace Tarantino.Deployer
-{
- public class ExtractResult
- {
- public string Version { get; set; }
- public string Executable { get; set; }
- public string WorkingDirectory { get; set; }
- }
-
- public class PackageDownloader
- {
- public static ExtractResult DownloadAndExtract(string application,
string environment, string version, string downloadUrl, string zipFile,
string username, string password)
- {
- if (string.IsNullOrEmpty(version))
- {
- version = GetLatestVersion(username, password, downloadUrl);
- }
-
- var baseDirectory = AppDomain.CurrentDomain.BaseDirectory;
- var applicationDirectory = baseDirectory + @"packages\" + application;
- var revisionDirectory = applicationDirectory + @"\" + version;
-
- if (!Directory.Exists(revisionDirectory))
- {
- var fullZipFile = baseDirectory + @"/" + zipFile + ".zip";
- File.Delete(fullZipFile);
-
- var client = new WebClient
- {
- Credentials = new NetworkCredential(username, password)
- };
-
- client.DownloadFile(downloadUrl + "/" + version + "/" + zipFile
+ ".zip", fullZipFile);
-
- Directory.CreateDirectory(applicationDirectory);
-
- try
- {
- Directory.Delete(revisionDirectory, true);
- }
- catch (DirectoryNotFoundException) { }
-
- Directory.CreateDirectory(revisionDirectory);
-
- using (var zip = ZipFile.Read(fullZipFile))
- {
- foreach (var entry in zip)
- {
- entry.Extract(revisionDirectory,
ExtractExistingFileAction.OverwriteSilently);
- }
- }
- }
-
- var environmentDeploymentBat = revisionDirectory + @"\" + environment
+ ".bat";
-
- var result = new ExtractResult { Version = version, Executable =
environmentDeploymentBat, WorkingDirectory = revisionDirectory };
- return result;
- }
-
- private static string GetLatestVersion(string username, string password,
string downloadUrl)
- {
- var client = new WebClient
- {
- Credentials = new NetworkCredential(username, password)
- };
-
- var html = client.DownloadString(downloadUrl);
- var xhtml = html.Replace("<br>", "<br />");
-
- var document = new XmlDocument();
- document.LoadXml(xhtml);
-
- var anchors = document.GetElementsByTagName("a");
-
- var filteredUrls = new List<string>();
-
- foreach (XmlNode anchor in anchors)
- {
- if (!anchor.InnerText.Contains(".tcbuildid")
&& !anchor.InnerText.Contains("latest.lastFinished")
&& !anchor.InnerText.Contains("latest.lastSuccessful"))
- {
- var urlWithVersion = anchor.InnerText;
- var urlParts = urlWithVersion.Split('/');
-
- var version = urlParts[urlParts.Length - 1];
- filteredUrls.Add(version);
- }
- }
-
- return filteredUrls[0];
- }
-
-
- }
-}
=======================================
--- /trunk/src/Tarantino.Deployer.Core/Services/IRevisionCertifier.cs Tue
Dec 29 12:09:43 2009
+++ /dev/null
@@ -1,11 +0,0 @@
-using Tarantino.Deployer.Core.Model;
-
-
-namespace Tarantino.Deployer.Core.Services
-{
-
- public interface IRevisionCertifier
- {
- void Certify(Deployment deployment);
- }
-}
=======================================
--- /trunk/src/Tarantino.Deployer.Core/Services/IRevisionNumberParser.cs
Tue Dec 29 12:09:43 2009
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-namespace Tarantino.Deployer.Core.Services
-{
-
- public interface IRevisionNumberParser
- {
- int Parse(string output);
- }
-}
=======================================
--- /trunk/src/Tarantino.Deployer.Core/Services/Impl/RevisionCertifier.cs
Tue Dec 29 12:09:43 2009
+++ /dev/null
@@ -1,31 +0,0 @@
-using Tarantino.Core.Commons.Services.Environment;
-using Tarantino.Core.Commons.Services.Security;
-using Tarantino.Deployer.Core.Model;
-
-namespace Tarantino.Deployer.Core.Services.Impl
-{
- public class RevisionCertifier : IRevisionCertifier
- {
- private readonly ISystemClock _clock;
- private readonly ISecurityContext _securityContext;
- private readonly IDeploymentRepository _repository;
-
- public RevisionCertifier(ISystemClock clock, ISecurityContext
securityContext, IDeploymentRepository repository)
- {
- _clock = clock;
- _securityContext = securityContext;
- _repository = repository;
- }
-
- public void Certify(Deployment deployment)
- {
- if (deployment != null)
- {
- deployment.CertifiedBy = _securityContext.GetCurrentUsername();
- deployment.CertifiedOn = _clock.GetCurrentDateTime();
-
- _repository.Save(deployment);
- }
- }
- }
-}
=======================================
---
/trunk/src/Tarantino.Deployer.Core/Services/Impl/RevisionNumberParser.cs
Tue Dec 29 12:09:43 2009
+++ /dev/null
@@ -1,37 +0,0 @@
-using System;
-
-
-namespace Tarantino.Deployer.Core.Services.Impl
-{
-
- public class RevisionNumberParser : IRevisionNumberParser
- {
- private const string _searchString = "Working Revision Number: ";
-
- public int Parse(string output)
- {
- int position = output.IndexOf(_searchString) + _searchString.Length;
-
- if (position < _searchString.Length)
- {
- throw new ApplicationException("The term 'Working Revision Number:'
was not found in the build output. Could not determine the revision number
or record deployment occurence!");
- }
-
- string revisionNumberString = string.Empty;
- while (getChar(output, position) != " " && getChar(output,
position) != "\n")
- {
- revisionNumberString += output.Substring(position, 1);
- position++;
- }
-
- int revisionNumber = int.Parse(revisionNumberString);
-
- return revisionNumber;
- }
-
- private string getChar(string output, int position)
- {
- return output.Substring(position, 1);
- }
- }
-}
=======================================
---
/trunk/src/Tarantino.Deployer.UnitTests/Core/Services/RevisionCertifierTester.cs
Tue Dec 29 12:09:43 2009
+++ /dev/null
@@ -1,52 +0,0 @@
-using System;
-using Tarantino.Deployer.Core.Model;
-using Tarantino.Deployer.Core.Services;
-using Tarantino.Deployer.Core.Services.Impl;
-using Tarantino.Core.Commons.Services.Environment;
-using Tarantino.Core.Commons.Services.Security;
-using NUnit.Framework;
-using NUnit.Framework.SyntaxHelpers;
-using Rhino.Mocks;
-
-namespace Tarantino.Deployer.UnitTests.Core.Services
-{
- [TestFixture]
- public class RevisionCertifierTester
- {
- [Test]
- public void Certifies_deployment()
- {
- var deployment = new Deployment();
-
- var mocks = new MockRepository();
- var clock = mocks.CreateMock<ISystemClock>();
- var securityContext = mocks.CreateMock<ISecurityContext>();
- var repository = mocks.CreateMock<IDeploymentRepository>();
-
- using (mocks.Record())
- {
- Expect.Call(clock.GetCurrentDateTime()).Return(new DateTime(2007, 4,
15));
- Expect.Call(securityContext.GetCurrentUsername()).Return("khurwitz");
- repository.Save(deployment);
- }
-
- using (mocks.Playback())
- {
- IRevisionCertifier certifier = new RevisionCertifier(clock,
securityContext, repository);
- certifier.Certify(deployment);
-
- Assert.That(deployment.CertifiedBy, Is.EqualTo("khurwitz"));
- Assert.That(deployment.CertifiedOn, Is.EqualTo(new DateTime(2007, 4,
15)));
- }
-
- mocks.VerifyAll();
- }
-
- [Test]
- public void Does_not_certify_undefined_deployment()
- {
- IRevisionCertifier certifier = new RevisionCertifier(null, null, null);
- certifier.Certify(null);
- }
- }
-}
=======================================
---
/trunk/src/Tarantino.Deployer.UnitTests/Core/Services/RevisionNumberParserTester.cs
Tue Dec 29 12:09:43 2009
+++ /dev/null
@@ -1,39 +0,0 @@
-using System;
-using Tarantino.Deployer.Core.Services;
-using Tarantino.Deployer.Core.Services.Impl;
-using NUnit.Framework;
-using NUnit.Framework.SyntaxHelpers;
-
-namespace Tarantino.Deployer.UnitTests.Core.Services
-{
- [TestFixture]
- public class RevisionNumberParserTester
- {
- [Test]
- public void Correctly_parses_revision_number_using_space_as_delimiter()
- {
- IRevisionNumberParser revisionNumberParser = new RevisionNumberParser();
- int revisionNumber = revisionNumberParser.Parse("some text Working
Revision Number: 1134 more text");
-
- Assert.That(revisionNumber, Is.EqualTo(revisionNumber));
- }
-
- [Test]
- public void
Correctly_parses_revision_number_using_hard_return_as_delimiter()
- {
- IRevisionNumberParser revisionNumberParser = new RevisionNumberParser();
- int revisionNumber = revisionNumberParser.Parse("some text Working
Revision Number: 1134\n more text");
-
- Assert.That(revisionNumber, Is.EqualTo(revisionNumber));
- }
-
- [Test, ExpectedException(typeof(ApplicationException), ExpectedMessage
= "The term 'Working Revision Number:' was not found in the build output.
Could not determine the revision number or record deployment occurence!")]
- public void
Handles_scenario_where_revision_number_not_included_in_build_output()
- {
- IRevisionNumberParser revisionNumberParser = new RevisionNumberParser();
- int revisionNumber = revisionNumberParser.Parse("some text");
-
- Assert.That(revisionNumber, Is.EqualTo(revisionNumber));
- }
- }
-}
=======================================
--- /trunk/src/BatchJobs.Console/Properties/AssemblyInfo.cs Wed Dec 9
12:00:36 2009
+++ /trunk/src/BatchJobs.Console/Properties/AssemblyInfo.cs Sat Jan 8
11:43:27 2011
@@ -1,10 +1,6 @@
using System.Reflection;
using System.Runtime.InteropServices;

-// General Information about an assembly is controlled through the
following
-// set of attributes. Change these attribute values to modify the
information
-// associated with an assembly.
-
[assembly: AssemblyTitle("BatchJobs.Console")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
@@ -13,27 +9,7 @@
[assembly: AssemblyCopyright("Copyright © Microsoft 2009")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-
[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is
exposed to COM
-
[assembly: Guid("4495da63-8855-40ea-a6bb-48f38e8364f5")]
-
-// Version information for an assembly consists of the following four
values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and
Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
=======================================
--- /trunk/src/BatchJobs.Core/Properties/AssemblyInfo.cs Wed Dec 9
12:00:36 2009
+++ /trunk/src/BatchJobs.Core/Properties/AssemblyInfo.cs Sat Jan 8
11:43:27 2011
@@ -1,10 +1,6 @@
using System.Reflection;
using System.Runtime.InteropServices;

-// General Information about an assembly is controlled through the
following
-// set of attributes. Change these attribute values to modify the
information
-// associated with an assembly.
-
[assembly: AssemblyTitle("BatchJobs.Core")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
@@ -13,27 +9,7 @@
[assembly: AssemblyCopyright("Copyright © Microsoft 2009")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-
[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is
exposed to COM
-
[assembly: Guid("13970d68-159f-4911-b924-702dbd485038")]
-
-// Version information for an assembly consists of the following four
values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and
Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
=======================================
--- /trunk/src/BatchJobs.UnitTests/Properties/AssemblyInfo.cs Wed Dec 9
12:00:36 2009
+++ /trunk/src/BatchJobs.UnitTests/Properties/AssemblyInfo.cs Sat Jan 8
11:43:27 2011
@@ -1,10 +1,6 @@
using System.Reflection;
using System.Runtime.InteropServices;

-// General Information about an assembly is controlled through the
following
-// set of attributes. Change these attribute values to modify the
information
-// associated with an assembly.
-
[assembly: AssemblyTitle("BatchJobs.UnitTests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
@@ -13,27 +9,7 @@
[assembly: AssemblyCopyright("Copyright © Microsoft 2009")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-
[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is
exposed to COM
-
[assembly: Guid("f8f6ff4b-8a0a-42e2-b0b2-ffe0d9af0347")]
-
-// Version information for an assembly consists of the following four
values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and
Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
=======================================
--- /trunk/src/Tarantino.DatabaseManager.Console/Properties/AssemblyInfo.cs
Wed Sep 2 08:24:31 2009
+++ /trunk/src/Tarantino.DatabaseManager.Console/Properties/AssemblyInfo.cs
Sat Jan 8 11:43:27 2011
@@ -1,10 +1,6 @@
using System.Reflection;
-using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

-// General Information about an assembly is controlled through the
following
-// set of attributes. Change these attribute values to modify the
information
-// associated with an assembly.
[assembly: AssemblyTitle("Tarantino.DatabaseManager.Console")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
@@ -13,24 +9,7 @@
[assembly: AssemblyCopyright("Copyright © Microsoft 2009")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is
exposed to COM
[assembly: Guid("4b9ce0f2-03c4-479e-a4d9-cda7932fd5cc")]
-
-// Version information for an assembly consists of the following four
values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and
Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
=======================================
--- /trunk/src/Tarantino.DatabaseManager.Core/Properties/AssemblyInfo.cs
Thu Aug 20 13:05:42 2009
+++ /trunk/src/Tarantino.DatabaseManager.Core/Properties/AssemblyInfo.cs
Sat Jan 8 11:43:27 2011
@@ -1,10 +1,6 @@
using System.Reflection;
-using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

-// General Information about an assembly is controlled through the
following
-// set of attributes. Change these attribute values to modify the
information
-// associated with an assembly.
[assembly: AssemblyTitle("Tarantino.DatabaseManager.Core")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
@@ -13,24 +9,7 @@
[assembly: AssemblyCopyright("Copyright © Microsoft 2009")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is
exposed to COM
[assembly: Guid("8aaf5380-94ba-45b9-9681-932b880e8ce9")]
-
-// Version information for an assembly consists of the following four
values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and
Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
=======================================
---
/trunk/src/Tarantino.DatabaseManager.UnitTests/Properties/AssemblyInfo.cs
Thu Aug 20 13:05:42 2009
+++
/trunk/src/Tarantino.DatabaseManager.UnitTests/Properties/AssemblyInfo.cs
Sat Jan 8 11:43:27 2011
@@ -1,10 +1,6 @@
using System.Reflection;
-using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

-// General Information about an assembly is controlled through the
following
-// set of attributes. Change these attribute values to modify the
information
-// associated with an assembly.
[assembly: AssemblyTitle("Tarantino.DatabaseManager.UnitTests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
@@ -13,24 +9,7 @@
[assembly: AssemblyCopyright("Copyright © Microsoft 2009")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is
exposed to COM
[assembly: Guid("23ccc145-2159-4687-8e7c-79abcfec944a")]
-
-// Version information for an assembly consists of the following four
values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and
Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
=======================================
--- /trunk/src/Tarantino.Deployer/DeployPackage.Designer.cs Sat Jan 8
05:21:14 2011
+++ /trunk/src/Tarantino.Deployer/DeployPackage.Designer.cs Sat Jan 8
11:43:27 2011
@@ -34,8 +34,8 @@
this.cboApplication = new System.Windows.Forms.ComboBox();
this.cboEnvironment = new System.Windows.Forms.ComboBox();
this.lblEnvironment = new System.Windows.Forms.Label();
- this.lblRevision = new System.Windows.Forms.Label();
- this.cboRevision = new System.Windows.Forms.ComboBox();
+ this.lblVersion = new System.Windows.Forms.Label();
+ this.cboVersion = new System.Windows.Forms.ComboBox();
this.lblDeployedLabel = new System.Windows.Forms.Label();
this.lblDeployed = new System.Windows.Forms.Label();
this.tabMenu = new System.Windows.Forms.TabControl();
@@ -47,12 +47,12 @@
this.lblCertified = new System.Windows.Forms.Label();
this.lblCertifiedLabel = new System.Windows.Forms.Label();
this.tabCertify = new System.Windows.Forms.TabPage();
- this.cboCertifyRevision = new System.Windows.Forms.ComboBox();
+ this.cboCertifyVersion = new System.Windows.Forms.ComboBox();
this.btnCertify = new System.Windows.Forms.Button();
- this.lblCertifyRevision = new System.Windows.Forms.Label();
+ this.lblCertifyVersion = new System.Windows.Forms.Label();
this.tabCheckVersion = new System.Windows.Forms.TabPage();
this.grdDeployments = new System.Windows.Forms.DataGridView();
- this.Revision = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.Version = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.DeployedOn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.DeployedBy = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Result = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -118,24 +118,24 @@
this.lblEnvironment.TabIndex = 4;
this.lblEnvironment.Text = "Environment:";
//
- // lblRevision
+ // lblVersion
//
- this.lblRevision.AutoSize = true;
- this.lblRevision.Location = new System.Drawing.Point(17, 66);
- this.lblRevision.Name = "lblRevision";
- this.lblRevision.Size = new System.Drawing.Size(51, 13);
- this.lblRevision.TabIndex = 6;
- this.lblRevision.Text = "Revision:";
+ this.lblVersion.AutoSize = true;
+ this.lblVersion.Location = new System.Drawing.Point(17, 66);
+ this.lblVersion.Name = "lblVersion";
+ this.lblVersion.Size = new System.Drawing.Size(51, 13);
+ this.lblVersion.TabIndex = 6;
+ this.lblVersion.Text = "Version:";
//
- // cboRevision
+ // cboVersion
//
- this.cboRevision.Anchor =
((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top
| System.Windows.Forms.AnchorStyles.Left)
+ this.cboVersion.Anchor =
((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
- this.cboRevision.FormattingEnabled = true;
- this.cboRevision.Location = new System.Drawing.Point(74, 63);
- this.cboRevision.Name = "cboRevision";
- this.cboRevision.Size = new System.Drawing.Size(452, 21);
- this.cboRevision.TabIndex = 18;
+ this.cboVersion.FormattingEnabled = true;
+ this.cboVersion.Location = new System.Drawing.Point(74, 63);
+ this.cboVersion.Name = "cboVersion";
+ this.cboVersion.Size = new System.Drawing.Size(452, 21);
+ this.cboVersion.TabIndex = 18;
//
// lblDeployedLabel
//
@@ -176,11 +176,11 @@
this.tabDeploy.Controls.Add(this.lblUsername);
this.tabDeploy.Controls.Add(this.lblCertified);
this.tabDeploy.Controls.Add(this.lblCertifiedLabel);
- this.tabDeploy.Controls.Add(this.cboRevision);
+ this.tabDeploy.Controls.Add(this.cboVersion);
this.tabDeploy.Controls.Add(this.btnDeploy);
this.tabDeploy.Controls.Add(this.lblDeployed);
this.tabDeploy.Controls.Add(this.lblDeployedLabel);
- this.tabDeploy.Controls.Add(this.lblRevision);
+ this.tabDeploy.Controls.Add(this.lblVersion);
this.tabDeploy.Location = new System.Drawing.Point(4, 22);
this.tabDeploy.Name = "tabDeploy";
this.tabDeploy.Padding = new System.Windows.Forms.Padding(3);
@@ -245,9 +245,9 @@
//
// tabCertify
//
- this.tabCertify.Controls.Add(this.cboCertifyRevision);
+ this.tabCertify.Controls.Add(this.cboCertifyVersion);
this.tabCertify.Controls.Add(this.btnCertify);
- this.tabCertify.Controls.Add(this.lblCertifyRevision);
+ this.tabCertify.Controls.Add(this.lblCertifyVersion);
this.tabCertify.Location = new System.Drawing.Point(4, 22);
this.tabCertify.Name = "tabCertify";
this.tabCertify.Padding = new System.Windows.Forms.Padding(3);
@@ -256,16 +256,16 @@
this.tabCertify.Text = "Certify";
this.tabCertify.UseVisualStyleBackColor = true;
//
- // cboCertifyRevision
+ // cboCertifyVersion
//
- this.cboCertifyRevision.Anchor =
((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top
| System.Windows.Forms.AnchorStyles.Left)
+ this.cboCertifyVersion.Anchor =
((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
- this.cboCertifyRevision.DropDownStyle =
System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.cboCertifyRevision.FormattingEnabled = true;
- this.cboCertifyRevision.Location = new System.Drawing.Point(74, 13);
- this.cboCertifyRevision.Name = "cboCertifyRevision";
- this.cboCertifyRevision.Size = new System.Drawing.Size(452, 21);
- this.cboCertifyRevision.TabIndex = 18;
+ this.cboCertifyVersion.DropDownStyle =
System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.cboCertifyVersion.FormattingEnabled = true;
+ this.cboCertifyVersion.Location = new System.Drawing.Point(74, 13);
+ this.cboCertifyVersion.Name = "cboCertifyVersion";
+ this.cboCertifyVersion.Size = new System.Drawing.Size(452, 21);
+ this.cboCertifyVersion.TabIndex = 18;
//
// btnCertify
//
@@ -278,14 +278,14 @@
this.btnCertify.UseVisualStyleBackColor = true;
this.btnCertify.Click += new System.EventHandler(this.btnCertify_Click);
//
- // lblCertifyRevision
+ // lblCertifyVersion
//
- this.lblCertifyRevision.AutoSize = true;
- this.lblCertifyRevision.Location = new System.Drawing.Point(17, 16);
- this.lblCertifyRevision.Name = "lblCertifyRevision";
- this.lblCertifyRevision.Size = new System.Drawing.Size(51, 13);
- this.lblCertifyRevision.TabIndex = 17;
- this.lblCertifyRevision.Text = "Revision:";
+ this.lblCertifyVersion.AutoSize = true;
+ this.lblCertifyVersion.Location = new System.Drawing.Point(17, 16);
+ this.lblCertifyVersion.Name = "lblCertifyVersion";
+ this.lblCertifyVersion.Size = new System.Drawing.Size(51, 13);
+ this.lblCertifyVersion.TabIndex = 17;
+ this.lblCertifyVersion.Text = "Version:";
//
// tabCheckVersion
//
@@ -307,7 +307,7 @@
this.grdDeployments.AutoSizeColumnsMode =
System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
this.grdDeployments.ColumnHeadersHeightSizeMode =
System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.grdDeployments.Columns.AddRange(new
System.Windows.Forms.DataGridViewColumn[] {
- this.Revision,
+ this.Version,
this.DeployedOn,
this.DeployedBy,
this.Result,
@@ -323,12 +323,12 @@
this.grdDeployments.Size = new System.Drawing.Size(526, 184);
this.grdDeployments.TabIndex = 0;
//
- // Revision
+ // Version
//
- this.Revision.HeaderText = "Revision";
- this.Revision.Name = "Revision";
- this.Revision.ReadOnly = true;
- this.Revision.Width = 73;
+ this.Version.HeaderText = "Version";
+ this.Version.Name = "Version";
+ this.Version.ReadOnly = true;
+ this.Version.Width = 73;
//
// DeployedOn
//
@@ -404,22 +404,22 @@
private System.Windows.Forms.ComboBox cboApplication;
private System.Windows.Forms.ComboBox cboEnvironment;
private System.Windows.Forms.Label lblEnvironment;
- private System.Windows.Forms.Label lblRevision;
- private System.Windows.Forms.ComboBox cboRevision;
+ private System.Windows.Forms.Label lblVersion;
+ private System.Windows.Forms.ComboBox cboVersion;
private System.Windows.Forms.Label lblDeployedLabel;
private System.Windows.Forms.Label lblDeployed;
private System.Windows.Forms.TabControl tabMenu;
private System.Windows.Forms.TabPage tabDeploy;
private System.Windows.Forms.TabPage tabCertify;
- private System.Windows.Forms.ComboBox cboCertifyRevision;
+ private System.Windows.Forms.ComboBox cboCertifyVersion;
private System.Windows.Forms.Button btnCertify;
- private System.Windows.Forms.Label lblCertifyRevision;
+ private System.Windows.Forms.Label lblCertifyVersion;
private System.Windows.Forms.TabPage tabCheckVersion;
private System.Windows.Forms.Label lblCertified;
private System.Windows.Forms.Label lblCertifiedLabel;
private System.Windows.Forms.BindingSource bndDeployments;
private System.Windows.Forms.DataGridView grdDeployments;
- private System.Windows.Forms.DataGridViewTextBoxColumn Revision;
+ private System.Windows.Forms.DataGridViewTextBoxColumn Version;
private System.Windows.Forms.DataGridViewTextBoxColumn DeployedOn;
private System.Windows.Forms.DataGridViewTextBoxColumn DeployedBy;
private System.Windows.Forms.DataGridViewTextBoxColumn Result;
=======================================
--- /trunk/src/Tarantino.Deployer/DeployPackage.cs Sat Jan 8 05:21:14 2011
+++ /trunk/src/Tarantino.Deployer/DeployPackage.cs Sat Jan 8 11:43:27 2011
@@ -27,15 +27,15 @@
populateApplicationDropdown();
}

- private void populateRevisions()
+ private void populateVersions()
{
var repository = ObjectFactory.GetInstance<IDeploymentRepository>();

var certified = repository.FindCertified(SelectedApplication.Name,
SelectedEnvironment.Predecessor);
var uncertified =
repository.FindSuccessfulUncertified(SelectedApplication.Name,
SelectedEnvironment.Name);

- populateRevisionDropdown(certified, cboRevision);
- populateRevisionDropdown(uncertified, cboCertifyRevision);
+ populateVersionDropdown(certified, cboVersion);
+ populateVersionDropdown(uncertified, cboCertifyVersion);

populateDeploymentGrid(repository);
}
@@ -65,24 +65,24 @@

private void btnCertify_Click(object sender, EventArgs e)
{
- var selectedRevision = cboCertifyRevision.SelectedItem as Deployment;
-
- var certifier = ObjectFactory.GetInstance<IRevisionCertifier>();
- certifier.Certify(selectedRevision);
-
- if (selectedRevision != null)
- {
- populateRevisions();
+ var selectedVersion = cboCertifyVersion.SelectedItem as Deployment;
+
+ var certifier = ObjectFactory.GetInstance<IVersionCertifier>();
+ certifier.Certify(selectedVersion);
+
+ if (selectedVersion != null)
+ {
+ populateVersions();
}
else
{
- MessageBox.Show("Please select a revision!");
+ MessageBox.Show("Please select a version!");
}
}

private void btnDeploy_OnClick(object sender, EventArgs e)
{
- var result =
PackageDownloader.DownloadAndExtract(SelectedApplication.Name,
SelectedEnvironment.Name, cboRevision.Text,
+ var result =
PackageDownloader.DownloadAndExtract(SelectedApplication.Name,
SelectedEnvironment.Name, cboVersion.Text,

SelectedApplication.Url, SelectedApplication.ZipFile, txtUsername.Text,

txtPassword.Text);

@@ -128,10 +128,10 @@
var recorder = ObjectFactory.GetInstance<IDeploymentRecorder>();
recorder.RecordDeployment(SelectedApplication.Name,
SelectedEnvironment.Name, output, _version, failed);

- populateRevisions();
+ populateVersions();
}

- private static void populateRevisionDropdown(IEnumerable<Deployment>
deployments, ComboBox combo)
+ private static void populateVersionDropdown(IEnumerable<Deployment>
deployments, ComboBox combo)
{
combo.Text = string.Empty;
combo.DataSource = deployments;
@@ -176,14 +176,14 @@
cboApplication.SelectedIndex = 0;
}

- private void cboRevision_OnTextChanged(object sender, EventArgs e)
- {
- var deployment = cboRevision.SelectedItem as Deployment;
- var revision = cboRevision.Text;
+ private void CboVersionOnTextChanged(object sender, EventArgs e)
+ {
+ var deployment = cboVersion.SelectedItem as Deployment;
+ var version = cboVersion.Text;

var generator = ObjectFactory.GetInstance<ILabelTextGenerator>();
- lblDeployed.Text = generator.GetDeploymentText(SelectedEnvironment,
revision, deployment);
- lblCertified.Text = generator.GetCertificationText(revision,
deployment);
+ lblDeployed.Text = generator.GetDeploymentText(SelectedEnvironment,
version, deployment);
+ lblCertified.Text = generator.GetCertificationText(version, deployment);
}

private void cboApplication_OnSelectedIndexChanged(object sender,
EventArgs e)
@@ -196,14 +196,14 @@

private void cboEnvironment_OnSelectedIndexChanged(object sender,
EventArgs e)
{
- populateRevisions();
+ populateVersions();
}

private void wireEvents()
{
cboApplication.SelectedIndexChanged +=
cboApplication_OnSelectedIndexChanged;
cboEnvironment.SelectedIndexChanged +=
cboEnvironment_OnSelectedIndexChanged;
- cboRevision.TextChanged += cboRevision_OnTextChanged;
+ cboVersion.TextChanged += CboVersionOnTextChanged;
btnDeploy.Click += btnDeploy_OnClick;
grdDeployments.DoubleClick += grdDeployments_OnDoubleClick;
}
=======================================
--- /trunk/src/Tarantino.Deployer/DeployPackage.resx Mon Feb 18 08:50:40
2008
+++ /trunk/src/Tarantino.Deployer/DeployPackage.resx Sat Jan 8 11:43:27
2011
@@ -117,7 +117,7 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
- <metadata name="Revision.UserAddedColumn" type="System.Boolean,
mscorlib, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089">
+ <metadata name="Version.UserAddedColumn" type="System.Boolean, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="DeployedOn.UserAddedColumn" type="System.Boolean,
mscorlib, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089">
@@ -138,7 +138,7 @@
<metadata name="Output.UserAddedColumn" type="System.Boolean, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
- <metadata name="Revision.UserAddedColumn" type="System.Boolean,
mscorlib, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089">
+ <metadata name="Version.UserAddedColumn" type="System.Boolean, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="DeployedOn.UserAddedColumn" type="System.Boolean,
mscorlib, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089">
=======================================
--- /trunk/src/Tarantino.Deployer/Tarantino.Deployer.csproj Sat Jan 8
05:21:14 2011
+++ /trunk/src/Tarantino.Deployer/Tarantino.Deployer.csproj Sat Jan 8
11:43:27 2011
@@ -91,7 +91,6 @@
<Compile Include="DeployPackage.Designer.cs">
<DependentUpon>DeployPackage.cs</DependentUpon>
</Compile>
- <Compile Include="PackageDownloader.cs" />
<Compile Include="ProcessCaller.cs" />
<Compile Include="ProcessProgressForm.cs">
<SubType>Form</SubType>
@@ -122,12 +121,6 @@
<None Include="App.config">
<SubType>Designer</SubType>
</None>
- <None Include="Deploy.bat">
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </None>
- <None Include="Deployer.build">
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </None>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
=======================================
--- /trunk/src/Tarantino.Deployer.Console/Program.cs Sat Jan 8 05:21:14
2011
+++ /trunk/src/Tarantino.Deployer.Console/Program.cs Sat Jan 8 11:43:27
2011
@@ -1,187 +1,162 @@
-//using System.Collections.Generic;
-//using System.IO;
-//using System.Linq;
-//using System.Text;
-//using StructureMap;
-//using Tarantino.Deployer.Core.Model;
-//using Tarantino.Deployer.Core.Services;
-//using Tarantino.Deployer.Core.Services.Configuration;
-//using Tarantino.Deployer.Core.Services.Configuration.Impl;
-//using Tarantino.Deployer.Infrastructure;
-//using Environment=System.Environment;
-//
+using System.IO;
+using System.Linq;
+using System.Text;
+using StructureMap;
+using Tarantino.Deployer.Core.Services;
+using Tarantino.Deployer.Core.Services.Configuration;
+using Tarantino.Deployer.Infrastructure;
+using Environment=System.Environment;
+
namespace Tarantino.Deployer.Console
{
public class Program
{
-// private static readonly StringBuilder _buildOutput = new
StringBuilder();
-//
+ private static readonly StringBuilder _buildOutput = new StringBuilder();
+ private static bool _buildFailed;
+
public static void Main(string[] args)
{
-// DeployerInfrastructureDependencyRegistrar.RegisterInfrastructure();
-//
-// if (args.Length != 4)
-// {
-// OutputUsageAndClose("Supply the correct number of command line
arguments");
-// }
-//
-// string requestedAction = args[0];
-// string requestedApplicationName = args[1];
-// string requestedEnvironment = args[2];
-// string requestedRevision = args[3];
-//
-// var applicationRepository =
ObjectFactory.GetInstance<IApplicationRepository>();
-//
-// Application selectedApplication =
applicationRepository.GetByName(requestedApplicationName);
-//
-// if (selectedApplication == null)
-// {
-// OutputUsageAndClose("Specify an application name included in the
configuration file 'Tarantino.Deployer.Console.exe.config'");
-// }
-//
-// var selectedEnvironment =
selectedApplication.GetEnvironmentByName(requestedEnvironment);
-//
-// if (selectedEnvironment == null)
-// {
-// OutputUsageAndClose(
-// string.Format(
-// "Specify an environment included in the configuration
file 'Tarantino.Deployer.Console.exe.config' for application '{0}'",
-// selectedApplication.Name));
-// }
-//
-// if (requestedAction == "Deploy")
-// {
-// int revisionNumber = int.MinValue;
-//
-// if (requestedRevision == "CurrentCertified")
-// {
-// var repository = ObjectFactory.GetInstance<IDeploymentRepository>();
-// IEnumerable<Deployment> certifiedDeployments =
repository.FindCertified(selectedApplication.Name,
-//

selectedEnvironment.Predecessor);
-//
-// if (certifiedDeployments.Count() > 0)
-// {
-// Deployment lastCertified =
certifiedDeployments.OrderByDescending(d => d.CertifiedOn).ElementAt(0);
-// revisionNumber = lastCertified.Revision;
-// }
-// }
-// else if (requestedRevision != "Current")
-// {
-// bool requestedRevisionIsNumber = int.TryParse(requestedRevision,
out revisionNumber);
-//
-// if (!requestedRevisionIsNumber)
-// {
-// OutputUsageAndClose(
-// "Specify the revision number as
either 'Current', 'CurrentCertified', or a valid Subversion revision
number");
-// }
-// }
-//
-// var arguments = new StringBuilder("-buildfile:Deployer.build");
-// AddArgument(arguments, "application", selectedApplication.Name);
-// AddArgument(arguments, "environment", selectedEnvironment.Name);
-// AddArgument(arguments, "revision", revisionNumber != int.MinValue ?
revisionNumber.ToString() : string.Empty);
-// AddArgument(arguments, "url", selectedApplication.Url);
-// AddArgument(arguments, "zip.file", selectedApplication.ZipFile);
-// AddArgument(arguments, "username", selectedApplication.Username);
-// AddArgument(arguments, "password", selectedApplication.Password);
-//
-// var caller = new SimpleProcessCaller(@"NAnt\nant.exe",
arguments.ToString())
-// {
-// StdOutReceived = Caller_OnStdOutReceived,
-// StdErrorReceived = Caller_OnStdOutReceived
-// };
-//
-// caller.ExecuteProcess();
-// var exitCode = caller.ExitCode;
-//
-// var recorder = ObjectFactory.GetInstance<IDeploymentRecorder>();
-// string revision =
recorder.RecordDeployment(selectedApplication.Name,
selectedEnvironment.Name, _buildOutput.ToString(), "1.0");
-//
-// if (exitCode == 0)
-// {
-// using (var writer = new
StreamWriter("TarantinoDeploymentRevisionNumber.txt"))
-// {
-// writer.Write(revision);
-// }
-// }
-// else
-// {
-// Environment.Exit(1);
-// }
-// }
-// else if (requestedAction == "Certify")
-// {
-// var repository = ObjectFactory.GetInstance<IDeploymentRepository>();
-// IEnumerable<Deployment> uncertifiedDeployments =
repository.FindSuccessfulUncertified(selectedApplication.Name,
selectedEnvironment.Name);
-//
-// int revisionNumber;
-//
-// bool requestedRevisionIsNumber = int.TryParse(requestedRevision, out
revisionNumber);
-//
-// if (!requestedRevisionIsNumber)
-// {
-// OutputUsageAndClose("When certifying a deployment, you must specify
a valid Subversion revision number");
-// }
-//
-// IOrderedEnumerable<Deployment> matchingDeployments =
-// uncertifiedDeployments.Where(d => d.Revision ==
revisionNumber).OrderByDescending(d => d.DeployedOn);
-//
-// if (matchingDeployments.Count() > 0)
-// {
-// Deployment deployment = matchingDeployments.ElementAt(0);
-// var certifier = ObjectFactory.GetInstance<IRevisionCertifier>();
-// certifier.Certify(deployment);
-// }
-// else
-// {
-// OutputUsageAndClose("When certifying a deployment, you must specify
a valid deployment that has not already been certified");
-// }
-// }
-// else
-// {
-// OutputUsageAndClose("Specify either 'Deploy' or 'Certify' for the
<Action> argument");
-// }
-// }
-//
-// private static void Caller_OnStdOutReceived(string output)
-// {
-// System.Console.Out.WriteLine(output);
-// _buildOutput.AppendLine(output);
-// }
-//
-// private static void AddArgument(StringBuilder commandLine, string
argument, string argumentValue)
-// {
-// commandLine.Append(" -D:");
-// commandLine.Append(argument);
-// commandLine.Append("=\"");
-// commandLine.Append(argumentValue);
-// commandLine.Append("\"");
-// }
-//
-// private static void OutputUsageAndClose(string customMessage)
-// {
-// Out("\n\nINVALID USAGE: Incorrect Command Line Arguments Supplied\n");
-// Out("USAGE: Tarantino.Deployer.Console <Action> <Application>
<Environment> <Revision>");
-// Out(" Action = {Deploy, Certify}");
-// Out(" Application = Name of application to deploy");
-// Out(" Environment = Environment to deploy application");
-// Out(" Revision = {Current, CurrentCertified, <Revision Number>}\n");
-// Out("Example 1: Deploy 'PetStore', Revision '4255' to 'Test'
environment");
-// Out(" Tarantino.Deployer.Console Deploy PetStore Test 4255\n");
-// Out("Example 2: Deploy the latest revision of 'PetStore' to 'Test'
environment");
-// Out(" Tarantino.Deployer.Console Deploy PetStore Test Current\n");
-// Out("Example 3: Deploy the latest certified revision of 'PetStore'
to 'Test' environment");
-// Out(" Tarantino.Deployer.Console Deploy PetStore Test
CurrentCertified\n");
-// Out("Example 4: Certify 'PetStore', Revision '4255' in the 'Test'
environment");
-// Out(" Tarantino.Deployer.Console Certify PetStore Test 4255\n\n\n");
-// Out("TO CORRECT: " + customMessage);
-//
-// Environment.Exit(1);
- }
-//
-// private static void Out(string message)
-// {
-// System.Console.Out.WriteLine(message);
-// }
+ DeployerInfrastructureDependencyRegistrar.RegisterInfrastructure();
+
+ if (args.Length != 4)
+ {
+ OutputUsageAndClose("Supply the correct number of command line
arguments");
+ }
+
+ var requestedAction = args[0];
+ var requestedApplicationName = args[1];
+ var requestedEnvironment = args[2];
+ var requestedVersion = args[3];
+
+ var applicationRepository =
ObjectFactory.GetInstance<IApplicationRepository>();
+
+ var selectedApplication =
applicationRepository.GetByName(requestedApplicationName);
+
+ if (selectedApplication == null)
+ {
+ OutputUsageAndClose("Specify an application name included in the
configuration file 'Tarantino.Deployer.Console.exe.config'");
+ }
+
+ if (selectedApplication != null)
+ {
+ var selectedEnvironment =
selectedApplication.GetEnvironmentByName(requestedEnvironment);
+
+ if (selectedEnvironment == null)
+ {
+ OutputUsageAndClose(
+ string.Format(
+ "Specify an environment included in the configuration
file 'Tarantino.Deployer.Console.exe.config' for application '{0}'",
+ selectedApplication.Name));
+ }
+
+ if (selectedEnvironment != null)
+ {
+ if (requestedAction == "Deploy")
+ {
+ string versionNumber = requestedVersion;
+
+ if (requestedVersion == "CurrentCertified")
+ {
+ var repository = ObjectFactory.GetInstance<IDeploymentRepository>();
+ var certifiedDeployments =
repository.FindCertified(selectedApplication.Name,
selectedEnvironment.Predecessor);
+ if (certifiedDeployments.Count() > 0)
+ {
+ var lastCertified = certifiedDeployments.OrderByDescending(d =>
d.CertifiedOn).ElementAt(0);
+ versionNumber = lastCertified.Version;
+ }
+ }
+
+ var result =
PackageDownloader.DownloadAndExtract(selectedApplication.Name,
selectedEnvironment.Name, versionNumber,
+
selectedApplication.Url, selectedApplication.ZipFile,
+
selectedApplication.Username, selectedApplication.Password);
+
+ var caller = new SimpleProcessCaller(result.Executable,
string.Empty, result.WorkingDirectory)
+ {
+ StdOutReceived = Caller_OnStdOutReceived,
+ StdErrorReceived = Caller_OnStdErrorReceived
+ };
+
+ caller.ExecuteProcess();
+ var exitCode = caller.ExitCode;
+
+ var recorder = ObjectFactory.GetInstance<IDeploymentRecorder>();
+ var version = recorder.RecordDeployment(selectedApplication.Name,
selectedEnvironment.Name, _buildOutput.ToString(), result.Version,
_buildFailed);
+
+ if (exitCode == 0)
+ {
+ using (var writer = new
StreamWriter("TarantinoDeploymentVersionNumber.txt"))
+ {
+ writer.Write(version);
+ }
+ }
+ else
+ {
+ Environment.Exit(1);
+ }
+ }
+ else if (requestedAction == "Certify")
+ {
+ var repository = ObjectFactory.GetInstance<IDeploymentRepository>();
+ var uncertifiedDeployments =
repository.FindSuccessfulUncertified(selectedApplication.Name,
selectedEnvironment.Name);
+
+ var deployments = uncertifiedDeployments.Where(d => d.Version ==
requestedVersion).OrderByDescending(d => d.DeployedOn);
+
+ if (deployments.Count() > 0)
+ {
+ var deployment = deployments.ElementAt(0);
+ var certifier = ObjectFactory.GetInstance<IVersionCertifier>();
+ certifier.Certify(deployment);
+ }
+ else
+ {
+ OutputUsageAndClose("When certifying a deployment, you must specify
a valid deployment that has not already been certified");
+ }
+ }
+ else
+ {
+ OutputUsageAndClose("Specify either 'Deploy' or 'Certify' for the
<Action> argument");
+ }
+ }
+ }
+ }
+
+ private static void Caller_OnStdOutReceived(string output)
+ {
+ Out(output);
+ _buildOutput.AppendLine(output);
+ }
+
+ private static void Caller_OnStdErrorReceived(string output)
+ {
+ Out(output);
+ _buildOutput.AppendLine(output);
+ _buildFailed = true;
+ }
+
+ private static void OutputUsageAndClose(string customMessage)
+ {
+ Out("\n\nINVALID USAGE: Incorrect Command Line Arguments Supplied\n");
+ Out("USAGE: Tarantino.Deployer.Console <Action> <Application>
<Environment> <Version>");
+ Out(" Action = {Deploy, Certify}");
+ Out(" Application = Name of application to deploy");
+ Out(" Environment = Environment to deploy application");
+ Out(" Version = {Current, CurrentCertified, <Version Number>}\n");
+ Out("Example 1: Deploy 'PetStore', Version '1.0.4255.0' to 'Test'
environment");
+ Out(" Tarantino.Deployer.Console Deploy PetStore Test 1.0.4255.0\n");
+ Out("Example 2: Deploy the latest version of 'PetStore' to 'Test'
environment");
+ Out(" Tarantino.Deployer.Console Deploy PetStore Test Current\n");
+ Out("Example 3: Deploy the latest certified version of 'PetStore'
to 'Test' environment");
+ Out(" Tarantino.Deployer.Console Deploy PetStore Test
CurrentCertified\n");
+ Out("Example 4: Certify 'PetStore', Version '1.0.4255.0' in the 'Test'
environment");
+ Out(" Tarantino.Deployer.Console Certify PetStore Test
1.0.4255.0\n\n\n");
+ Out("TO CORRECT: " + customMessage);
+
+ Environment.Exit(1);
+ }
+
+ private static void Out(string message)
+ {
+ System.Console.Out.WriteLine(message);
+ }
}
}
=======================================
--- /trunk/src/Tarantino.Deployer.Console/Properties/AssemblyInfo.cs Tue
Jan 6 15:05:52 2009
+++ /trunk/src/Tarantino.Deployer.Console/Properties/AssemblyInfo.cs Sat
Jan 8 11:43:27 2011
@@ -1,10 +1,6 @@
using System.Reflection;
-using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

-// General Information about an assembly is controlled through the
following
-// set of attributes. Change these attribute values to modify the
information
-// associated with an assembly.
[assembly: AssemblyTitle("Tarantino.Deployer.Console")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
@@ -13,24 +9,7 @@
[assembly: AssemblyCopyright("Copyright © 2008")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is
exposed to COM
[assembly: Guid("2f2319c9-050c-4b0b-b704-ad0cca379f0f")]
-
-// Version information for an assembly consists of the following four
values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and
Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
=======================================
--- /trunk/src/Tarantino.Deployer.Core/Model/Deployment.cs Sat Jan 8
05:21:14 2011
+++ /trunk/src/Tarantino.Deployer.Core/Model/Deployment.cs Sat Jan 8
11:43:27 2011
@@ -13,7 +13,7 @@

public virtual string Application { get; set; }
public virtual string Environment { get; set; }
- public virtual string Revision { get; set; }
+ public virtual string Version { get; set; }
public virtual DateTime DeployedOn { get; set; }
public virtual DateTime? CertifiedOn { get; set; }
public virtual string DeployedBy { get; set; }
@@ -23,7 +23,7 @@

public override string ToString()
{
- return Revision.ToString();
+ return Version.ToString();
}

public virtual void SetOutput(DeploymentOutput output)
=======================================
--- /trunk/src/Tarantino.Deployer.Core/Properties/AssemblyInfo.cs Tue Dec
29 12:09:43 2009
+++ /trunk/src/Tarantino.Deployer.Core/Properties/AssemblyInfo.cs Sat Jan
8 11:43:27 2011
@@ -1,10 +1,6 @@
using System.Reflection;
-using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

-// General Information about an assembly is controlled through the
following
-// set of attributes. Change these attribute values to modify the
information
-// associated with an assembly.
[assembly: AssemblyTitle("Tarantino.Deployer.Core")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
@@ -13,24 +9,7 @@
[assembly: AssemblyCopyright("Copyright © Microsoft 2009")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is
exposed to COM
[assembly: Guid("9c5e80c7-0360-45db-add0-da0f0e04fd94")]
-
-// Version information for an assembly consists of the following four
values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and
Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
=======================================
--- /trunk/src/Tarantino.Deployer.Core/Services/IDeploymentFactory.cs Sat
Jan 8 05:21:14 2011
+++ /trunk/src/Tarantino.Deployer.Core/Services/IDeploymentFactory.cs Sat
Jan 8 11:43:27 2011
@@ -5,6 +5,6 @@

public interface IDeploymentFactory
{
- Deployment CreateDeployment(string application, string environment,
string deployedBy, string output, string revision, bool failed);
+ Deployment CreateDeployment(string application, string environment,
string deployedBy, string output, string version, bool failed);
}
}
=======================================
--- /trunk/src/Tarantino.Deployer.Core/Services/IDeploymentRecorder.cs Sat
Jan 8 05:21:14 2011
+++ /trunk/src/Tarantino.Deployer.Core/Services/IDeploymentRecorder.cs Sat
Jan 8 11:43:27 2011
@@ -2,6 +2,6 @@
{
public interface IDeploymentRecorder
{
- string RecordDeployment(string application, string environment, string
output, string revision, bool failed);
+ string RecordDeployment(string application, string environment, string
output, string version, bool failed);
}
}
=======================================
--- /trunk/src/Tarantino.Deployer.Core/Services/Impl/DeploymentFactory.cs
Sat Jan 8 05:21:14 2011
+++ /trunk/src/Tarantino.Deployer.Core/Services/Impl/DeploymentFactory.cs
Sat Jan 8 11:43:27 2011
@@ -14,13 +14,13 @@
_clock = clock;
}

- public Deployment CreateDeployment(string application, string
environment, string deployedBy, string output, string revision, bool failed)
+ public Deployment CreateDeployment(string application, string
environment, string deployedBy, string output, string version, bool failed)
{
var deployment = new Deployment
{
Application = application,
Environment = environment,
- Revision = revision,
+ Version = version,
DeployedBy = deployedBy,
DeployedOn = _clock.GetCurrentDateTime(),
Result = failed ? DeploymentResult.Failure :
DeploymentResult.Success
=======================================
--- /trunk/src/Tarantino.Deployer.Core/Services/Impl/DeploymentRecorder.cs
Sat Jan 8 05:21:14 2011
+++ /trunk/src/Tarantino.Deployer.Core/Services/Impl/DeploymentRecorder.cs
Sat Jan 8 11:43:27 2011
@@ -15,13 +15,13 @@
_repository = repository;
}

- public string RecordDeployment(string application, string environment,
string output, string revision, bool failed)
+ public string RecordDeployment(string application, string environment,
string output, string version, bool failed)
{
var deployedBy = _securityContext.GetCurrentUsername();
- var deployment = _factory.CreateDeployment(application, environment,
deployedBy, output, revision, failed);
+ var deployment = _factory.CreateDeployment(application, environment,
deployedBy, output, version, failed);
_repository.Save(deployment);

- return deployment.Revision;
+ return deployment.Version;
}
}
}
=======================================
---
/trunk/src/Tarantino.Deployer.Core/Services/UI/IDeploymentSelectionValidator.cs
Tue Dec 29 12:09:43 2009
+++
/trunk/src/Tarantino.Deployer.Core/Services/UI/IDeploymentSelectionValidator.cs
Sat Jan 8 11:43:27 2011
@@ -1,10 +1,9 @@
using Tarantino.Deployer.Core.Model;

-
namespace Tarantino.Deployer.Core.Services.UI
{
public interface IDeploymentSelectionValidator
{
- bool IsValid(string revisionNumberText, Deployment selectedDeployment);
+ bool IsValid(string versionNumberText, Deployment selectedDeployment);
}
}
=======================================
--- /trunk/src/Tarantino.Deployer.Core/Services/UI/ILabelTextGenerator.cs
Tue Dec 29 12:09:43 2009
+++ /trunk/src/Tarantino.Deployer.Core/Services/UI/ILabelTextGenerator.cs
Sat Jan 8 11:43:27 2011
@@ -6,7 +6,7 @@
{
public interface ILabelTextGenerator
{
- string GetDeploymentText(Environment environment, string
revisionNumberText, Deployment deployment);
- string GetCertificationText(string revisionNumberText, Deployment
deployment);
+ string GetDeploymentText(Environment environment, string
versionNumberText, Deployment deployment);
+ string GetCertificationText(string versionNumberText, Deployment
deployment);
}
}
=======================================
---
/trunk/src/Tarantino.Deployer.Core/Services/UI/Impl/DeploymentRowFactory.cs
Sat Jan 8 05:21:14 2011
+++
/trunk/src/Tarantino.Deployer.Core/Services/UI/Impl/DeploymentRowFactory.cs
Sat Jan 8 11:43:27 2011
@@ -6,7 +6,7 @@
{
public string[] ConstructRow(Deployment deployment)
{
- string revision = deployment.Revision.ToString();
+ string version = deployment.Version;
string deployedOn = deployment.DeployedOn.ToString("g");
string deployedBy = deployment.DeployedBy;
string result = deployment.Result.DisplayName;
@@ -14,7 +14,7 @@
string certifiedBy = deployment.CertifiedBy;
string deploymentId = deployment.Id.ToString();

- return new[] {revision, deployedOn, deployedBy, result, certifiedOn,
certifiedBy, deploymentId};
+ return new[] {version, deployedOn, deployedBy, result, certifiedOn,
certifiedBy, deploymentId};
}
}
}
=======================================
---
/trunk/src/Tarantino.Deployer.Core/Services/UI/Impl/DeploymentSelectionValidator.cs
Tue Dec 29 12:09:43 2009
+++
/trunk/src/Tarantino.Deployer.Core/Services/UI/Impl/DeploymentSelectionValidator.cs
Sat Jan 8 11:43:27 2011
@@ -5,9 +5,9 @@
{
public class DeploymentSelectionValidator : IDeploymentSelectionValidator
{
- public bool IsValid(string revisionNumberText, Deployment
selectedDeployment)
- {
- bool isValidDeployment = (revisionNumberText != string.Empty) &&
(selectedDeployment != null);
+ public bool IsValid(string versionNumberText, Deployment
selectedDeployment)
+ {
+ bool isValidDeployment = (versionNumberText != string.Empty) &&
(selectedDeployment != null);
return isValidDeployment;
}
}
=======================================
---
/trunk/src/Tarantino.Deployer.Core/Services/UI/Impl/LabelTextGenerator.cs
Tue Dec 29 12:09:43 2009
+++
/trunk/src/Tarantino.Deployer.Core/Services/UI/Impl/LabelTextGenerator.cs
Sat Jan 8 11:43:27 2011
@@ -1,6 +1,4 @@
-using System;
using System.Text;
-using Tarantino.Deployer.Core.Services.UI;
using Tarantino.Deployer.Core.Model;
using
Environment=Tarantino.Deployer.Core.Services.Configuration.Impl.Environment;

@@ -15,25 +13,25 @@
_validator = validator;
}

- public string GetDeploymentText(Configuration.Impl.Environment
environment, string revisionNumberText, Deployment deployment)
- {
- return getText(environment, revisionNumberText, deployment,
Action.Deploy);
+ public string GetDeploymentText(Environment environment, string
versionNumberText, Deployment deployment)
+ {
+ return getText(environment, versionNumberText, deployment,
Action.Deploy);
}

- public string GetCertificationText(string revisionNumberText, Deployment
deployment)
- {
- return getText(null, revisionNumberText, deployment, Action.Certify);
+ public string GetCertificationText(string versionNumberText, Deployment
deployment)
+ {
+ return getText(null, versionNumberText, deployment, Action.Certify);
}

- private string getText(Configuration.Impl.Environment environment,
string revisionNumberText, Deployment deployment, Action action)
- {
- StringBuilder text = new StringBuilder();
-
- if (_validator.IsValid(revisionNumberText, deployment))
- {
- bool isDeployment = action == Action.Deploy;
- string username = isDeployment ? deployment.DeployedBy :
deployment.CertifiedBy;
- DateTime date = isDeployment ? deployment.DeployedOn :
deployment.CertifiedOn.Value;
+ private string getText(Environment environment, string versionNumber,
Deployment deployment, Action action)
+ {
+ var text = new StringBuilder();
+
+ if (_validator.IsValid(versionNumber, deployment))
+ {
+ var isDeployment = action == Action.Deploy;
+ var username = isDeployment ? deployment.DeployedBy :
deployment.CertifiedBy;
+ var date = isDeployment ? deployment.DeployedOn :
deployment.CertifiedOn.GetValueOrDefault();

if (environment != null)
{
=======================================
--- /trunk/src/Tarantino.Deployer.Core/Tarantino.Deployer.Core.csproj Sat
Jan 8 05:21:14 2011
+++ /trunk/src/Tarantino.Deployer.Core/Tarantino.Deployer.Core.csproj Sat
Jan 8 11:43:27 2011
@@ -89,10 +89,10 @@
<Compile Include="Services\Impl\DeploymentFactory.cs" />
<Compile Include="Services\Impl\DeploymentRecorder.cs" />
<Compile Include="Services\Impl\DeploymentResultCalculator.cs" />
- <Compile Include="Services\Impl\RevisionCertifier.cs" />
- <Compile Include="Services\Impl\RevisionNumberParser.cs" />
- <Compile Include="Services\IRevisionCertifier.cs" />
- <Compile Include="Services\IRevisionNumberParser.cs" />
+ <Compile Include="Services\Impl\VersionCertifier.cs" />
+ <Compile Include="Services\Impl\VersionNumberParser.cs" />
+ <Compile Include="Services\IVersionCertifier.cs" />
+ <Compile Include="Services\IVersionNumberParser.cs" />
<Compile Include="Services\UI\IDeploymentRowFactory.cs" />
<Compile Include="Services\UI\IDeploymentSelectionValidator.cs" />
<Compile Include="Services\UI\ILabelTextGenerator.cs" />
=======================================
---
/trunk/src/Tarantino.Deployer.Database/Update/001_CreateDeploymentTable.sql
Sat Jan 8 05:21:14 2011
+++
/trunk/src/Tarantino.Deployer.Database/Update/001_CreateDeploymentTable.sql
Sat Jan 8 11:43:27 2011
@@ -24,7 +24,7 @@
[DeploymentId] [uniqueidentifier] NOT NULL,
[Application] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Environment] [varchar] (25) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
-[Revision] [varchar] (20) NULL,
+[Version] [varchar] (20) NULL,
[DeployedOn] [datetime] NULL,
[DeployedBy] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[CertifiedOn] [datetime] NULL,
=======================================
---
/trunk/src/Tarantino.Deployer.Infrastructure/DataAccess/Mappings/Deployment.hbm.xml
Sat Jan 8 05:21:14 2011
+++
/trunk/src/Tarantino.Deployer.Infrastructure/DataAccess/Mappings/Deployment.hbm.xml
Sat Jan 8 11:43:27 2011
@@ -17,7 +17,7 @@
<property name="DeployedBy" />
<property name="CertifiedOn" type="DateTime" />
<property name="CertifiedBy" />
- <property name="Revision" />
+ <property name="Version" />
<many-to-one name="Output" class="DeploymentOutput" unique="true"
column="DeploymentOutputId" cascade="all-delete-orphan"/>

<property name="Result"
type="Tarantino.Infrastructure.Commons.DataAccess.ORMapper.EnumerationType`1[[Tarantino.Deployer.Core.Model.DeploymentResult,
Tarantino.Deployer.Core]], Tarantino.Infrastructure" />
=======================================
--- /trunk/src/Tarantino.Deployer.Infrastructure/Properties/AssemblyInfo.cs
Tue Dec 29 12:09:43 2009
+++ /trunk/src/Tarantino.Deployer.Infrastructure/Properties/AssemblyInfo.cs
Sat Jan 8 11:43:27 2011
@@ -1,10 +1,6 @@
using System.Reflection;
-using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

-// General Information about an assembly is controlled through the
following
-// set of attributes. Change these attribute values to modify the
information
-// associated with an assembly.
[assembly: AssemblyTitle("Tarantino.Deployer.Infrastructure")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
@@ -13,24 +9,7 @@
[assembly: AssemblyCopyright("Copyright © Microsoft 2009")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is
exposed to COM
[assembly: Guid("2ee7bdbd-f927-4f65-8056-2186d81f083f")]
-
-// Version information for an assembly consists of the following four
values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and
Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
=======================================
---
/trunk/src/Tarantino.Deployer.Infrastructure/Tarantino.Deployer.Infrastructure.csproj
Sat Jan 8 05:21:14 2011
+++
/trunk/src/Tarantino.Deployer.Infrastructure/Tarantino.Deployer.Infrastructure.csproj
Sat Jan 8 11:43:27 2011
@@ -52,6 +52,9 @@
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
+ <Reference Include="Ionic.Zip">
+ <HintPath>..\..\lib\DotNetZip\Ionic.Zip.dll</HintPath>
+ </Reference>
<Reference Include="StructureMap, Version=2.5.2.0, Culture=neutral,
PublicKeyToken=e60ad81abae3c223, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\StructureMap\2.5\StructureMap.dll</HintPath>
@@ -77,6 +80,7 @@
<Compile Include="DataAccess\Repositories\DeploymentRepository.cs" />
<Compile Include="DeployerInfrastructureDependencyRegistrar.cs" />
<Compile Include="DeployerInfrastructureDependencyRegistry.cs" />
+ <Compile Include="PackageDownloader.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
=======================================
---
/trunk/src/Tarantino.Deployer.IntegrationTests/Infrastructure/DataAccess/Mappings/DeploymentMappingsTester.cs
Sat Jan 8 05:21:14 2011
+++
/trunk/src/Tarantino.Deployer.IntegrationTests/Infrastructure/DataAccess/Mappings/DeploymentMappingsTester.cs
Sat Jan 8 11:43:27 2011
@@ -18,7 +18,7 @@
DeployedBy = "Deployer",
DeployedOn = new DateTime(2007, 3, 15),
CertifiedOn = new DateTime(2007, 4, 15),
- Revision = "250",
+ Version = "250",
Result = DeploymentResult.Failure
};

=======================================
---
/trunk/src/Tarantino.Deployer.IntegrationTests/Infrastructure/DataAccess/Repositories/DeploymentRepositoryTester.cs
Sat Jan 8 05:21:14 2011
+++
/trunk/src/Tarantino.Deployer.IntegrationTests/Infrastructure/DataAccess/Repositories/DeploymentRepositoryTester.cs
Sat Jan 8 11:43:27 2011
@@ -39,18 +39,18 @@
_uncertified_failure = new Deployment();
_certified_failure = new Deployment();

- _uncertified_Application1_Environment1.Revision = "1";
- _uncertified_Application1_Environment2.Revision = "2";
- _uncertified_Application2_Environment1.Revision = "3";
- _uncertified_Application2_Environment2.Revision = "4";
-
- _certified_Application1_Environment1.Revision = "5";
- _certified_Application1_Environment2.Revision = "6";
- _certified_Application2_Environment1.Revision = "7";
- _certified_Application2_Environment2.Revision = "8";
-
- _uncertified_failure.Revision = "9";
- _certified_failure.Revision = "10";
+ _uncertified_Application1_Environment1.Version = "1";
+ _uncertified_Application1_Environment2.Version = "2";
+ _uncertified_Application2_Environment1.Version = "3";
+ _uncertified_Application2_Environment2.Version = "4";
+
+ _certified_Application1_Environment1.Version = "5";
+ _certified_Application1_Environment2.Version = "6";
+ _certified_Application2_Environment1.Version = "7";
+ _certified_Application2_Environment2.Version = "8";
+
+ _uncertified_failure.Version = "9";
+ _certified_failure.Version = "10";

_uncertified_Application1_Environment1.Result =
DeploymentResult.Success;
_uncertified_Application1_Environment2.Result =
DeploymentResult.Success;
=======================================
---
/trunk/src/Tarantino.Deployer.IntegrationTests/Properties/AssemblyInfo.cs
Tue Dec 29 12:09:43 2009
+++
/trunk/src/Tarantino.Deployer.IntegrationTests/Properties/AssemblyInfo.cs
Sat Jan 8 11:43:27 2011
@@ -1,10 +1,6 @@
using System.Reflection;
-using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

-// General Information about an assembly is controlled through the
following
-// set of attributes. Change these attribute values to modify the
information
-// associated with an assembly.
[assembly: AssemblyTitle("Tarantino.Deployer.IntegrationTests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
@@ -13,24 +9,7 @@
[assembly: AssemblyCopyright("Copyright © Microsoft 2009")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is
exposed to COM
[assembly: Guid("b638b7fb-c4d8-4ea4-90a7-931aaccf1f97")]
-
-// Version information for an assembly consists of the following four
values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and
Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
=======================================
---
/trunk/src/Tarantino.Deployer.UnitTests/Core/Services/DeploymentFactoryTester.cs
Sat Jan 8 05:41:03 2011
+++
/trunk/src/Tarantino.Deployer.UnitTests/Core/Services/DeploymentFactoryTester.cs
Sat Jan 8 11:43:27 2011
@@ -32,7 +32,7 @@
Assert.That(deployment.Environment, Is.EqualTo("E1"));
Assert.That(deployment.DeployedBy, Is.EqualTo("jsmith"));
Assert.That(deployment.DeployedOn, Is.EqualTo(new DateTime(2007, 4,
15)));
- Assert.That(deployment.Revision, Is.EqualTo("1.0"));
+ Assert.That(deployment.Version, Is.EqualTo("1.0"));
Assert.That(deployment.Output.Output, Is.EqualTo("Output..."));
Assert.That(deployment.Result, Is.SameAs(DeploymentResult.Failure));
Assert.That(deployment.Output.Deployment, Is.SameAs(deployment));
=======================================
---
/trunk/src/Tarantino.Deployer.UnitTests/Core/Services/DeploymentRecorderTester.cs
Sat Jan 8 05:41:03 2011
+++
/trunk/src/Tarantino.Deployer.UnitTests/Core/Services/DeploymentRecorderTester.cs
Sat Jan 8 11:43:27 2011
@@ -14,7 +14,7 @@
[Test]
public void Records_deployment()
{
- var deployment = new Deployment{ Revision = "1.0"};
+ var deployment = new Deployment{ Version = "1.0"};

var mocks = new MockRepository();
var factory = mocks.CreateMock<IDeploymentFactory>();
@@ -31,9 +31,9 @@
using (mocks.Playback())
{
IDeploymentRecorder recorder = new DeploymentRecorder(context,
factory, repository);
- string revision =
recorder.RecordDeployment("application", "environment", "Output...", "1.0",
false);
-
- Assert.That(revision, Is.EqualTo("1.0"));
+ var version =
recorder.RecordDeployment("application", "environment", "Output...", "1.0",
false);
+
+ Assert.That(version, Is.EqualTo("1.0"));
}

mocks.VerifyAll();
=======================================
---
/trunk/src/Tarantino.Deployer.UnitTests/Core/Services/UI/DeploymentRowFactoryTester.cs
Sat Jan 8 05:21:14 2011
+++
/trunk/src/Tarantino.Deployer.UnitTests/Core/Services/UI/DeploymentRowFactoryTester.cs
Sat Jan 8 11:43:27 2011
@@ -15,7 +15,7 @@
{
var deployment = new Deployment
{
- Revision = "845",
+ Version = "845",
DeployedOn = new DateTime(2007, 4, 15, 6, 45, 32),
DeployedBy = "khurwitz",
Result = DeploymentResult.Failure,
=======================================
***Additional files exist in this changeset.***
Reply all
Reply to author
Forward
0 new messages