Continuous integration is something that every developer is interested in having, but it is not easy to obtain, personalize and maintain.
EasyCI is a program that was thought to make continuous integration easy to use and allow extensibility and maintainability of it. In the following rows, I'll try to explain how it is easy to obtain a CI solution with no cost, using free tools.
As development environment, it is possible to use Visual Studio 2017 "Community Edition". It can be downloaded from here.
Looking the licence (here):
Microsoft leaves the commercial use up to 5 developers:
Organizational License. If you are an organization, your users may use the software as follows:
- Any number of your users may use the software to develop and test applications released under Open Source Initiative (OSI) approved open source software licenses.
- Any number of your users may use the software to develop and test extensions to Visual Studio.
- Any number of your users may use the software to develop and test device drivers for the Windows operating system.
- Any number of your users may use the software to develop and test your applications as part of online or in person classroom training and education, or for performing academic research.
- If none of the above apply, and you are also not an enterprise (defined below), then up to 5 of your individual users can use the software concurrently to develop and test your applications.
After 30 days of free use, it is possible to activate it permanently using a Microsoft Live account.
How to Prepare a Development Environment
- Install a new Windows (7 or later machine) or use an existing one.
- Download Visual Studio Community Edition (from here):
- Launch the Installer and click on 'Yes' when User Account Control Window is displayed:
- Click the 'Continue' button.
- Wait for download to finish.
- Select components as shown in the image below:
- Once installation finishes, sign in with a Microsoft account (or create one).
- Once you are signed in, a Window displays your credentials.
- To activate your Visual Studio, it is necessary to go to 'Help' => 'About Microsoft Visual Studio'.
- A window opens and it is necessary to click on 'License status' link.
- The license is trial. To update it to a full license, it is sufficient to click on 'Check for an updated license' link.
- Once the click is done, the license is upgraded to a full 'Visual Studio Community' type.
Optional Install: Notepad++ and CCleaner
- Download Notepad++ from here.
- Run the Installer and continue the installation using default features.
CCleaner from here.
- Run the Installer and click on 'Install' button.
Install Easy Continuous Integration Server and Client
Installers are available here.
- Once installers are downloaded, install 'Easy Continuous Integration Server.msi':
- Press 'Next' on welcome screen.
- Accept the 'License Agreement' and press 'Next'.
- If needed, personalize the installation folder and press 'Next'.
- Press the 'Install' button.
- Press 'Yes' in the User Account Control window.
- Press 'Finish' when the installation completes.
- Launch 'EasyCI.msi' from the download folder and continue in the same way as before.
- It would be a good thing (to simplify developer's life) to completely disable User Account Control as described in the previous link.
Writing a Simple Solution to Test EasyCI
The solution is available under the 'Inheritance' folder.
EasyCI installations are finished, it is possible to run both '
EasyCI' and 'Easy ContinousIntegration Server' (the first one starts minimized in the taskbar and can be restored double clicking on its taskbar icon).
- If we Drop a '.sln' file (see the Inheritance subfolder distributed with
EasyCI) over the
EasyCI restored window (double clicking on the taskbar its icon), The program will ask what are the projects to generate '
nuget' packages and what are projects to generate a setup project.
- Then the compilation will start. Unit tests are executed and Installation projects are created.
- Taking installation projects from the 'Archive' directory, it is possible to install the generated installer(s).
- It is possible to accept the User agreement.
- Select the installation folder.
- Confirm the installation.
- Wait for the installation.
- And complete the full process.
- After every cycle, every build is archived (by default under 'c:\Temp\Archive'):
- For every compiled project, the build output is saved under a file named '[ProjectName]_[CompileDate]-[CompileTime]_[TargetFramework].zip'.
- All source code is saved under a file named '[SolutionName]_Source_[CompileDate]-[CompileTime].zip'.
This zip contains two main folders:
- A folder Archive which contains a sub-folder (named '[SolutionName]_[CompileDate]-[CompileTime]') containing the generated '.nupkg' files:
- A folder named as the temporary folder using during the compilation containing the full source code:
The same folder contains also two batch files named '[SolutionName].bat' and '[SolutionName].actions.bat':
- The first one contains all the commands executed during the build/test/pack process:
- The second one allows to reproduce all the build/test/pack process using a command contained in the 'Easy Continuous Integration Server' installation path named 'ExecuteAction.exe':
It is possible to configure various behaviour that
EasyCI has by default.
Below, there is a full list of these configurations:
ConfigurationName: Gets or sets the name of the configuration used in a project file (by default: Debug or Release).
DontAllowTargetFrameworkToOutputPath: Gets or sets the possibility to don't allow target framework to output path in Visual Studio 2017 project format.
FilesToProcess: Gets or sets the files to process.
FilesToRemove: Gets or sets the files to remove (don't process).
FileTypesToInclude: Gets or sets the file types to include.
FoldersToExclude: Gets or sets the folders to exclude.
IncompatibleAssemblies: Gets or sets the incompatible assemblies.
PackagesDirectory: Gets or sets the packages directory.
Platform: Gets or sets the platform (x86, x64 or AnyCPU).
ProjectsExtensionsParts: Gets or sets the supported projects extensions (.vbproj, .csproj).
ProjectsToPatch: Gets or sets the projects to patch.
RemovePackagesAsAssemblyReference: Gets or sets the possibility to remove packages as assembly reference.
SettingsToEdit: Gets or sets the settings to edit.
WildcardsToInclude: Gets or sets the file type wildcards to include.
ArchiveZipDirectory: Gets or sets the directory to archive build zip files.
VisualStudioPath: Gets the Visual Studio path.
SolutionToPublish: Gets or sets the solution to compile, to build installers and publish packages to nuget.
SolutionsToPublish: Gets or sets the solutions to compile, to build installers and publish packages to nuget.
ProjectsToCreateInstall: Gets or sets the projects to create install.
NugetLocation: Gets or sets the nuget location.
DeleteOldLogs: Gets or sets the information if delete old logs.
ProjectsToInclude: Gets or sets the projects to include.
DeleteNuSpecIfExists: Gets or sets the information if delete nuspec file if exists.
HigherVersionRange: Gets or sets the higher version range to increment actual package version.
ResourcesDirectory: Gets or sets the resources directory used to create installer projects.
WinUIExtension: Gets or sets the win UI extension.
KeyToPublish: Gets or sets the key to publish.
LowerVersionRange: Gets or sets the lower version range to decide if a previous package has to be considered compatible or not.
NuGet: Gets or sets the URL from which download nuget.exe.
NugetServer: Gets or sets the official nuget server URL.
PrivateNugetServer: Gets or sets the private nuget server URL.
PrivateNugetServerBase: Gets or sets the private nuget server base URL.
PublishToOfficialRepository: Gets or sets a value indicating whether publish to official nuget server.
ReleaseNotes: Gets or sets the release notes.
RequireLicenseAcceptance: Gets or sets a value indicating whether the package requires license acceptance.
NugetUpdate: Gets or sets the information regarding a project to update nuget package references.
Tags: Gets or sets the tags used for package creation.
VersionIncrement: Gets or sets the version increment.
BaseAddress: Gets or sets the base address used for various Easy Continuous Integration Server Controllers.
TemporaryDirectory: Gets or sets the temporary directory.
ZipExclusion: Gets or sets the zip exclusion wildcards.
How 'Easy Continuous Integration Server' Defines Its Pipeline.
Easy Continuous Integration Server defines its pipeline using the information defined in the file 'EasyContinousIntegrationServer.exe.config'.
Looking inside this file, in its beginning, we can see two important parts:
- The first defines the possible plugins:
Here, we have many entries with a key defining an interface name and a value where the assembly name and the class implementing that interface is defined.
Note that is important that every custom defined interface has to inherit from the '
IPipelineAction' interface defined in the assembly '
Every time an action that uses that interface is required, 'Easy Continuous Integration Server' will try to load the class specified in the value (if not already loaded) and execute the method '
Execute' as defined in the interface '
IPipeLineAction'. The main idea is that, if anyone wants to define a new action in 'Easy Continuous Integration Server' pipeline, it is enough to write a new interface inheriting from the interface '
IPipeLineAction' and its class in a custom assembly (with .NET Framework version 4.6 or above), and adding a definition at the top of the file 'EasyContinousIntegrationServer.exe.config'.
- The second defines the plugin sequence:
'Easy Continuous Integration Server' pipeline is composed by three sub parts.
BuildActions: used to build and test a solution
BuildInstallersActions: used to create installers
FinalActions: used to archive resultant files