hi my name is Julio Cal and in this
video I will show you how to prepare a
continuous integration build using
visual studio 2010 team Foundation
server 2010 and team build 2010 remember
we are using beta 2 of all these
products so now that you have coded and
tested your product like this bookstore
application we prepared and you must
make sure that you do have something to
show to your customers all the time and
this can be difficult when your team is
made up of more than one developer as
any developer can potentially introduce
new bugs at any time into your product
cycle So to avoid this there's this
methodology or good practice more like
that H that we call continuous
integration where each time a developer
checks in some code h a new build is
performed in some other machine that is
not really any developer machine okay so
let's see how this works let's go to to
visual studio
2010 okay and this time let's log in as
the project
manager this is because we will need
some additional permissions that that a
developer doesn't have in order to
create and a new build definition let's
close this okay let's load the
solution the bookstore
solution
okay right now just loading and it is
here okay so now let's go to Team
Explorer open the build uh note right
click and select new build definition
this opens a new dialogue in the main
center of the screen where we need to
enter some
information so this build definition
will be called books let's call it
bookstore continuous integration and for
description this is the continuous
integration build okay now let's go to
trigger what will trigger this uh this
build will be a a developer check in so
we will select continuous integration
and as I said that means that anytime a
developer checks in some code a new
build will be performed into the server
so that means that the server will get
all the source code from all the
developers machine and it will be start
a new build building all the the the
dlll the assemblies in the application
there are some other options as you can
see you can select a schedule if you
want to prepare this uh this build to be
automatically uh executed for example
each Monday Tuesday and every day in the
week at 3:00 a.m. if you want to do this
automatically you can also select get a
checkin if you want this is a new option
in 2010 very interesting if you want to
actually um you know each developer
checks in some code but the code is not
actually placed in the main source code
but it is actually sheld into a
temporary location a build is intended
to be done and if if it can be done uh
the check-in is completed if it cannot
be done the checkin is not allowed at
all so that actually prevents more the
any developer from introducing new box
into the application for this example
we'll just use continuous integration so
that at least with alert us if any
developer breaks the the build at any
time let's go to workspace this will we
will just use um the defaults for this
let's go to build defaults here you must
select the build controller this is the
the actual uh build machine as I said
this is another machine not any
developer machine a server where the
build will be will be performed and you
can also have and configure in your team
Foundation server if you want to have
more than one machine like agents if you
want to somehow distribute the build
effort among more than one ser
here you must also specify the build up
output directory so this is just some
Network share anywhere in your network
where the team Foundation service
account has right permissions I have
already prepared um a directory for this
in uh Team Foundation server you can see
here DFS build
output and we will just use uh this
directory for building the application
okay let's copy
this and paste it
here so now that we have this let's go
to process in process you you can
specify some other options like for
example what do you actually want to
build so for example here you can
specify which would be the the platform
and configuration that you want to build
so you can select from among the
different platforms and different
possible configurations or you can just
use defaults as we will do right now you
can specify which is the project or
solution to build and you can also
specify if you want to run all the tests
into the build so this means that any
unit test and any ER other automated
test that your testing team prepared for
this solution can also be run uh into
the the build so this means that even if
a developer doesn't actually break the
build he might um he might prevent a
test to run and if if this happens this
is also not good and that can also stop
the build and alert at any person in the
team that this is happening okay which
is very useful you can also specify the
the build format this means that you can
specify how will each folder into your
uh build server be named for each of the
builds like for example the the default
one specifies that it will use the the
build definition name bookstore uh
bookstore CI H it will use the year then
the month and then the day and finally
uh build revision if you do more than
one in a single day you can also use
some macros here if you want to specify
a different total different different um
format string for the build
name okay if we go to retention policy
you here you can specify H how much time
you want to keep these builds into your
server so this means that for example
for failed builds you can say hey I want
to keep the 10 latest builds I want just
to keep to maybe five latest builds
because I don't really care about failed
builds okay so let's save this you can
see the new build definition is right
here I can right click select Q new
build and from here I can just manually
trigger a build but as this is a
continuous integration uh build I will
prefer to do this from a a a developer
trigger you know a developer changing
some source code and triggering the the
build so I will just cancel this exit
visual studio and let's go to visual
studio once
again this time logging into team
Foundation server as a
developer so let's log in as a developer
let's open the
solution and what we're going to do
right now is just a very small very
simple change to the source code and
then check it check it in just to make
sure that um the build is triggering so
let's open the business project the book
class and let's enter some comment
here this is the book type let's close
this let's build the solution make sure
that we're uh actually checking in some
buildable uh code okay it's good let's
check in for checking in we should
always select a work item associated
let's select the build the book list
screen which is the appropriate one
check
in so as soon as the check-in
finishes team build H detects this
check-in and will trigger a new build so
if we double click in bookstore. C any
developer can see the status of of a
build for sure we can go to the cute
builds and you can see that the
developer just triggered a new build at
533 which is right now now okay let's
double click
this and you can see in this screen you
can see the status of the build okay as
it is performed you can see the current
time right now the the running time you
can see what is Team build actually
doing it just got the build updated the
drop
location okay updated the build
number okay initialize it okay
initialize it the sources initialize it
the workspace
added a new label which is also very
useful a new label for this build it is
trying to compile test and Associate
change sets so first let's compile okay
it is
compiling okay then it is actually
trying to perform all the tests the unit
test we have two unit tests in this
solution and later it will try to
associate any change sets and work items
for this okay so you you can say h for
example this task and this source code
is associated to this new build okay
it's very good for
tracking
okay okay so it just finished it and the
new build is complete you see all test
pass it and everything built with not
errors and this is our new build just
completed okay thank you very much hope
you liked it see you again
No comments:
Post a Comment