DotnetZero

A simple script to setup your source tree

Invoke-WebRequest dotnetzero.com | Invoke-Expression bash <(curl -L -s dotnetzero.com)

Ships with typical opinions

Answer a handful of prompts

Once you start the script it will walk you through a few questions to get things setup. A couple of names and some defaults and you are done.

Task runner and package management

During the install process, your repo will get local copies of Psake or Cake as well as Nuget!

Sets up your dot git and readme files

You'll also get started with a simple .gitattributes and a community driven .gitignore file from GitHub.

Gives you CI and database migration options

If you project is headed to a CI server it you can optionally drop in a runner task to wrap those specifics. Same goes for database migration tasks.

Powershell

Powershell

It all starts with Powershell. Windows machines has it installed and that is where we start. The end goal is to make it easy for developers to execute the build and yet give them easy access to the tasks your team creates.

How do I get started?

Look at the script

You'll need to execute a remote script. That can be scary so but it is open source so you can see what the script does at any time.

https://github.com/dotnetzero

If you have any questions, comments or concerns please open an issue and we'll work on it

Run the remote script

You'll need to execute a remote script but, again, it is open for you to see

Run the following:

Invoke-WebRequest dotnetzero.com | Invoke-Expression

This uses the Invoke-WebRequest cmdlet to GET the script that lives on GitHub and send it to your client. From there it is piped to the Invoke-Expression cmdlet where it executes on your machine

bash <(curl -L -s dotnetzero.com)

This uses the curl command to GET the script that lives on GitHub and send it to your client. From there it is redirected to bash where it executes on your machine

Psake

Leverages Psake

The nice thing about psake is that it just works. We bootstrap it for you so you don't even have to worry about finding it. It handles task dependencies and makes sure to surface error codes to your host process.

Ok I executed the remote script. Now what?

Answer a handful of questions

The script will prompt you for a number of questions. Your answers will drive what the resulting source tree looks like.

The questions are:

  • What your company and product names are
  • What your source code, build artifacts, tools directory and build script should be named
  • If the project should be setup to use Nuget Package Restore
  • If TeamCity log messages and Octopus Deploy msbuild tasks should be enabled
  • Add unit test and rebuild database Psake tasks

We will take all your answers and create an initial tree for you

This is just an example and even if none of the defaults are to your liking you can change, commit and forget you even used DotnetZero

Something like:

  • artifacts
  • src
  • tools
  • .gitattributes
  • .gitignore
  • README.MD
  • default.ps1
  • run.ps1
Nuget

We also invite Nuget

We default to nuget package restore but that's your call. Regardless we get the latest and greatest from the nuget folks and drop that into your directory too!

Some more little things

Don't forget the readme

Well also take some of the answers to the questions and get a readme started for you.

Have some git files

The final thing is to add git attributes and ignore file to your directory.

That is it

At this point we are done and you take it from here! You can make any manual changes you see fit and commit it to your repo. If you have suggestions or fixes please let us know.