1 00:00:01,280 --> 00:00:07,210 Okay, so what we have now is a fairly advanced program. 2 00:00:07,210 --> 00:00:09,096 That's gonna really test some of your skills, 3 00:00:09,096 --> 00:00:12,510 no I'm just kidding, it's a simple calculator example here. 4 00:00:12,510 --> 00:00:16,810 And if we just go take a look at the implementation here we look at main. 5 00:00:16,810 --> 00:00:22,200 Look at the calculator we're gonna see it does some things that you know how to do. 6 00:00:22,200 --> 00:00:28,170 And if we pop out here it also has tests because you should always write tests. 7 00:00:28,170 --> 00:00:28,900 Here they are, 8 00:00:28,900 --> 00:00:32,330 there are some tests, verifies that things are working as they should. 9 00:00:33,630 --> 00:00:35,740 What I'm gonna do is I'm wanna fork this and 10 00:00:35,740 --> 00:00:39,010 if you wanna follow along you can too there's a link in the teacher's notes. 11 00:00:39,010 --> 00:00:42,790 I'm wanna fork this to my own personal account which is what you can do. 12 00:00:42,790 --> 00:00:47,470 And I'm going to go ahead and I'm going to grab the Clone URL. 13 00:00:47,470 --> 00:00:51,790 When I pop over to my IntelliJ and I'm gonna check out from Version Control and 14 00:00:51,790 --> 00:00:54,010 check out from GitHub. 15 00:00:54,010 --> 00:00:57,090 I have a two factor authentication turned on you might not need this. 16 00:00:57,090 --> 00:01:01,380 Don't worry about it if you don't see the screen, and now I'm going to go ahead and 17 00:01:01,380 --> 00:01:06,120 just paste in the URL that I saw you and we're gonna get that down here locally. 18 00:01:06,120 --> 00:01:07,640 And since it's a great all. 19 00:01:07,640 --> 00:01:12,540 Should know that's great. 20 00:01:12,540 --> 00:01:13,710 We're gonna go ahead and click finish. 21 00:01:13,710 --> 00:01:19,337 And the project is all here and 22 00:01:19,337 --> 00:01:24,522 we should be able to build. 23 00:01:30,651 --> 00:01:34,102 If we click here and we do this and we'll go ahead and 24 00:01:34,102 --> 00:01:38,759 build everything here and if we jump in here and run our Gradle check, 25 00:01:38,759 --> 00:01:42,820 we'll see that all of our test pass, awesome. 26 00:01:42,820 --> 00:01:43,960 Okay, so now that it's working. 27 00:01:43,960 --> 00:01:46,860 Let's go ahead and flip over to our Travis CI, 28 00:01:46,860 --> 00:01:50,130 and I'm gonna go ahead and click Sync Account. 29 00:01:50,130 --> 00:01:53,130 Again, I was up here under My Account. 30 00:01:53,130 --> 00:01:57,300 Now we see that my Java calculator is ready, I'm gonna go ahead and click it. 31 00:01:57,300 --> 00:02:01,150 Okay, so believe it or not we're all ready now. 32 00:02:01,150 --> 00:02:05,470 One thing that we need to do is we need to build that .Travis yml 33 00:02:05,470 --> 00:02:07,020 file that we had discussed. 34 00:02:07,020 --> 00:02:09,080 And if you come down here to Documentation, 35 00:02:09,080 --> 00:02:13,000 and you scroll down here, it talks about Language-specific Guides. 36 00:02:13,000 --> 00:02:14,940 And this is pretty awesome you can see that it does it all for 37 00:02:14,940 --> 00:02:16,370 all these other languages. 38 00:02:16,370 --> 00:02:19,270 We're gonna click on the Java one here. 39 00:02:19,270 --> 00:02:21,990 And the important thing to note here is that 40 00:02:21,990 --> 00:02:25,860 we're gonna have this language.java and let's just go ahead. 41 00:02:26,950 --> 00:02:28,290 Let's start that in our IntelliJ. 42 00:02:32,200 --> 00:02:37,066 We come into here and do a new file called .travis.yml, 43 00:02:37,066 --> 00:02:41,050 okay that's yml, you had another markup language. 44 00:02:42,340 --> 00:02:45,000 And we wanna automatically add to get. 45 00:02:45,000 --> 00:02:46,790 Wanna closer Gradle window here and 46 00:02:46,790 --> 00:02:50,020 with that said that we needed to do there we'll language Java. 47 00:02:50,020 --> 00:02:52,280 I'm wanna save that. 48 00:02:52,280 --> 00:02:54,660 Okay, language Java is what we need. 49 00:02:54,660 --> 00:02:57,287 It has a really nice default, like if you're running mvn, 50 00:02:57,287 --> 00:03:00,090 it has automatic things that you would normally do. 51 00:03:00,090 --> 00:03:02,610 We normally use Gradle here on our courses. 52 00:03:02,610 --> 00:03:04,550 It's gonna run Gradle check which is the test. 53 00:03:04,550 --> 00:03:08,440 It also runs Gradle assemble which we saw over there, just kind of working. 54 00:03:08,440 --> 00:03:12,250 Also if you run ant and there's dependency management and you can test against 55 00:03:12,250 --> 00:03:16,990 multiple jdk's, and let's go ahead and add the jdk that we specifically want. 56 00:03:16,990 --> 00:03:18,390 We want the Oracle jdk, right? 57 00:03:18,390 --> 00:03:20,320 We've been using jdk8. 58 00:03:20,320 --> 00:03:22,714 Back in our yml file. 59 00:03:22,714 --> 00:03:27,256 We'll add jdk:. 60 00:03:27,256 --> 00:03:28,104 And then we'll tab in. 61 00:03:28,104 --> 00:03:33,772 And this is kinda how you do arrays in this yml language. 62 00:03:33,772 --> 00:03:35,618 Oraclejdk8. 63 00:03:35,618 --> 00:03:36,303 Okay. 64 00:03:36,303 --> 00:03:37,779 That looks good. 65 00:03:37,779 --> 00:03:39,638 Now what we're gonna do. 66 00:03:39,638 --> 00:03:44,790 We have our Travis is already set up, I'm gonna go into Version Control here. 67 00:03:44,790 --> 00:03:51,030 And when we do this push, it should automatically, let's say Setup for 68 00:03:51,030 --> 00:03:56,000 Travis CI and go ahead and do Commit and Push. 69 00:03:57,120 --> 00:03:59,950 And we'll go ahead and Push that file in. 70 00:03:59,950 --> 00:04:03,690 It's gonna go ahead and trigger a build over a Travis. 71 00:04:03,690 --> 00:04:05,430 Let's take a look and see what's happening. 72 00:04:05,430 --> 00:04:07,060 If we come back to our home here. 73 00:04:07,060 --> 00:04:12,750 I have some other repositories that have been running as well and 74 00:04:12,750 --> 00:04:16,020 I come to My Accounts and I click Java calculator. 75 00:04:16,020 --> 00:04:18,635 Currently it says there's no build going on let's take a look. 76 00:04:18,635 --> 00:04:19,885 Under branches here. 77 00:04:19,885 --> 00:04:22,435 Here it's building it just wasn't showing it just yet. 78 00:04:22,435 --> 00:04:24,235 This is kind of slick, so what happens? 79 00:04:24,235 --> 00:04:26,515 Is you get to see what's actually happening. 80 00:04:26,515 --> 00:04:28,665 You'll see that when it gets into the state where you can actually 81 00:04:28,665 --> 00:04:31,835 see stuff that pops in over here over my repositories. 82 00:04:31,835 --> 00:04:36,295 Okay, is going to walk through all of the information down here of what's going on 83 00:04:36,295 --> 00:04:39,495 in this is again happening because we pushed that file up. 84 00:04:41,080 --> 00:04:44,010 It's setting up the VM just like it needs. 85 00:04:44,010 --> 00:04:46,330 This gets faster over time and 86 00:04:46,330 --> 00:04:50,230 as this this goes up it will start collapsing things for you. 87 00:04:50,230 --> 00:04:52,570 I'll show you here in a bit after, see it collapsed. 88 00:04:52,570 --> 00:04:55,100 You have more information here should you need it, but 89 00:04:55,100 --> 00:04:59,060 it's gonna show you the things that's most interesting to you. 90 00:04:59,060 --> 00:05:02,325 Here it is, it's running the gradle assemble, it's gonna go ahead and download 91 00:05:02,325 --> 00:05:05,720 gradle just like somebody might if they didn't have gradle on their system. 92 00:05:05,720 --> 00:05:09,160 And remember, this is exactly like what you would be doing on your machine. 93 00:05:09,160 --> 00:05:12,910 But this is happening on the service, you normally wouldn't be watching this. 94 00:05:12,910 --> 00:05:15,740 Just kinda wanna show off what is happening here. 95 00:05:15,740 --> 00:05:17,080 All right, it's got gradle installed. 96 00:05:17,080 --> 00:05:18,587 It's gonna gradle assemble and 97 00:05:18,587 --> 00:05:22,440 if the build passes which it should because of past locally, right? 98 00:05:22,440 --> 00:05:25,660 Goes compiling, boom that popped out and then the check happened and 99 00:05:25,660 --> 00:05:30,540 then when it's all said and done, let's run our test right now. 100 00:05:30,540 --> 00:05:33,930 After it goes ahead downloads the dependencies, right? 101 00:05:33,930 --> 00:05:36,190 Boom, build successful. 102 00:05:36,190 --> 00:05:39,710 It has turned green and now if I look at the Current here, 103 00:05:39,710 --> 00:05:43,730 it shows me that we have a working build at the moment. 104 00:05:43,730 --> 00:05:46,130 That's pretty awesome, right? 105 00:05:46,130 --> 00:05:50,630 I just got an e-mail that had I set this up to connect the slack, 106 00:05:50,630 --> 00:05:53,620 I also would have got notified in my slack room this is happening. 107 00:05:53,620 --> 00:05:56,370 Now, one thing that is powerful, and you've probably seen 108 00:05:56,370 --> 00:05:59,040 these around the internet as you work on open source projects, 109 00:05:59,040 --> 00:06:00,590 cuz you work on open source projects, right? 110 00:06:01,600 --> 00:06:02,670 Are these badges. 111 00:06:02,670 --> 00:06:05,520 If you click on this here you can actually build a new badge. 112 00:06:05,520 --> 00:06:08,490 We wanna say for the branch master we wanna make sure, 113 00:06:08,490 --> 00:06:10,210 let's do grab Markdown here. 114 00:06:10,210 --> 00:06:12,490 Let's go ahead and copy this. 115 00:06:12,490 --> 00:06:15,248 I'm gonna pop over to my README here. 116 00:06:15,248 --> 00:06:19,290 I'm gonna add this because I am proud that we know that this is building and 117 00:06:19,290 --> 00:06:22,360 now anybody can look at this and know that things are working safely. 118 00:06:22,360 --> 00:06:25,580 It's a good way of showing off that hey things are great here. 119 00:06:27,150 --> 00:06:30,983 Okay, now if we come back over to our Get repo and when we refresh, 120 00:06:30,983 --> 00:06:34,780 we'll see this pretty little build passing thing here. 121 00:06:34,780 --> 00:06:36,160 All right, great. 122 00:06:36,160 --> 00:06:38,130 Let's go and add some new test so 123 00:06:38,130 --> 00:06:41,490 we can take a look at what it looks like when you do a poll request. 124 00:06:41,490 --> 00:06:44,780 Now, the other thing to notice too is that when I push that read me up. 125 00:06:44,780 --> 00:06:49,220 Look, another log in kicked off, 126 00:06:49,220 --> 00:06:51,347 like here and see that number two is now going, cool.