GitLab, a Self hosted, free, opsn source git repository, with CI / CD, issue board, & user control!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hey it's you open-source advocate and I'm back with another video I want to talk about get lab get lab is basically github that you run for yourself so if you're not familiar with github you may not be in the development world if you are you should be familiar with github so it's a place where you can have repositories for shared code and open source code and then everyone can contribute the code through git which is a a protocol that was created by the same guy who created Linux Linus Torvalds and basically it allows you to merge code and make sure that things aren't going to have conflicts clean up anything like that you can run code in different branches so if you think of your code like a tree your main branch is that main line of code that you want people to get but when you're making new feature you may not want to mess up that main line so you branch at a certain point add that feature and when it's done you'll merge it back into the main line of code and make sure everything is working so you can create lots of branches and you can do all kinds of merging and it really just helps you keep your code clean and keep your releases clean as much as possible anyways from the from the coding side so github is a place that you can share basically all of that code with the world gitlab is just a place that says hey we want you to be a self host if you want to we offer the same services that github offers and if you pay gitlab for those services because you don't want to host your own thing then again that goes to supporting the open-source parts that they that they keep up with today so for me paying one of these companies that does open source software is far more worth it than paying somebody like Microsoft that owns github or paying a private company to do something where it's all kind of done in the background and you don't really see what's happening so github is a cool place don't misunderstand me I have stuff on github today github is a great place to share your data with the world and a place where people will look for certain projects and certain things so so don't misunderstand but github is definitely closed they do not have an open-source version that you can run yourself you are beholden to them and the company that owns them at the end of the day if you want to run anything yourself then get lab I would say is absolutely a solid answer and I'm gonna tell you right now we're gonna go through the install process and and then I'm gonna switch over to a git lab instance that I've been running on digitalocean for years now because when you have repositories in there it's a different thing than having a brand new get lab up and running there's lots of settings and lots of configuration you can do either way but I want you to see it with the actual code that's in there so I've got my own get lab instance and I use that for my private stuff where I'm just messing around or maybe creating something new but I'm not ready to give it to the world yet just because I don't know if I'll ever do that because it may just be something where I'm like yeah this is never gonna work and I quit on it or who knows so once I'm ready I just share that over to github from get lab and it all gets pushed over with all of the history and anybody can go and grab it and start working on it so this is the main get lab site what we want to do is go and look at the docker install information here so I'm gonna go and actually get a docker container set up or a docker server set up so I'm gonna go over here to digitalocean I'm gonna create a droplet and they have droplets that already have docker on them so that'll save me the trouble of going to setup docker so I'm gonna pick that one and today I'm gonna do the $15 get lab does take some resources so just be aware of that it's definitely gonna take some resources it may even take a bigger one than that maybe the $20 one this one's got three gigs of RAM and one CPU this one has more CPUs so you can kind of mix and match depending on what you think you need and you can look at their specs to see what it is I'm gonna try this one I think it should work the one I've been running for a long time I think runs on a ten dollar droplet and it runs okay I don't think I'm doing everything in docker on that one so I don't remember off the top of my head but we'll see so my SSH keys I definitely want to keep and I'm gonna go set up those two machines so I can log into it and finally we will give it a domain name so this is gonna be get lab open-source is awesome calm let me double check my spelling yes that looks good and we're gonna click on create so that thing's gonna create our droplet and then we'll go over to hover and we'll add a domain name subdomain registration throw the IP address alright that's done we're gonna copy the IP and we're gonna go to hover right here and we're gonna add an a record and we want to add that as gitlab and paste in the IP address and we'll set that for five minutes alright we're gonna give that a few minutes in the meantime we can SSH into the IP address and as always we want to do our update and our upgrade alright we're back into our droplet and it's all updated and I've logged in now using the sub domain instead of the IP address so we'll go over here to the docker image information and they give you a little bit of information about using docker and how to run this so I'll put this link in the description so we've got this command here that's kind of long so we'll just kind of go through and get it set up and basically I'll just type it in as I go and talk about what it is so if you're not running as root you'll have to do sudo so just remember that and you'll need sudo privileges but we'll do docker run - - detach and then I'm not gonna do the back slashes that just allows you to go one line at a time well I can do it it's fine so now it's expecting the next argument make sure when you type this in that you're checking your spelling don't forget the backslash at the end of every line if you forget - backslash it's gonna try to run that much of what you've typed and it's gonna kind of mess up and you'll have to start again so do publish four four three and then we need : 4 4 3 and then publish eighty and then it also says to do 22 but I'm using port 22 to be SSH into the actual server right now so I'm not going to do 22 right now we'll have to go fix that later whenever we get everything set up they do backslash - - and name is gitlab that's fine we can name whatever wants it's just the name that docker is gonna use to reference this particular container when it starts restart always so this means basically if we reboot them in the server dr. will automatically restart this container once it comes back up now we've got to set up some volumes so we're gonna do volume and we're gonna do slash source slash gitlab slash config check your spelling as you go and then colon that's gonna point to slash ET c / get lab inside of the docker container make sure you put your space and then a backslash and then next volume is slash source slash get lab slash logs oops serve not source see I messed up now I got a ctrl C out of this because I didn't pay attention to what I was doing luckily it puts it back into a format that I can use without having to retype everything so just make sure it doesn't have a bunch of back slashes in there and now I can go back and I can change this to what it should be which is serve not source and then I can do volume and that's gonna be slash serve get lab logs I'm just gonna point to et snow slash bar slash log slash get lab and then volume serve get lab data and that's gonna point to slash far /opt slash get lab and then finally we're gonna tell it run the get lab get lab community edition latest so you do that with gitlab slash get lab - Cee : latest we're gonna go ahead and let it start so it's gonna go out and pull down the version of get lab that we asked for this is probably the longest part because it has to go pull down almost a gig of data and then it's gonna extract that gig of data which takes a little bit longer but once it gets that done everything should kind of start up and run now I'll warn you with this get lab takes some time to get started don't be impatient I would say once it says that the image is up and running really well leave it alone for like 20 minutes and then come back and check it and see if it's up and running because that's what I'm about to do and see if you can get into it if you can't you might check the docker logs and things like that so if you ever need to check docker logs you just type in docker or sudo docker depending on how you're logged in but docker space logs space and then the name of the container and it will show you the logs that are coming out of that container at that time okay we didn't get any errors that's always a good sign if you do get errors kind of read the room see what it says I did this before and that's why I know putting the port 22 was gonna be a problem I don't really know how I would do that I probably just need to go through the digitalocean little command-line utility that they have on their web browser and stop this container and restart it with the port 20 to publish in there just because that's one of the ways that you get to push get data into your git instance so that would be an issue for me if I was trying to actually push data out but since we're just trying to get this thing started and show you what's going on that's what I want to do I'm gonna wait for a little bit let this thing really have time to start up in fact I'll show you what it looks like docker logs gitlab and you can see this is just tons of stuff that's being run right now docker is a git lab as a Ruby on Rails application and there's a whole build process that happens when starts before it gets everything ready for you to use so again I would say just be patient let it run through its process and then come back I really I mean 20 minutes sounds like a long time but seriously like just give it time go get you a coffee or whatever you need to do and then come back and I'll come back in just a little bit and we'll continue this alright we're back and the site is up I've waited 15 or 20 minutes now so the first thing it asks for is to create a new password for the user this should be your administrative user the first time out so make a strong password let's try that yes there we go that worked so we're in as root user and of course the first thing you want to do is go and set up some other user you don't want to do everything as your root user you want to do everything as has a different user so you can sign back out and when you do that you can go here to register and fill in your information up right and ethics yeah oh that's my username let's see and then one more time with your email and then create a password you can set this up so it doesn't just select somebody register like that but instead it will have either it will email them a confirmation to prove that they are who they say they are or it will prompt you as the administrator to allow them to use the system or you as the administrator can create users and then let the people know what their user is for that so right off the bat you can see there's quite a bit of stuff here what I want to do is because this is an empty system I want to go over to my actual live system and show you what it looks like so we'll come here and I'll login all right so I'm logged into my live system here and you can see I've got quite a few projects that I've started over the years and they go back and back and I've got multiple pages of them so just all kinds of different things where I've done my own testing and some of these I've moved over to github after I kind of got things going and made sure it was working the way that I expected it would so shared projects I don't really have any setup there and then exploring projects you can go do a few different things here I just kind of always come to the main projects page first so up here there's the little wrench icon takes you to settings of course over here on the right is your user where you can set up your user profile or you can edit your status what this says here and then settings from this as well so if I go to profile you kind of see what's going on on the user level for half and I've put things up into get lab what all my projects are when I've last done something with them everything like that and then you can move through these things to see like what groups are you a part of activity contributed projects personal projects favorited or starred projects as they call them and then snippets if you have any snippets that you've created so you can edit from up here in the upper right and then when you're done with that you can also go to settings from here and this really brings you to your kind of personalized settings first so you can do your photo and I just took an old photo that I had and there it is it cropped it up lucky you you get to see me you can change your status from here of course you can change any of your information from here you can reset your passwords things like that as you move down you can see your account information so two-factor authentication you can enable two-factor authentication which is awesome I love two-factor authentication you guys all know that once you move down further you have applications so you can add applications that you can use inside of gitlab which is kind of Awesome there is chat so you can set up a chat server and you can start doing chat through gitlab there's access tokens so if you need some kind of API or access tokens you can also set those up emails now you get to set up email through the terminal side in your settings for the gate lab server so your SMTP information all that kind of stuff go to send emails you have to set that up and then restart your docker images so that it will rebuild your get lab instance with all that information in there there's documentation out there that tells you how to do that but you can set up email so that you can do that of course passwords you can reset you can set up the notifications that you want to get and how often what method SSH keys if you have SSH keys you can set those up here as well G keys and then you have your preferences for the style that you get out of get lab which is kind of nice the syntax highlighting navigation theming this is something they've added more recently it didn't used to have all of this so I say recently maybe the last year or so I think active session so if you know you have more than one active session you can go and kill one of them if you need to and the authentication log that tells you how often you've authenticated or had failed authentication attempts that kind of stuff so that's your personal settings kind of your profile settings here we can go to the actual settings for the system and they give you a little overview of what's going on the system so five users two groups a lot of projects everything like that so here you can go through projects and then we move down you can go through users and groups so I've got two groups set up and I've got some of my users assigned to that jobs so this is like automated jobs in the system we'll try to kick off an automated CI job for you when you create a new project it makes no sense to me unless there's just something special about a project that you're creating that gitlab somehow magically knows how to do that but the the front-end or back-end stuff that I use there's there's no way it would know what to do to to build those things unfortunately I mean you can definitely set that up and they do have things called runners that we'll get to but it does try to do that so you'll see a bunch of stuff works as it failed so runners this is basically where you set up runners where you can set up those CI and CD type things through gitlab so as you finish code and push code you can tell it okay I want this to go over into my tests and then I want this to go into kind of beta level for users and now I want this to go to production that kind of stuff I think they call it stage a lot of times instead of beta level so I don't know what get alley is but it is here so if you know what that is go for it so when it says monitoring so you can kind of see what's going on on your server there's more stuff here so whenever you come to this you can see more information loops the other so what opened up monitoring you've got different options underneath monitoring that you can look at so you can have background jobs if you had any jobs running because these background jobs they're running you can see logs you can see health check and of course request profiles next thing is messages so you can send out messages from the system to your users basically like hey we're going to update the server on this day at this time you might want to get everything pushed or pulled or whatever you need to do things like that system hooks so if you have some kind of integration you want to make then you can set up system folks by get you know by going in here and setting that up again applications so there are applications out there that you can get and set up to use with get labs so there's a lot of stuff out there you can actually use abuse reports if there are any abuse reports you can handle those from here I'm really the only active user on here I have a few people who get on occasionally but nobody that's gonna abused the system kubernetes so if you're running anything with kubernetes you can set up integration to that here deployment keys service templates you can set up service templates as well labels so if you want to use labels for different things you can do that of course the appearance you can adjust some things kind of white label the system to be a little bit more yours if you want to I haven't really done any of that and then back to the same settings menu that we kind of just looked at it's just down here in the settings menu so if we go back to projects though I really kind of want to show you this part so we're go to my projects and then I'm gonna go into a project here yeah we'll just go to this one so this is a pretty big massive project I've worked on for a long time just something for me to learn with really really understand some some coding and things like that that I've been trying to do so when you go to your projects you get this menu here that's context-sensitive to your project and one of the cool things they have in here is the issue boards so if you have you know bugs or you have stories or whatever you want to set up to kind of help you get things done they have different ways to do this so they have the board they have the list so I really like the board it's a Kanban type board so when it loads up I can see all of the things that I want to do all the things that I've gotten progress all the things that I've put into testing and what I've finished and it really is a nice way to do that and then it's just drag-and-drop so you can move things from one column to the other and get those things into place and you can put tags on them so you know if they're stories or if they're bugs and what things you're focused on and what you're working on and what's getting done so I really like the board itself in the list view it's it's the same stuff it's just in a list view as all you can see your labels and setup other labels that you might want to use and then you can set milestones so if you have big milestones that you want to set by getting some of those things done you can assign those stories or those bugs to milestones and then this helps you track whether or not you're getting close to getting those things done so you can set this up to be a merge request system I don't have it set up that way because again I'm really the only active user on it so when I push code it just goes in but you can't set it up so that people when they push code they don't really push code to make a pull request you check their code and then you can accept or deny it and that's really kind of a nice system when you're trying to control what's going on in your project that's really more how github works is generally people will make a pull request to get you to add their code to your repository so that they get some functionality that they they're fixed or that they want it to have that you aren't working on so again see ICD for this project so you can go through here and try to set up some CI and see these stuff for your projects and you can set up pipelines and then jobs and and there's documentation on how all this stuff works out there so you should go read up on it a little bit and especially depending on the front and back in it you're using it's important to understand the differences in those things before you try to set this stuff up so there's operations so you can see kind of metrics around what's going on in your operations if you're using this that's cool I don't really use it you can see there's nothing there for me there's a wiki so you can get out here and actually use you know this wiki and it uses markdown and you can set things up and you can try to make it look a little prettier than mine does I was just kind of you know testing this out to see how it looked snippets so code snippets if you want have code snippets that people can pull down sets of snippets you can set those up in here and do that as well and then we're back to settings so that's really get lab at a quick glance I just wanted to kind of give you an overview of what that look like and what it's what it's what it's all about I think it's a really great open source project it's something that I use quite a bit myself just doing my own kind of hobby level coding but it's something that's a really amazing tool and it's out there and it's available and get lab continues to work on it and they continue to give new features in it their Enterprise Edition I think usually has a couple of features the Community Edition doesn't but I want to say that that's on a time kind of basis so if you're willing to wait a year or so a lot of those features will eventually come to the Community Edition which is awesome again if you want the Enterprise Edition or you want to pay them for support everything like that you can do that and it helps support the community edition stuff that they're putting out there so I think that's really a great thing to do you know if you're worried the github someday might say oh we're closed sourcing everything we're taking all your code with us this is a good way to go I'm not real worried about that happening I mean that would just create such an Oprah would be insane but you know again I'm somebody who likes to control a lot of the stuff that I do and I'd love to own my own code on my own repositories so this is just the right thing for me I hope it's the right thing for you if you enjoyed this tutorial and this install leave a thumbs up you know subscribe to my channel let your friends know about it I'll be doing more and more and more stuff that's open source free amazing software and I hope you'll join me for that right I'll talk to you next time [Music]
Info
Channel: Awesome Open Source
Views: 24,590
Rating: undefined out of 5
Keywords: open, source, opensource, open-source, self, hosted, selfhosted, self-hosted, free, libre, software, server, web, internet, browser, linux, mac, macos, os x, windows, microsoft, unix, bsd, ios, android, pi, raspberry, desktop, digital, ocean, digitalocean, vps, tutorial, how to, setup, installation, instructions, git, gitlab, github, mercurial, bitbucket, sourcetree, code, writing, merge, branch
Id: LzMv4IRmewY
Channel Id: undefined
Length: 25min 38sec (1538 seconds)
Published: Sat Jan 18 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.