Professional Documents
Culture Documents
AT CI/CD AND
INFLUENCE
LEADERS
A guide to Leading the CI/CD Revolution
in your Windows-based organization
Alex Papadimoulis
Copyright © 2019 Alex Papadimoulis
iii
Table of Contents
I <> Continuous Integration + Continuous Delivery .. 1
Is Linux a prerequisite for CI/CD? ............................................ 2
Can you switch to Linux?......................................................... 3
Implement CI/CD on Windows, with Windows ........................ 4
Technical Differences Between Linux and Windows CI/CD....... 5
Design Principle: Modular vs. Integrated ................................. 6
Different Software Delivery .................................................. 7
Stepping on the wrong gas pedal.......................................... 8
User Experience: Learned vs. Intuitive..................................... 9
Learn by Using ..................................................................... 10
Linux tools for the Linux mindset ........................................ 11
Cultural differences are important ........................................ 12
Toxic Cultures Create Toxic Results .................................... 13
Like Oil and Vinegar ............................................................ 13
Love the One You’re With ................................................... 13
CI/CD Basics.......................................................................... 14
Seamless Automation ........................................................... 15
The CI/CD Value Proposition ................................................. 16
The Right CI/CD Tool ............................................................. 17
Talking Points ...................................................................... 19
Demonstrating Value: The Proof of Concept.......................... 20
Choose Wisely ..................................................................... 21
A Question of Metrics ......................................................... 22
Manual Releases are for Quitters .......................................... 23
II <> Proof in Practice ................................................ 25
Placeholders ......................................................................... 25
CI/CD Process ....................................................................... 26
Artifacts ............................................................................... 27
Option #1: Build Artifacts within your CI/CD tool ...............28
Option #2: Importing Artifacts from CI Servers ..................30
The MSI Antipattern ............................................................ 32
Option #3: Drop Folders/Paths ........................................... 35
It Doesn't Matter Where You Start ........................................ 36
iv
Best Practice Note: Bypass Roadblocks by Working
Asynchronously ................................................................... 36
III <> Deployment Plans ........................................... 39
The Fundamental Deployment Process ................................. 39
What is a deployment plan? ................................................. 40
Operations: Building blocks of Deployment Plans ..............41
The Server Context.............................................................. 43
One Deployment Plan for Multiple Environments ................. 44
Grouping Servers: Environments and Server Roles ................ 45
Variables and Deployment Plans ........................................... 47
Configuring Variables .......................................................... 48
OtterScript for Deployment Plans ......................................... 49
Which is Better: Visual or Text mode? ................................ 51
PowerShell + OtterScript ..................................................... 52
Manual Tasks: The Ultimate Placeholder............................... 53
Environments and Permissions ........................................... 54
Best Practice: Use Configuration Files for Different
Configuration ....................................................................... 54
What are configuration files?.............................................. 55
Configuration Files and CI/CD ............................................. 57
IV <> Issue Tracking and CI/CD ............................. 61
Issue/Project Tracking: The Rickety Bridge to Business .......... 61
Proper Issue Tracking Process ............................................... 62
The "Bug Tracker" Anti-pattern .......................................... 64
Automation and Issue Tracking ............................................. 65
BuildMaster and Issues/Project Tracking............................... 67
Transitioning Jira Issues ...................................................... 67
Beyond Operations: BuildMaster and Issues ......................68
Issue Visualization & Deployment Blocking ........................68
Issue Tracking: Next Steps..................................................... 69
V <> Integrating the Human Factor ......................... 71
Three Layers of CI/CD ........................................................... 71
Process Automation: Bridging the Technical and Nontechnical
............................................................................................. 72
Pipelines: Your Automated Process ....................................... 74
Effectively Using Pipeline Stages ......................................... 74
Deployment Windows and Approvals................................. 77
Avoiding the Bob Anti-Pattern .............................................. 78
v
Processes, Security, and Auditing .......................................... 79
Placeholders for Process ..................................................... 80
VI <> How to Rollout CI/CD to Everyone ............... 83
Secret to Buy-In: Incremental and Parallel............................. 84
The More You Know ............................................................. 85
VII <> Advanced Topics ............................................ 87
Blue / Green Deployments .................................................... 87
Benefits of Blue/Green Deployments ................................. 89
How to Perform Blue-Green Deployments in BuildMaster.90
Initial BuildMaster Configuration ........................................ 91
Appendix A <> How to Get Support from Inedo ...... 95
Integrations and the Inedo Den............................................. 97
Expanding into Inedo's Other Tools ....................................... 98
vi
I
Continuous Integration
+ Continuous Delivery
1
How To Win At CI/CD And Influence Leaders
2
Alex Papadimoulis
3
How To Win At CI/CD And Influence Leaders
Sure, they can learn. Given enough time and a ton of failed
sushi rolls, you might just get your bakery to start making
quality sushi. Or, you could just improve how you make
bread.
This book will help your existing staff learn how to switch
effectively and Inedo engineers are always available to help
guide the process. You will not need to hire any Linux
CI/CD experts to implement a process that will help your
organization build, test, and release quality software at the
speed required. Other Windows shops have successfully
made this transition and you can too. I will cover some of
the teachable moments from others’ experience so you can
avoid known pitfalls throughout the book.
4
Alex Papadimoulis
5
How To Win At CI/CD And Influence Leaders
6
Alex Papadimoulis
7
How To Win At CI/CD And Influence Leaders
8
Alex Papadimoulis
9
How To Win At CI/CD And Influence Leaders
Learn by Using
10
Alex Papadimoulis
11
How To Win At CI/CD And Influence Leaders
A lot of the jokes are in good fun and both Windows and
Linux sysadmins will often engage in good-natured
ribbing over beers. However, be warned that these
attitudes can quickly devolve into toxic environments in
the workplace. Engineers are passionate about the
12
Alex Papadimoulis
13
How To Win At CI/CD And Influence Leaders
CI/CD Basics
CI/CD is the combination of two time-saving practices
called Continuous Integration (CI) and Continuous
Delivery (CD) that development teams use to produce,
test, and deliver software faster, better, and less buggy.
When CI/CD is implemented well it delivers:
14
Alex Papadimoulis
Seamless Automation
Nearly all organizations have a less-than-ideal software
delivery process, which leads to less-than-ideal releases. A
poor process can only result in delays, bugs, and/or a
product that does not match the vision. In today's
15
How To Win At CI/CD And Influence Leaders
16
Alex Papadimoulis
This book teaches how to get CI/CD paid for and fully
implemented at your company. You will learn how to talk
non-developer speak to the higher-ups so they understand
what you already know: CI/CD is a must-have to remain
competitive.
Ultimately, either tool can get the job done, but using a
retrofitted tool may feel awkward, like driving a car that’s
had its gas tank ripped out and replaced with thousands of
D batteries duct taped together.
18
Alex Papadimoulis
Talking Points
19
How To Win At CI/CD And Influence Leaders
20
Alex Papadimoulis
Choose Wisely
A Question of Metrics
23
How To Win At CI/CD And Influence Leaders
24
II
Proof in Practice
Placeholders
The best way to help the business side of your organization
understand the benefits of CI/CD is by using
"placeholders" as part of the process. Things like
deployment windows and approvals may not impress your
technical colleagues, but the business people will love it —
even if the placeholders are just something you added as
an educated guess, modeled on the existing process.
25
How To Win At CI/CD And Influence Leaders
CI/CD Process
No matter what kind of application you've picked for your
POC, the release process should be repeatable. That is to
say, even though every release has different code and
different changes, it will still follow the same, templated
process. All release processes look something like this:
26
Alex Papadimoulis
Artifacts
Artifacts are the mechanism designed to capture build
output into a file, typically with the intention of being
deployed in the future. Artifacts are associated with a
build and may be created or deleted at any point during
the lifecycle of an active build. Artifact files themselves are
not limited to build output, they commonly also contain:
• Documentation files
• Release notes
• Archived source code
• "Frozen" dependencies
27
How To Win At CI/CD And Influence Leaders
with CI/CD, you don’t need MSI files at all, as I’ll explain
later in The MSI Antipattern.
Artifacts are the files you will be deploying and they come
from three different sources. You can build them inside of
your CI/CD tool platform, import them from a dedicated
CI server, pull them from a drop path, or manually upload
them.
28
Alex Papadimoulis
29
How To Win At CI/CD And Influence Leaders
30
Alex Papadimoulis
I’ve seen a lot of Windows shops fall into the trap of the
MSI (Microsoft Installer) Antipattern for deployment.
This involves having the development or release team
building an MSI file containing the application or
components, and then handing it off to the operations
team to install on the target servers.
32
Alex Papadimoulis
33
How To Win At CI/CD And Influence Leaders
Optimize Deployments
In a world of manual deployments, the file-by-file
technique made sense. Deploying all of the files took
longer and seemed unnecessary. Why deploy the entire
application if all that changed was a logo file?
34
Alex Papadimoulis
actual disk space usage is much less than you might expect.
And you could always create scripts to purge old artifacts,
or a feature built-in to your CI/CD tool like
BuildMaster's retention policies to define rules that
automate this process.
35
How To Win At CI/CD And Influence Leaders
36
Alex Papadimoulis
37
How To Win At CI/CD And Influence Leaders
38
III
Deployment Plans
39
How To Win At CI/CD And Influence Leaders
40
Alex Papadimoulis
Each CI/CD tool will use different words for the discreet
steps and specific tasks in a deployment plan. BuildMaster
uses the term "Operations", which includes everything
from sending an email to getting code from a git
repository.
41
How To Win At CI/CD And Influence Leaders
42
Alex Papadimoulis
43
How To Win At CI/CD And Influence Leaders
You can also use loops and variables to set server context,
but the ideal place is your deployment pipeline. I'll talk
about that more in Chapter seven, but for now it's fine to
explicitly set the server context to whichever server you
need to deploy to.
44
Alex Papadimoulis
45
How To Win At CI/CD And Influence Leaders
46
Alex Papadimoulis
47
How To Win At CI/CD And Influence Leaders
• an application-scoped variable,
$DeployToHttps=false
• a pipeline-scoped variable at the Production stage,
$DeployToHttps=true
Configuring Variables
if $DeployToHttps
{
Deploy-Artifact AccountsWeb
(
To:
C:\SecureWebsites\Accounts
);
}
else
{
Deploy-Artifact AccountsWeb
(
To: C:\Websites\Accounts
);
}
49
How To Win At CI/CD And Influence Leaders
IIS::Ensure-AppPool
ProfitCalcAppPool
(
State: Stopped
);
Deploy-Artifact ProfitCalcAppPool
(
50
Alex Papadimoulis
To: c:\Websites\ProfitCalc
);
IIS::Start-AppPool
ProfitCalcAppPool;
51
How To Win At CI/CD And Influence Leaders
PowerShell + OtterScript
psexec >>
# delete all but the latest 3 logs in
the log directory
Get-ChildItem
"E:\Site\Logs\$ApplicationName" |
Sort-Object $.CreatedDate -
descending |
Select-Object -skip 3 |
Remove-Item
>>;
52
Alex Papadimoulis
53
How To Win At CI/CD And Influence Leaders
54
Alex Papadimoulis
55
How To Win At CI/CD And Influence Leaders
56
Alex Papadimoulis
<appSettings
file="Web_appSettings.config">
<add
key="ValidationSettings:UnobtrusiveVal
idationMode" value="None"/>
</appSettings>
58
Alex Papadimoulis
59
How To Win At CI/CD And Influence Leaders
60
IV
Issue Tracking and CI/CD
62
Alex Papadimoulis
63
How To Win At CI/CD And Influence Leaders
64
Alex Papadimoulis
65
How To Win At CI/CD And Influence Leaders
66
Alex Papadimoulis
Transition-Issues
(
67
How To Win At CI/CD And Influence Leaders
Credentials: MyJira,
Project: ProfitCalc,
From: Checked In,
To: Ready for Test,
FixFor: $ReleaseNumber
);
68
Alex Papadimoulis
69
How To Win At CI/CD And Influence Leaders
70
V
Integrating the
Human Factor
71
How To Win At CI/CD And Influence Leaders
72
Alex Papadimoulis
But who will click the deployment button and how will
that person decide when the right time to click is?
If you are using a CI/CD tool, then the tool will help you
document, automate, and streamline.
73
How To Win At CI/CD And Influence Leaders
74
Alex Papadimoulis
75
How To Win At CI/CD And Influence Leaders
76
Alex Papadimoulis
77
How To Win At CI/CD And Influence Leaders
78
Alex Papadimoulis
79
How To Win At CI/CD And Influence Leaders
81
VI
How to Rollout CI/CD to
Everyone
83
How To Win At CI/CD And Influence Leaders
But just showing that it's not worse isn't enough. You'll
need to show that CI/CD is better and faster. The easiest
84
Alex Papadimoulis
85
How To Win At CI/CD And Influence Leaders
86
VII
Advanced Topics
87
How To Win At CI/CD And Influence Leaders
88
Alex Papadimoulis
• Zero downtime!
• No need for dedicated staging environment.
Your Blue and Green environments will serve as a
rotating staging and production environment, so
you won't need to worry about errors arising from
differences between production and staging
environments. They will both be considered
production.
• Instantaneous Rollback after Problems. If you
discover a problem after going live (i.e., swapping
your Blue and Green environments), you can
89
How To Win At CI/CD And Influence Leaders
90
Alex Papadimoulis
or Green to Blue.
o This plan will issue instructions to your router or
load-balancer using PowerShell or another
mechanism.
• Create two pipelines:
o Both will start with your standard pre-production
stages (Build, Integration, Test, etc.).
o Blue will deploy to a "Blue" stage, then a "Swap"
stage.
o Green will deploy to a "Green" stage, then a "Swap"
stage.
91
How To Win At CI/CD And Influence Leaders
92
Alex Papadimoulis
You can even simplify this process and give the user a
choice when they deploy to "Staging.” To do this:
Because the last stage of both the Blue and the Green
pipelines simply swap environments, you can just navigate
93
How To Win At CI/CD And Influence Leaders
94
Appendix A:
How to Get Support
from Inedo
95
How To Win At CI/CD And Influence Leaders
96
Alex Papadimoulis
97
How To Win At CI/CD And Influence Leaders
98
Alex Papadimoulis
which will make it a lot easier to learn and expand into our
other tools.
99