micro-elements - MicroElements.DevOps 1.2.0
MicroElements.DevOps
DevOps scripts for CI and CD
Main features
- Based on CakeBuild
- Supported OS: Windows, Linux
- Supported CI: Travis, AppVeyor, Jenkins, any other
- C# project generation or initialization with CI and CD included
- Only two files: build.ps1 and build.sh. All other files can be generated
- No need to maintain your own build scripts
- You can customize and add own tasks if you need
Getting started
1. Download bootstrap script
Open a new PowerShell window and run the following command.
Invoke-WebRequest https://raw.githubusercontent.com/micro-elements/MicroElements.DevOps/master/resources/build.ps1 -OutFile build.ps1
2. Initialize component
Run target Init
./build.ps1 -Target "Init"
3. Usage
Local build
Run target Default
./build.ps1 -Target "Default"
Travis CI
Add file .travis.yml to project
language: csharp
mono: none
dotnet: 2.1.300
os:
- linux
before_script:
- chmod a+x ./build.sh
script:
- ./build.sh --target=Travis --verbosity=normal
Other CI
Run shell script: ./build.sh --target=Travis
PM> Install-Package MicroElements.DevOps -Version 1.2.0 -Source https://www.myget.org/F/micro-elements/api/v3/index.json
> nuget.exe install MicroElements.DevOps -Version 1.2.0 -Source https://www.myget.org/F/micro-elements/api/v3/index.json
> dotnet add package MicroElements.DevOps --version 1.2.0 --source https://www.myget.org/F/micro-elements/api/v3/index.json
source https://www.myget.org/F/micro-elements/api/v3/index.json
nuget MicroElements.DevOps ~> 1.2.0
Copy to clipboard
> choco install MicroElements.DevOps --version 1.2.0 --source https://www.myget.org/F/micro-elements/api/v2
Import-Module PowerShellGet
Register-PSRepository -Name "micro-elements" -SourceLocation "https://www.myget.org/F/micro-elements/api/v2"
Install-Module -Name "MicroElements.DevOps" -RequiredVersion "1.2.0" -Repository "micro-elements"
Copy to clipboard
MicroElements.DevOps
DevOps scripts for CI and CD
Statuses
Main features
- Based on CakeBuild
- Supported OS: Windows, Linux
- Supported CI: Travis, AppVeyor, Jenkins, any other
- C# project generation or initialization with CI and CD included
- Only two files: build.ps1 and build.sh. All other files can be generated
- No need to maintain your own build scripts
- You can customize and add own tasks if you need
Getting started
1. Download bootstrap script
Open a new PowerShell window and run the following command.
Invoke-WebRequest https://raw.githubusercontent.com/micro-elements/MicroElements.DevOps/master/resources/build.ps1 -OutFile build.ps1
2. Run Init script
Run target Init
./build.ps1 -Target "Init"
Result
- generated project
- generated test project
- travis.yml
- appveyor.yml
- build.ps1
- build.sh
- CHANGELOG.md
- README.md
- common.props
- version.props
- src/Directory.Build.props
- test/Directory.Build.props
- stylecop integration
- Readme statuses generated
3. Project initialization
- Fill common.props: Description, PackageTags, PackageIconUrl (other attributes was filled autpmatically by init script)
4. Usage
Local build
Run target Default
./build.ps1 -Target "Default"
Travis CI
Add file .travis.yml to project
language: csharp
mono: none
dotnet: 2.1.300
os:
- linux
before_script:
- chmod a+x ./build.sh
script:
- ./build.sh --target=Travis --verbosity=normal
Other CI
Run shell script: ./build.sh --target=Travis
Tasks
Init
Initializes project structure and adds all needed files
Runs:
- CreateProjectStructure
- CheckOrDownloadGitIgnore
- GitIgnoreAddCakeRule
- CreateProjects
- EditorConfig
- SourceLink
- CreateCommonProjectFiles
- AddTravisFile
- AddAppVeyorFile
- AddCakeBootstrapFiles
- AddChangeLog
- AddReadme
- AddStyleCop
Default
Builds projects and runs tests
Runs:
Travis
Does versioning, builds projects, runs tests creates and uploads artifacts
Runs:
AppVeyor
Builds, tests and uploads test results to appVeyor
Runs:
CreateProjectStructure
TODO: all tasks
Features
Customize build
add cake.build file in root of your project TODO: samples
Concepts
- ScriptParam
- ScriptArgs
- Value chains
- Conventions
ScriptParam
- props
- get value chain
ScriptArgs
Param | Description | DefaulValue |
---|---|---|
SrcDir | Sources directory. Contains projects. | src |
1.2.0
- Added:
PrintHeader
for header printing using Figlet, addedHeader
param. - Added: functional stuff
- Fixed: Value override for list params
- Changed:
PrintParams
prints the same info that on build
1.1.1
- Bugfix: fixed build.sh script path
1.1.0
- Added task
UploadTestResultsToAppVeyor
toAppVeyor
task - Added task
AddAppVeyorFile
- New:
AddFileFromTemplate
supports options and can fill template from params - Changes:
ArtifactsDir
now is inRootDir
by default - Changes:
TestResultsDir
is the child ofArtifactsDir
- Changes:
PackagesDir
is the child ofArtifactsDir
- Bugfix:
DefaultValue
ParamSource is now always at the and of GetValueChain
1.0.0
The first major version.
- Includes main tasks: Init, Default, Travis, AppVeyor
- Task
Init
runs: CreateProjectStructure, CheckOrDownloadGitIgnore, GitIgnoreAddCakeRule, CreateProjects, EditorConfig, SourceLink, CreateCommonProjectFile, AddTravisFile, AddCakeBootstrapFiles, AddChangeLog, AddStyleCop - Task
Default
runs: Build, Test, CopyPackagesToArtifacts - Task
Travis
runs: DoVersioning, Build, Test, CopyPackagesToArtifacts, UploadPackages - Task
AppVeyor
runs: Build, Test - All scripts builded on concepts:
- ScriptArgs contains all script params
- ScriptParam:
- Can be initializes from command line args, environment variables
- Can be initialized from attributes: DefaultValue, ScriptParamAttribute
- Evaluates by conventions
- Can contain list values
- Scripts splitted on several files
- Extended customization
1.0.0-beta.2
- VersionParam
- used NugetSource, removed old non list nuget_sourceX params
1.0.0-beta.1
Breaking changes:
- Removed ScriptParamFactory - all factory methods moved to ScriptParam for simplicity
- AutoCreation script params with Initialize methods. Initialize creates script param, initializes param from attributes, sets default getters from arguments and from environment variables.
- Added overriden operator
/
that combinesScriptParam<DirectoryPath>
with string and gets combined DirectoryPath
0.5.0
- Redesigned ScriptParam and ScriptArgs
- New Targets: AddTravisFile, CopyPackagesToArtifacts, UploadPackages, AddStyleCop
- Added versioning (Manual and for some CI)
- Added generate package on build
- Added build.sh to resources and AddCakeBootstrapFiles target
- Build and Test moved to build.cake
- Added many common util methods
- Scenarios moved from common
- DotNetPack with releaseNotes
0.4.0
- Common props created
- Added: fill common props from github
0.3.0
- Create version.props
- GetVersionFromCommandLineArgs, ReadTemplate
- Idempotent CreateProjectStructure
- Versioning methods
0.2.0
- Vesion that works from nuget pakage
- Init target: CreateProjectStructure, GitIgnore, CreateProjects, EditorConfig, SourceLink
0.1.0
- Initial version
OwnersAlexey Petryashev |
Authorsalexey.petriashev |
Project URLhttps://github.com/micro-elements/MicroElements.DevOps |
LicenseMIT |
TagsDevOps cake buildScript CI CD |
Info50 total downloads |
1 downloads for version 1.2.0 |
Download (31.72 KB) |
Found on the current feed only |
Package history
Version | Size | Last updated | Downloads | Mirrored? | |||
---|---|---|---|---|---|---|---|
1.11.0 | 37.22 KB | Sun, 31 May 2020 20:15:08 GMT | 2 | ||||
1.10.0 | 35.28 KB | Sun, 31 May 2020 16:15:15 GMT | 3 | ||||
1.9.1 | 37.11 KB | Mon, 03 Jun 2019 12:11:33 GMT | 2 | ||||
1.9.0 | 37.03 KB | Tue, 23 Apr 2019 20:12:33 GMT | 2 | ||||
1.8.1 | 36.73 KB | Mon, 21 Jan 2019 21:57:14 GMT | 0 | ||||
1.8.0 | 36.78 KB | Mon, 21 Jan 2019 20:17:47 GMT | 1 | ||||
1.7.3 | 36.65 KB | Sun, 23 Dec 2018 18:44:33 GMT | 2 | ||||
1.7.2 | 36.69 KB | Sat, 22 Dec 2018 20:50:39 GMT | 1 | ||||
1.7.1 | 36.68 KB | Tue, 18 Dec 2018 21:01:58 GMT | 1 | ||||
1.7.0 | 36.78 KB | Mon, 22 Oct 2018 21:46:36 GMT | 1 | ||||
1.6.0 | 36.72 KB | Sun, 12 Aug 2018 20:41:31 GMT | 1 | ||||
1.5.0 | 37.69 KB | Tue, 07 Aug 2018 21:29:58 GMT | 1 | ||||
1.4.1 | 35.63 KB | Fri, 03 Aug 2018 20:15:42 GMT | 1 | ||||
1.4.0 | 35.59 KB | Thu, 02 Aug 2018 22:04:24 GMT | 3 | ||||
1.3.0 | 34.52 KB | Mon, 23 Jul 2018 19:31:35 GMT | 2 | ||||
1.2.0 | 31.72 KB | Sat, 21 Jul 2018 12:15:56 GMT | 1 | ||||
1.1.1 | 30.39 KB | Tue, 17 Jul 2018 22:41:14 GMT | 0 | ||||
1.1.0 | 30.37 KB | Tue, 17 Jul 2018 20:34:15 GMT | 1 | ||||
1.0.0 | 29.16 KB | Sat, 14 Jul 2018 21:46:14 GMT | 1 | ||||
1.0.0-beta.2 | 27.85 KB | Tue, 10 Jul 2018 15:43:19 GMT | 2 | ||||
1.0.0-beta.1 | 27.8 KB | Mon, 09 Jul 2018 21:32:38 GMT | 1 | ||||
0.6.0-beta.1 | 23.2 KB | Wed, 20 Jun 2018 21:20:24 GMT | 0 | ||||
0.5.0 | 23.19 KB | Mon, 18 Jun 2018 16:53:13 GMT | 1 | ||||
0.5.0-rc.3 | 23.2 KB | Mon, 18 Jun 2018 16:29:10 GMT | 1 | ||||
0.5.0-rc.2 | 23.03 KB | Mon, 18 Jun 2018 13:47:27 GMT | 1 | ||||
0.5.0-rc.1 | 21.57 KB | Thu, 14 Jun 2018 14:57:51 GMT | 3 | ||||
0.3.0 | 10.51 KB | Sat, 12 May 2018 22:25:16 GMT | 4 | ||||
0.2.0 | 9.22 KB | Sat, 12 May 2018 16:51:30 GMT | 11 |