automated deployment with umbraco - proworks · automated deployment with umbraco mark bowser...

33
Automated Deployment With Umbraco Mark Bowser uWestFest ‘16 - San Diego, CA

Upload: others

Post on 27-Mar-2020

22 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Automated Deployment With Umbraco - ProWorks · Automated Deployment With Umbraco Mark Bowser uWestFest ‘16 - San Diego, CA . Mark Bowser Full Stack Web Developer . Corvallis

Automated Deployment With Umbraco

Mark Bowser uWestFest ‘16 - San Diego, CA

Page 2: Automated Deployment With Umbraco - ProWorks · Automated Deployment With Umbraco Mark Bowser uWestFest ‘16 - San Diego, CA . Mark Bowser Full Stack Web Developer . Corvallis

Mark Bowser Full Stack Web Developer

Page 3: Automated Deployment With Umbraco - ProWorks · Automated Deployment With Umbraco Mark Bowser uWestFest ‘16 - San Diego, CA . Mark Bowser Full Stack Web Developer . Corvallis

Corvallis

Page 4: Automated Deployment With Umbraco - ProWorks · Automated Deployment With Umbraco Mark Bowser uWestFest ‘16 - San Diego, CA . Mark Bowser Full Stack Web Developer . Corvallis

Goals

Not go too deep into techical

side

Show how the pieces work

together

Inspire people to try it out

Page 5: Automated Deployment With Umbraco - ProWorks · Automated Deployment With Umbraco Mark Bowser uWestFest ‘16 - San Diego, CA . Mark Bowser Full Stack Web Developer . Corvallis

What does it take?

Branching strategy

TeamCity

Octopus Deploy

uSync?

MORE !?

Page 6: Automated Deployment With Umbraco - ProWorks · Automated Deployment With Umbraco Mark Bowser uWestFest ‘16 - San Diego, CA . Mark Bowser Full Stack Web Developer . Corvallis

Why bother? Consistency

Reinfores good habits

Gateway to automated testing

Speedy deploys

Easy setup*

Page 7: Automated Deployment With Umbraco - ProWorks · Automated Deployment With Umbraco Mark Bowser uWestFest ‘16 - San Diego, CA . Mark Bowser Full Stack Web Developer . Corvallis

Branching Strategy

Page 8: Automated Deployment With Umbraco - ProWorks · Automated Deployment With Umbraco Mark Bowser uWestFest ‘16 - San Diego, CA . Mark Bowser Full Stack Web Developer . Corvallis

Feature Branches

Solves problems with:

• Large features

• Unapproved features

Page 9: Automated Deployment With Umbraco - ProWorks · Automated Deployment With Umbraco Mark Bowser uWestFest ‘16 - San Diego, CA . Mark Bowser Full Stack Web Developer . Corvallis

master

F-1

F-2

dev

Page 10: Automated Deployment With Umbraco - ProWorks · Automated Deployment With Umbraco Mark Bowser uWestFest ‘16 - San Diego, CA . Mark Bowser Full Stack Web Developer . Corvallis

Branch Naming

Page 11: Automated Deployment With Umbraco - ProWorks · Automated Deployment With Umbraco Mark Bowser uWestFest ‘16 - San Diego, CA . Mark Bowser Full Stack Web Developer . Corvallis

Branch Naming

Page 12: Automated Deployment With Umbraco - ProWorks · Automated Deployment With Umbraco Mark Bowser uWestFest ‘16 - San Diego, CA . Mark Bowser Full Stack Web Developer . Corvallis

Build Server

Page 13: Automated Deployment With Umbraco - ProWorks · Automated Deployment With Umbraco Mark Bowser uWestFest ‘16 - San Diego, CA . Mark Bowser Full Stack Web Developer . Corvallis

Pulls from source

control

Builds project

Runs tests

Deploy?

Build Server

Page 14: Automated Deployment With Umbraco - ProWorks · Automated Deployment With Umbraco Mark Bowser uWestFest ‘16 - San Diego, CA . Mark Bowser Full Stack Web Developer . Corvallis

Projects and Build Configurations

Nested Project Structure

Build Configurations

• Version Control Settings

• Build Triggers

• Build Steps

Page 15: Automated Deployment With Umbraco - ProWorks · Automated Deployment With Umbraco Mark Bowser uWestFest ‘16 - San Diego, CA . Mark Bowser Full Stack Web Developer . Corvallis

Version Control Settings Git

Mercurial

TFS

Subversion

CVS

Other…

Page 16: Automated Deployment With Umbraco - ProWorks · Automated Deployment With Umbraco Mark Bowser uWestFest ‘16 - San Diego, CA . Mark Bowser Full Stack Web Developer . Corvallis

Build Triggers

Manual (no trigger)

On commit

Scheduled

Other?

Page 17: Automated Deployment With Umbraco - ProWorks · Automated Deployment With Umbraco Mark Bowser uWestFest ‘16 - San Diego, CA . Mark Bowser Full Stack Web Developer . Corvallis

Build Steps

MSBuild

Run Unit Tests

Run Commandline?

Page 18: Automated Deployment With Umbraco - ProWorks · Automated Deployment With Umbraco Mark Bowser uWestFest ‘16 - San Diego, CA . Mark Bowser Full Stack Web Developer . Corvallis

So how do we actually

deploy stuff?

