oded lachish room: mal 405 visiting hours: wednesday 17:00 to 20:00 email: [email protected] module...

Click here to load reader

Upload: houston-gartin

Post on 29-Mar-2015

221 views

Category:

Documents


4 download

TRANSCRIPT

  • Slide 1

Oded Lachish Room: Mal 405 Visiting Hours: Wednesday 17:00 to 20:00 Email: [email protected] Module URL: http://www.dcs.bbk.ac.uk/~oded/Tools2012-2013/Web/Tools2012-2013.html Introduction to Software Engineering: Tools and Environments Session 10 1 Slide 2 Last time 1.Documentation tools Doxygen and eUML2 2.Code generation tools eUML2 3.Ant revisited 2 Slide 3 Tools Side Dish EnvironmentVariables 3 Slide 4 Environment Variables 4 How did eclipse know where to find java Scan the directory structure (bad idea, why?) Environment variables Probably all operation systems have environment variables. Environment variables can be accessed by running processes Environment variables are also play a significant role in the operation of the OS Slide 5 Important - Environment Variables 1.PATH list of directories to look for executables 2.JAVA_PATH location of the Java related files 3.ANT_PATH location of the Ant related files 5 Slide 6 Setting - Environment Variables Windows Right click 6 Left click Slide 7 Environment Variables - 7 Left click Slide 8 Environment Variables - 8 Left click Slide 9 Environment Variables - 9 You can add new system variables and edit existing ones Slide 10 Installing Ant and Setting Environment Variables URL to download from http://ant.apache.org/bindownload.cgi Download: apache-ant-1.8.2-bin.zip Store contents in C:\ So C:\apache-ant-1.8.2 exists 10 Slide 11 Setting Ant Environment Variables Set ANT_HOME to 11 First left click Slide 12 Add Ant to Path Environment Variables 12 First left click Semi colon separates directories in list, add ; C:\apache-ant-1.8.2\bin at the end of the list Slide 13 Java Server and Servlets 13 Slide 14 Why do we need Javaserver and Servlets 14 1.We are going to install Jenkins 2.Jenkins is used through a browser 3.Jenkins uses dynamic page generation 4.The standard browser does supply a sufficient environment for this goal 5.Jenkins requires a Javaserver for this goal 6.We shall use Tomcat as our Javaserver and run Jenkins a java servelet (an extension to Tomcat) Slide 15 Download Tomcat 15 URL to download from http://tomcat.apache.org/download-60.cgi Download: 32-bit/64-bit Windows Service Installer Execute (select all components) Slide 16 Tomcat Installation User Name and Password 16 Fill-in Make sure you remember this we will need it Slide 17 Tomcat Installation Java Virtual Machine 17 Make sure correct Slide 18 Tomcat Destination 18 Remember, will be useful Slide 19 Apache Tomcat 19 Left click Slide 20 Apache Tomcat Server Status 20 Left click Slide 21 21 This shouldnt be there at this stage Slide 22 Next Stage 22 Slide 23 Until now We have covered many SDLC tools from a single developer s point of view. 23 Local Individual Developer Integration Collected work of Individual Developers Testing QA team Environment Project point of view (large project) From here on Slide 24 Single Developers Tools 1. light weight 2.Easy to learn 3.Integrated with IDE 4.Trivial to install and set 5.Massive number of available tools 24 Project Scale Tools HEAVY 1.HEAVY 2.Easy to learn? 3.Require their own server 4.Installation may require significant effort 5.Relatively small variety of tools Slide 25 Continuous Integration 25 Slide 26 Integration Where all the code goes to (and also the unit tests) When things go wrong here the price is high This is the reason the focus is on minimizing the damage when things go wrong 26 Slide 27 Continuous Integration Integrate code as soon as possible. Why? Each time only a small portion of code is added or changed. Why? Problems are detected earlier Easier to find the problem 27 Slide 28 Jenkins 28 Slide 29 What is Jenkins A crucial element in continuous integration has two main goals: 1.Continuously build and test software projects 2.Monitor externally run jobs 29 Slide 30 Work Flow with Jenkins A team member/ members commit code to source control repository 30 Jenkins detects that new code has been committed Jenkins uses Build Tools to build the project and Test tools to test the project Jenkins uses the resulting files to generate reports Jenkins send notification if anything went wrong (build, test failed etc.) Slide 31 Jenkins as Part of the Big Picture Easy installation: java -jar jenkins.war, or deploy it in a servlet container. No additional install, no database. Easy configuration: can be configured entirely from its friendly web GUI with extensive on-the-fly error checks and inline help. There's no need to tweak XML manually anymore, although if you'd like to do so, you can do that, too. Change set support: can generate a list of changes made into the build from Subversion/CVS. This is also done in a fairly efficient fashion, to reduce the load on the repository. 31 Slide 32 Jenkins as Part of the Big Picture Permanent links: Jenkins gives you clean readable URLs for most of its pages, including some permalinks like "latest build"/"latest successful build", so that they can be easily linked from elsewhere. RSS/E-mail/IM Integration: Monitor build results by RSS or e-mail to get real-time notifications on failures. JUnit/TestNG test reporting: JUnit test reports can be tabulated, summarized, and displayed with history information, such as when it started breaking, etc. History trend is plotted into a graph. 32 Slide 33 Jenkins as Part of the Big Picture Distributed builds: Jenkins can distribute build/test loads to multiple computers. This lets you get the most out of those idle workstations sitting beneath developers' desks. File fingerprinting: Jenkins can keep track of which build produced which jars, and which build is using which version of jars, and so on. This works even for jars that are produced outside Jenkins, and is ideal for projects to track dependency. Plugin Support: Jenkins can be extended via 3rd party plugins. You can write plugins to make Jenkins support tools/processes that your team uses.3rd party plugins 33 Slide 34 Jenkins as Part of the Big Picture An easy to configure tool that is responsible for the following: 1.Make sure that everything that should be executed is executed when and as soon as possible 2.Collect all the information and process it into coherent reports (imagine have 10 different tools each with its own report) 34 Slide 35 Jenkins Leg Work 35 Slide 36 36 Jenkins .war file jenkins.war Slide 37 37 What to do with the.war file Slide 38 Jenkins Nice to Meat You 38 Left click Slide 39 Jenkins Plug-ins 39 Left click Slide 40 Jenkins Plugin manager 40 Left click Slide 41 Jenkins Git Plugin Installation Success 41 Slide 42 Jenkins Leg Work New Project 42 Slide 43 Jenkins new project 1.Write a new Java project 2.Add an Ant build script to the project 3.Store the project in a Git repository 43 Slide 44 Jenkins New Job 44 Left click Slide 45 Jenkins New Job 2 45 Fill in Select Slide 46 Jenkins New Job Top 46 Fill inSelect Slide 47 Jenkins New Job Middle 47 Select Update to your git repository Slide 48 Jenkins New Job 48 Left click Update Slide 49 Jenkins New Job (actually after) 49 Left click Slide 50 Jenkins Build Page 50 Left click Slide 51 Jenkins Console Output 51 Left click Slide 52 Jenkins Git Build Data 52 Slide 53 What Happened After First Build? 53 1.Jenkins Cloned the Project 2.Jenkins used the Ant script to build the project Slide 54 Other Things we Could have Done 54 Slide 55 Jenkins Leg Work Triggering a Build 55 Slide 56 Jenkins When to Build? 56 1.Can be done manually (as we already did) 2.Can be done in fixed intervals in general this is not recommended 3.Polling build when the project changed Slide 57 Jenkins Triggering a Build (project configure) 57 I think this should get it to poll every minute Check it out Slide 58 Jenkins Git Polling Log 58 Slide 59 Jenkins Build History 59 Slide 60 Jenkins Leg Work Other Features 60 Slide 61 Jenkins RSS 61 You can use RSS to get updated Left click Slide 62 Manage Jenkins 62 Slide 63 Configure Jenkins 63 Slide 64 Can execute concurrent builds guess where? Configure Jenkins e-mail notification 64 You can use e-mail notification to get updated You can change the URL