02 - Build and Deployment Management
-
Upload
sergii-shmarkatiuk -
Category
Technology
-
view
5.261 -
download
1
Transcript of 02 - Build and Deployment Management
![Page 1: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/1.jpg)
BUILD AND DEPLOYMENT MANAGEMENT
![Page 2: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/2.jpg)
2
PURPOSE OF CURRENT TRAINING
Theory and practice of build and deployment management
Why do we need to manage builds
Why do we need to manage deployments
![Page 3: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/3.jpg)
3
CONTENTS
Build managementWhat is build?Why do we need to build?Build types.Tools and their specifics: Ant, Maven, make,
etcTips
Deployment managementBuild vs deploymentWhy do we need to deploy?How to deploy and when?Tools that might be useful
![Page 4: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/4.jpg)
4
MAIN CONCEPTS
![Page 5: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/5.jpg)
WHAT IS BUILD
From ToProcessof conversion
Source code Artifactsrun at the end-user
workstation
5
![Page 6: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/6.jpg)
6
WHY DO WE NEED TO BUILD?
Configuration
BuildRESULT OF
defined set of components having specific versions
components = functional unitscomponents and their versions are chosen to
meet specific objectives or tasks
Main objectives
Functionality Performance
![Page 7: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/7.jpg)
7
WHY DO WE NEED TO BUILD?
Conclusion. Why we need to build is: To incorporate additional functionality (feature) To reach defined level of performance (as an
example of non-functional requirement)
And what about data? Data has its own lifecycle Which is incorporated into the database
integration process
![Page 8: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/8.jpg)
8
WHY DO WE NEED TO MANAGE BUILDS? When application grows in size, it becomes more
complex
As a result, it turns out that routine daily activities require additional management
Organizing build process is one of such activities
Therefore, build process also requires management
What means complex application?
From configuration management point of view, most complex application incorporate all possible variant properties
![Page 9: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/9.jpg)
9
BUILD VS VARIANT
AppName-1.1.8.en.x32_beta.msi
install.msiBuild:
Variant:
HTC_Touch_Diamond2_WM6.5_RUU_Topaz_S_HTC_RUS_2.16.411.2_Radio_Sign_Topaz_61.44tc.25.32_4.49.25.17_Ship.exe
Real world example:
![Page 10: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/10.jpg)
10
CONNECTION BETWEEN CONFIGURATION AND VARIANTS
build
source code changes (changeset)
variant
configuration +
#1 #2 #3 #N…
Functional requirements for the variant being built
static runtime
version Maturity
Platform
OS
Localization
Build type
![Page 11: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/11.jpg)
11
WHAT IS VARIANT
Variant is the result of the build characterized by the set of specific
properties and their values
![Page 12: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/12.jpg)
12
VARIANT PROPERTIES
Version Revision Date Build type: debug or release Operating system, hardware platform (x32,
x64, …) Localization (en, ru, ua, …) Platform (development, test, integration,
production) Maturity (alpha, beta, release candidate, stable)
Issue number (fix#387)
License (MIT, GPL, BSD, CC, …)
Project ID (EPM-SIGN) + Discipline ID (PD)
![Page 13: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/13.jpg)
13
EXAMPLE. PLAIN DOCUMENT
Ctrl + N Ctrl + S Ctrl + S Ctrl + S
Build #1Properties: • Language (en)• Date (22-12-2010)• Revision (3)
Build #2Properties: • Language (en)• Date (24-12-2010)• Revision (4)
![Page 14: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/14.jpg)
14
DEMO EXAMPLE
![Page 15: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/15.jpg)
15
EMERGED QUESTIONS
Why open source repositories are not structured properly?
How to assign unique marker (version) for our changes?
What repository model should we use? How do we need to manage experimental
changes or development? What is initial codebase?
![Page 16: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/16.jpg)
16
BUILD MANAGEMENT
![Page 17: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/17.jpg)
17
WHY DO WE NEED TO MANAGE BUILDS?
Builds should be CRISPy!
CRISP means:
Complete
Repeatable
Informative
Schedulable
Portable
![Page 18: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/18.jpg)
18
HOW TO MANAGE BUILD PROCESS?
Define what build tasks you need
Define what build types you need
Choose build phases you will need
Choose build tool
Structure your build file
![Page 19: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/19.jpg)
19
HOW TO MANAGE BUILD PROCESS?
Define what build tasks you need
Define what build types you need
Choose build phases you will need
Choose build tool
Structure your build file
![Page 20: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/20.jpg)
20
BUILD TASKS BY PRIORITY
CompilationDeploymentDB integrationUnit testing Code coverage Static analysis Source code metrics Dynamic analysis Documentation generation …
![Page 21: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/21.jpg)
21
LET’S TALK ABOUT DIFFERENCES BETWEEN
BUILDS AND DEPLOYMENTS
![Page 22: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/22.jpg)
22
BUILD VS DEPLOYMENT
Deployment is the process of software installation (software system available to use)
While build is the process of installation artifacts creation
Is this always true? Not really For interpreted languages (no compilation phase)
there might be no significant difference between build and deployment
But it is more convenient to think of all related activities (unit-testing, code coverage, inspections, etc) as a build, not deployment.
![Page 23: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/23.jpg)
23
RESULTS OF THE BUILD
Executables .exe, .bin, .msi, .cab, …
Libraries .dll, .lib, .so, …
Archives .zip, .tar.gz, .bz2, .7z, .ear, .jar, .war, .sar, …
Packages .rpm, .deb, …
![Page 24: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/24.jpg)
24
RESULTS OF DEPLOYMENT
Installed application Updated database Added incremental changes Unpackaged library Loading and installing
dependencies …
![Page 25: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/25.jpg)
25
BUILD VS DEPLOYMENT
Runs on single machine
Does not require remote connection
Creates application installation
Makes sense always
Primary
Might be executed on several machines
Requires connection to the remote server
Installs application
Makes sense only in case of distributed or remote application
Secondary
Build Deployment
![Page 26: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/26.jpg)
28
HOW TO MANAGE BUILD PROCESS?
Define what build tasks you need
Define what build types you need
Choose build phases you will need
Choose build tool
Structure your build file
![Page 27: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/27.jpg)
29
BUILD TYPES
CLASSIFICATION BY:
Use
• Private (developers build)• Integration (centralized build)• Release (delivery to the end-user)
![Page 28: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/28.jpg)
30
BUILD TYPES
CLASSIFICATION BY:
Structure, stage, result
• Pre-build (ensuring zero build errors: checking space, clean, …)• Post-build (build verification tests, security tests, …)• Clean (rebuilding whole project from scratch)• Incremental (only changed files and artifacts)• Broken
![Page 29: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/29.jpg)
31
BUILD TYPES
CLASSIFICATION BY:
Staging
• Lightweight (recompilation, unit-tests, …)• Heavyweight (deployment, system tests, inspections, …)
![Page 30: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/30.jpg)
32
Define what build tasks you need
Define what build types you need
Choose build phases you will need
Choose build tool
Structure your build file
HOW TO MANAGE BUILD PROCESS?
![Page 31: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/31.jpg)
33
BUILD PHASES
BuildCompilationDeployment Inspections
Pre-buildClean InitCheck disk space
Post-buildDocumentation generationChecking build errorsSecurity testsTagging
![Page 32: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/32.jpg)
34
HOW TO MANAGE BUILD PROCESS?
Define what build tasks you need
Define what build types you need
Choose build phases you will need
Choose build tool
Structure your build file
![Page 33: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/33.jpg)
35
BUILD TOOLS
GNU Autotools
• make• automake• autoconf• autoheader• libtool• gettext• gcc • pkg-config
Autotools alternatives
• pymake• CMake• Cons• SCons• qmake• makepp• JAM• waf
![Page 34: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/34.jpg)
36
BUILD TOOLS
Java based
• Ant• Maven• Gant
.NET based
• MSBuild• Nant• Byldan• NMaven
Other
• Phing (PHP)• Rake (Ruby)
![Page 35: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/35.jpg)
38
GNU AUTOTOOLS
Did you build applications from sources on UNIX platform?
What steps did you need to accomplish this?1. ./configure2. make3. make install
When does actual compilation happens? Right. During make command execution make is the father of all build tools Heart of the build with make is the makefile
![Page 36: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/36.jpg)
39
GNU AUTOTOOLS MAKEFILE EXAMPLE
target1 target2 target3 : prerequisite1 prerequisite2command1command2command3
myprogram: main.o part1.o part2.o gcc -o myprogram main.o part1.o part2.o
part1.o: part1.c part1.h header.h gcc -O -c part1.c
part2.o: part2.c header.h gcc -O -c part2.c
main.o: main.c header.h gcc -O -c main.c
clean: rm -f myprogram main.o part1.o part2.o
![Page 37: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/37.jpg)
40
GNU AUTOTOOLS LIST
autoconf creates a configuration script for a package from a
template file From Makefile.in to Makefile
automake Creates template file from another template file From Makefile.am to Makefile.in
libtool helps manage the creation of static and dynamic
libraries gettext
internationalization and localization library gcc (GNU compiler collection)
default compiler used for building from sources
![Page 38: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/38.jpg)
41
APACHE ANT
Implemented in Java For the purpose of building java applications And for the purpose of make replacement
Advantages over make: Cross-platform, does not require buildfile
generation Resolves circular dependencies Works with file hierarchies Easily determines outdated files Conforms to “java way of thinking”
![Page 39: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/39.jpg)
42
APACHE ANT BUILDFILE EXAMPLE
![Page 40: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/40.jpg)
43
APACHE MAVEN
Convention over configuration Declarative execution Reuse of build logic Coherent organization of
dependencies
Principles:
Features: Project Object Model Extensive plugin architecture Predefined build lifecycle Dependencies management
![Page 41: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/41.jpg)
44
APACHE MAVEN BUILDFILEEXAMPLE
![Page 42: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/42.jpg)
45
MAVEN VS ANT
Description of project (convention over configuration)
Invocation of defined goals (targets)
Project knowledge build lifecycle, standard
project layout reusable plugins,
repositories
Development of a build script per project
Invocation of project specific targets
"Just" the build process too complex scripts
scripts are not reusable
Maven Ant
![Page 43: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/43.jpg)
46
HOW TO MANAGE BUILD PROCESS?
Define what build tasks you need
Define what build types you need
Choose build phases you will need
Choose build tool
Structure your build file
![Page 44: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/44.jpg)
47
BUILD FILE STRUCTURE
CompilationDeploymentDB integrationUnit testing Code coverage Static analysis Source code metrics Dynamic analysis Documentation generation …
compiledeploydeploy-dbrun-testscheck-coveragerun-inspectionsgather-metricsperformance-testsgeneratedoc …
Tasks Targets
![Page 45: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/45.jpg)
48
BUILD FILE TEMPLATE
![Page 46: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/46.jpg)
49
BUILD TYPES AND BUILDFILESTRUCTURE
Use types: private, integration, release
![Page 47: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/47.jpg)
50
LOCAL BUILD VS PRIVATE BUILD?
Local build:CompilationUnit-testing
Private build:CompilationDeployment Database integrationLoading initial dataUnit-testingSimple static analysis
What is the difference?
CompilationDeployment Database integrationLoading initial dataUnit-testingSimple static
analysis
Omitting unnecessary steps:
![Page 48: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/48.jpg)
51
LOCAL BUILD
CompilationDeployment Database integration
Loading initial dataUnit-testingSimple static analysis
Local build is required after minor source code changes for the purpose of having executable artefact
ant compile run-tests
![Page 49: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/49.jpg)
52
PRIVATE BUILD
CompilationDeployment Database integration
Loading initial dataUnit-testingSimple static analysis
Private build assumes that changes should be deployed to the application container or web-server
ant compile deploy deploy-db load-data run-tests inspections
![Page 50: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/50.jpg)
53
PRIVATE BUILD
![Page 51: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/51.jpg)
54
INTEGRATION BUILDIntegration build assumes presence of continuous integration practice as a key part of software lifecycle
CompilationDeployment Database integration
Loading initial dataUnit-testingStatic analysisDynamic analysisDocumentation generationGathering metrics
![Page 52: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/52.jpg)
55
INTEGRATION BUILD
![Page 53: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/53.jpg)
56
RELEASE BUILDRelease build is the result of development will be visible to the end user
CompilationDeployment Database integration
Loading initial dataSecurity testsintegrity checksperformance tests
![Page 54: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/54.jpg)
57
RELEASE BUILD
![Page 55: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/55.jpg)
58
DEPLOYMENT MANAGEMENT
![Page 56: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/56.jpg)
59
DEPLOYMENT TYPES
Staticwhen the container starts
HotAbility to deploy/undeploy deployables into a
running container Incremental
Deploying only changed files/artifacts Remote
Requires connection via specified protocol Local
Does not require connection
![Page 57: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/57.jpg)
60
DEPLOYMENT PROTOCOLS
FTP/SFTP
SSH/SCP
Rsync No protocol (copy/move)
Mail/e-mail (!)
![Page 58: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/58.jpg)
61
DEPLOYMENT PHASES AND TASKS
DeploymentDeployRestart application server
Database integrationGenerate ORM models, mappingDump data Instantiate DB (DDL usage)Data load into DB (DML usage, CRUD
operations)Migrate data, structure or both
![Page 59: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/59.jpg)
62
INCREMENTAL DEPLOYMENT
Rsync synchronizes files and directories from one location
to another SVN export only changed files
svn diff –summarize /path1 /path2 Deploy only files modified/added since last
revision svn status
In most cases it’s just a…
HEADACHE!
![Page 60: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/60.jpg)
63
SIMPLE DEPLOYMENT WORKFLOW
WC (working copy, trunk)
dbinstance
local deployment
![Page 61: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/61.jpg)
64
LOCAL DEPLOYMENT WORKFLOW
WC (working copy, trunk)
dev db test db prod db
dev instance test instance prod instance
local deployment
![Page 62: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/62.jpg)
65
REMOTE DEPLOYMENT WORKFLOW
65
WC (working copy, trunk)
local deployment
dev
+
test
+
prod
+
dev
+
test
+
prod
+
remote deployment
![Page 63: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/63.jpg)
66
MANAGE YOUR DEPLOYMENTS
1. Define what deployment type you will use (inherits from corresponding build type)
2. Define what deployment tasks you need3. For each deployment type prioritize
chosen tasks4. Define destinations (production, test,
development)5. Map destinations and deployment types6. Configure deployment destinations
environment
![Page 64: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/64.jpg)
67
DEVELOPMENT WORKFLOW EXAMPLE
![Page 65: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/65.jpg)
68
DEVELOPMENT WORKFLOWEXAMPLE
WC (working copy)Deployed application Repository
svn up
ant deploy-private
Second deployed application
changeset (#146)
manual merge
r1049
r1050
r1051
r1052
…
r1126svn up
ant deploy-private –Dinstance=2 resolve conflicts
development
OK?no
yessvn commit
manual mergemake correctionssvn commit
![Page 66: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/66.jpg)
69
DEVELOPMENT WORKFLOW EXAMPLE NOTES
Does this example remind you something? Yes! Distributed version control What is the point? Svn working copy is the repository While deployed application is a working
copy Difference is that all operations between
‘repository’ and ‘working copy’ are manual And operations history is not tracked
![Page 67: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/67.jpg)
70
DEVELOPMENT WORKFLOW EXAMPLE NOTES
Why do we need two builds? To ensure there are no integration errors Because of “Don’t break the build“ ruleAdvantages: You see your source code many times during merge You can find errors/inconsistencies easily Keeping unfinished development both safe and
actualFlaws: A lot of time spent before commit Works only for web-projects written in interpreted
languages
![Page 68: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/68.jpg)
71
CONCLUSION
![Page 69: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/69.jpg)
72
BEST PRACTICES
Separate build from IDE Run faster tests first
Introduce staging into build process Fail build fast
Organize build targets by priority Build components separately
Recursive build Centralization of project assets
Put sources to sources (VCS) Put binaries to binaries (dedicated repositories)
Consistent directory structure Develop project structure conventions
![Page 70: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/70.jpg)
73
BUILDS AND DEPLOYMENT MANAGEMENT1. Define what build/deployment tasks you
need2. Define what build types you need3. Choose build/deployment phases you will
need4. Prioritize chosen tasks with regard to
corresponding build types5. Choose build tool6. Structure your build file7. Define deployment destinations8. Map build types and deployment
destinations9. Configure deployment destinations
environment
![Page 71: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/71.jpg)
74
RECOMMENDED READING
1. The Build Master: Microsoft's Software Configuration Management Best Practices By Vincent Maraia
![Page 72: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/72.jpg)
75
RECOMMENDED READING
2. Ant: The Definitive Guide, 2nd Edition by Steve Holzne
![Page 73: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/73.jpg)
76
RECOMMENDED READING
3. Maven: The Definitive Guide by Timothy M. O'Brien
![Page 74: 02 - Build and Deployment Management](https://reader035.fdocuments.in/reader035/viewer/2022070316/555a00f6d8b42aa8098b4e76/html5/thumbnails/74.jpg)
77
USEFUL LINKS
1. http://freshmeat.net/articles/build-and-release-management - Build and release management
2. http://onjava.com/pub/a/onjava/2003/12/17/ant_bestpractices.html - Ant best practices
3. http://www.sonatype.com/books/mvnref-book/reference/public-book.html - Maven complete reference
4. http://repo.exist.com/dist/maestro/1.7.0/BetterBuildsWithMaven.pdf - Great book about Maven
5. http://kent.spillner.org/blog/work/2009/11/14/java-build-tools.html - Ant vs Maven
6. http://martinfowler.com/articles/rake.html - article about rake by Martin Fowler
7. http://www.finalbuilder.com/finalbuilder.aspx - FinalBuilder home page