#105 Continuous Integration with Travis CI


Using Continuous Integration, you can perform tasks and run your tests automatically whenever you commit your code. Travis CI offers free Continuous Integration for open source projects.
rails test ci/cd 10:39
  • Student & Teacher
  • $9.00 / month
  • Valid School Email Required
  • Same Access as Pro
  • Subscribe Now
  • Pro Membership
  • $15.00 / month
  • Access to Pro Episodes
  • Invite to Slack Channel
  • Priority Episode Suggestions
  • Ad Free
  • Subscribe Now
  • Teams
  • starts at $75.00 / month
  • 5 Users Minimum
  • $15.00 / user / month
  • Same Access as Pro
  • Subscribe to Teams
there are turning to ah to add a turn around and learned lessons but in the luggage fantasy island which can be used for continuous integration a continuous integration will take all the test cases they get built for your application and run them automatically whenever you can make a code up to your code repository a continuous integration to do other things like it are your application for deployment they could also do things like running great men or or some other kind of checks to make sure the rats not honorable or really any tennis with the you need what's a good it's been pushed up they have a free version which is used for open source for pas glorious got a travesty i see i got bored if you winning is travis with a private repository they you'll need to use travis dash see i got calm and sign up for a pay plan the personal do is create a new repository i'll give the repository name then a quick we were possible it all then follow the instructions and i'll push up by good to this remote repository so from within the root of the rails application i can write get in it to create a yankee repository and then i can add all the files for this commit all then just put a gig commenced and then pass in a message we've been copying page from our previous green bay command to add the origin or remote repository illegal called get published dash you origin and then master that she would just basically remember there were always referencing the war did unless specified they were pushing the master branch the seabed successfully uploaded know he'd go check out a repository and then visiting there get a page he tells me that we have our code uploaded and with tenure the way that we're going to interact with travis is by creating a doc file called travis tag at all but first let's go i think it is repository connected with travis so when travis is website and i am using the dot org because this is a open source repository offers clicks on him with get up get help will then asked me about one oh well travis access to my account it will also as which organisation of money give access to this case we're just going is like a drifter ready to watch out for is travis we kinda wonder our accounts in a weekend find our repository that we want to use in here even see that we have er one repository and i'm going to just quit this but in this whole wow travis still automatically connect with get up and listen for any kind of what books would ever done is committed so once we had this enabled we may create our diet travis i yell whole file whenever we push ups are good to get up travis will automatically receive brooke was from get out an all-star broadening our task so the first thing that we need to do is create a new file will call the stock travis by gamble and this application is the exact same as what we had before her previous episode one of three with the exception that have considered this application to use the data base my sequel to do so we can see what it looks like integrating with other services and it's important to note that hey i'm new to my thing called you and i do have the test setup in my database name for the ten set up is template underscored past and my user name is travis and have not specify the password and also make sure they never include your production secrets within your database him wallflower order cigarettes here will file by your uses something like environment variable or something else in the first day i'm going to do this but why would this should be should not be using and i like the dish abuse interesting which this is jessica name for ubuntu fourteen zero four it really doesn't matter too much unless of yes i'm really specific things within your application most general applications should work regardless but i do like trusted because i am i getting in ten in all says we'll see later use in the car and driver would just be easier that's needed for cap the bars perhaps we didn't specify what language will be using with the wing which it will just say would be that we need to specify what would be version of making his r v l st two point three point three eventually applications wanna run off of or fear creating a gem anyone it has a cause small tumbled would be versions you just keep adding in different versions as you need and then that many times will run with any dissenting services this is where you get the dependencies like read as a lesson search or even my sequel to the wii he's able for install script and within a year as been up obama and for no that's just a call them my sequel command more like execute create databases if not exist then the name of our database so we're using that we get into the actual part of our sweat or we will actually be executing are are spent so we came the script in here you wanna make sure they you combine all exact because it all have trouble finding a ruby version of the ones they weekend call rails tv migrate just make sure that we have any migrations there we gave me is best for rails of our mayor will set it to test the evening call bottle exactly getting this time we're just gonna call for spec so once we had these changes made this call him push them up and see what happens when one gets dennis weekend sierra modified files we ever when travis so yeah mall the weekend and is filed in there we're going gets as again everyone is he that we have in a flower beds ready to be committed that we can make this and i'll just put a note added adams was we may vary kick him a message weekend pushes up and it'll now be uploaded to get out so now that we have to park and uploaded this guy there we've fractures going and it could take it a few minutes to actually appear before an ulcer running and now that we see them we got our repository running in assembly attuned number one builds we have the goblin and got to match for our differ would be versions we can click on one of these know we can see the schooling long it's now running our bond all the net and said it's in solving all gym center for this application and this could take a while especially if you're having twins also be like no good gary every time and travis as said the school would open at the top which will follow the logs sidonia to keep scrolling bleak you to sleep the screen alone the nest but at this video of it but you can get the idea we can see the total time taken and then it's running the testing he said that we have a few failures and so our failures is that i was unable to find the prom driver so we're going now have to install this ourself and if you see here it took about five minutes to run both of those tests and each test took about two and a half minutes to ron wherever they did both male and it's because then we need to install the chrome driver the one the best resources if you need to figure out how to integrate something with travis or how to download and saw something then go under the help and read the docks so on or before in salzburg i just have this debbie get in then it points to this chrome driver for linux sixty four bit weak and then unzip this file that we wanna move it to where it can be used by air says i'm working copy the chrome driver that we copied to the user local bin folder we then call sybil c h mart class acts which would change a permissions on the file to make it executed all day weekend specified before that local band in chrome drivers as good and say this file and that their terminal being called gay commit that shit they failed because we've already added the travis while it'll automatically add it with the commit that shake the weekend so put in our message at it from driver to travis air we get pushed the set i'm back at travis with your weight and refresher swing periodically we should see it automatically start working on d bil number two and so now we have are and it can it hey we see our message at a chrome driver to travis was gliding go back into one of these they'll look as quickly follow all the men in his speed this up all over it isn't salim the gems again that could take it sometime there is creating our database know it's running the tests no we have all passing tests if we go back to work at that age at the top we can click on the ten minutes you can automatically see that we have exploited travis build an old but then our know when we're we ended up on driver it's a passing past so with our build we can see that it took it still ten minutes to run and alice eve we can get that spent a penny one day he's using so we can do with this this call cash finance just as five bummer this'll make sure that we we user bottle gems each time it's it's own so any new gems as they are needed and then back when travis once we get or build we can go into the near week and see if it's going to catch her gems and seven for saddam it is going to have to reinstall the gems so we're gonna go ahead and just what that bra and bob one cool thing that they do offer is a badge and if we click on this badge we can see that it's gonna look at the master branch that we could change which cannot for many that we want our kids were banned to set the mark down and i'm glad they caught us and added to my relief while so that we we thought op they stay in the beds were ever procreate typically it's towards the top we can save as they can enter naked and without even more fresh in your screen and are repositories we see that bill number for automatically started this was where we ended our bench to the brig me to get fade every penny commit to the master branch or any branch is going to run the travesty on and so now you can see that see using all of the existing gems it didn't have to reinstall though it's as speed of protests wait quite a bit and so looking at our jobs this last one it completed in just under a minute whoa that's all for this episode they keep watching