Page 19: Automated Deployment With Umbraco - ProWorks · Automated Deployment With Umbraco Mark Bowser uWestFest ‘16 - San Diego, CA . Mark Bowser Full Stack Web Developer . Corvallis

MSBuild + WebDeploy

1. Install Web Deploy on server

2. Deal with windows service has

permissions

3. Create users on source and

dest machines

4. Deal with mostly vague

TeamCity errors

Page 20: Automated Deployment With Umbraco - ProWorks · Automated Deployment With Umbraco Mark Bowser uWestFest ‘16 - San Diego, CA . Mark Bowser Full Stack Web Developer . Corvallis

I no longer recommend Web

Deploy

Complex. Easy to miss little things.

Vague error messages

No easy rollback

There is a better way!

Page 21: Automated Deployment With Umbraco - ProWorks · Automated Deployment With Umbraco Mark Bowser uWestFest ‘16 - San Diego, CA . Mark Bowser Full Stack Web Developer . Corvallis

Octopus Deploy

Page 22: Automated Deployment With Umbraco - ProWorks · Automated Deployment With Umbraco Mark Bowser uWestFest ‘16 - San Diego, CA . Mark Bowser Full Stack Web Developer . Corvallis

Not a build server

Consumes nuget feeds

Handles deployment

Page 23: Automated Deployment With Umbraco - ProWorks · Automated Deployment With Umbraco Mark Bowser uWestFest ‘16 - San Diego, CA . Mark Bowser Full Stack Web Developer . Corvallis

Easier than Web Deploy

Good at rolling back

Very good documentation

Why Octopus?

Page 24: Automated Deployment With Umbraco - ProWorks · Automated Deployment With Umbraco Mark Bowser uWestFest ‘16 - San Diego, CA . Mark Bowser Full Stack Web Developer . Corvallis

1. Consumes nuget feed

2. Creates Release

3. Deploys to new folder

4. Points IIS to that folder

5. Fixes permissions

What does an Octopus deploy

look like?

Page 25: Automated Deployment With Umbraco - ProWorks · Automated Deployment With Umbraco Mark Bowser uWestFest ‘16 - San Diego, CA . Mark Bowser Full Stack Web Developer . Corvallis

TeamCity + Octopus Deploy Implementation

With our powers combined!

Page 26: Automated Deployment With Umbraco - ProWorks · Automated Deployment With Umbraco Mark Bowser uWestFest ‘16 - San Diego, CA . Mark Bowser Full Stack Web Developer . Corvallis

1. Umbraco project configured to

be packaged into NuGet

2. Media set up in Virtual

Directory

3. TeamCity = NuGet Server

4. Octopus deploys NuGet

packages

Four Steps

Page 27: Automated Deployment With Umbraco - ProWorks · Automated Deployment With Umbraco Mark Bowser uWestFest ‘16 - San Diego, CA . Mark Bowser Full Stack Web Developer . Corvallis

1. Nuget OctoPack

2. Create nuspec file Preparing Umbraco

for NuGet packaging

“Install-Package OctoPack”

Page 28: Automated Deployment With Umbraco - ProWorks · Automated Deployment With Umbraco Mark Bowser uWestFest ‘16 - San Diego, CA . Mark Bowser Full Stack Web Developer . Corvallis

1. New SharedMedia directory

outside of umbraco

2. New Virtual Directory pointing

to SharedMedia

Umbraco Media in Virtual Directory

Page 29: Automated Deployment With Umbraco - ProWorks · Automated Deployment With Umbraco Mark Bowser uWestFest ‘16 - San Diego, CA . Mark Bowser Full Stack Web Developer . Corvallis

1. Install Octopus Deploy Integration

plugin

2. Enable NuGet Server

3. OctoPackEnforceAddingFiles=true

4. MSBuild step should check “Run

OctoPack”

5. New “Octopus Deploy: Create

Release” build step

TeamCity NuGet Server

Page 30: Automated Deployment With Umbraco - ProWorks · Automated Deployment With Umbraco Mark Bowser uWestFest ‘16 - San Diego, CA . Mark Bowser Full Stack Web Developer . Corvallis

1. Add an “External Feed” for

TeamCity Nuget Server

2. Script template for fixing

Umbraco permissions

3. New “Deploy Package” step

4. New “Fix Permissions” step

Prepare Octopus Deploy

Page 31: Automated Deployment With Umbraco - ProWorks · Automated Deployment With Umbraco Mark Bowser uWestFest ‘16 - San Diego, CA . Mark Bowser Full Stack Web Developer . Corvallis

Pros of UaaS:

• Really easy to spin up new sites

• Handles content deployment as

well as code deployment

Pros of TeamCity + Octopus:

• More control

• Probably supports more exotic

setups

TeamCity + Octopus vs

UaaS?

Page 32: Automated Deployment With Umbraco - ProWorks · Automated Deployment With Umbraco Mark Bowser uWestFest ‘16 - San Diego, CA . Mark Bowser Full Stack Web Developer . Corvallis

Questions?

Contact me at:

[email protected]

Page 33: Automated Deployment With Umbraco - ProWorks · Automated Deployment With Umbraco Mark Bowser uWestFest ‘16 - San Diego, CA . Mark Bowser Full Stack Web Developer . Corvallis

Big pieces of Octopus:

• Tentacles

• Releases

• Environments

• Lifecycles

• Projects

• Channels

More on Octopus