From the course: Bamboo Essential Training (2018)

Install Bamboo

- [Instructor] So in this lecture we want to install Bamboo. Before we start installing things I wanna tell you how Bamboo actually works. So Bamboo comes with a web application, that is the basically web application that you see when you go to a web browser and then you navigate to http, and then you put your Bamboo address there, and then you see a web page. That's the Bamboo web application. Web application is used for creating projects, creating plans, security, notifications, all sorts of things but it doesn't actually build your source code. What is used to build your source code is called a build agent. When you install Bamboo you are able, you are allowed to have your build agent on your Bamboo server. But it's not recommended to do so because a few reasons. The first thing is that every server that you have must be single responsible. So you don't want one server to do two things or multiple things. So if you put your Bamboo web application on a server that server should be only like a Bamboo server. It shouldn't be a build agent server. Likewise, if you want to use a server for building source code it shouldn't do anything else other than building your source code. So that's why we separate them. Also, if you have multiple builds running at the same time, your server may get slow, and then it's gonna effect the responsiveness and performance of your Bamboo server. Whereas not every user is actually building a source code, many users might be just working on creating their projects, configuring their plans and all sorts of things, and then they are gonna get effected as well if you put everything together. And the third reason that I think we shouldn't combine the build agent with the server, with the Bamboo server, is that after a while normally build agents get corrupted. They get too heavy, you install a lot of things on them, and you happen to basically write them off, kill them, terminate them and create new build agents, fresh build agents, but if you do that you don't wanna actually kill the Bamboo server as well. You just want to kill the build agent. The fourth reason is that as we will see very soon, you can have build agents on demand. It means that you can, if you use Amazon web services, you can have build agents based on a template. So you create a template but then there is no build agent and if somebody wants to build a source code Bamboo server, Bamboo application, will create an actual build agent based on that template. It will build your source code, and if you don't use the build agent it's gonna kill it. So if you put the build agent on the Bamboo server, you won't be able to do this as well. So, there are many reasons not to combine your build agents with your Bamboo application. You need to keep them separate. Unfortunately Bamboo server doesn't have the ability to scale out, out of the box. You can scale it up, you can run multiple builds in parallel but you cannot scale it out, because it's not a data center product yet. But you can have as many build agents as you want. There is no limit. The only thing that limits you is the number of licenses you have. Otherwise you can have unlimited number of build agents. So it's another reason to keep them separate. So, when you have your Bamboo server and you will plan to have build agents, you need to store the data that you put in your Bamboo application into a database. For example, when you create projects, when you create plans, when you create users, all those information, pieces of information have to go to a database. When you install Bamboo, you can use an internal database that comes with Bamboo, or you can have external databases. My advice to you is that you only use the internal database when you just install Bamboo to learn it. Or when you have a home project and you want to have a build system for your own small home project, you may want to use the internal database. Other than that, if you want to install Bamboo for production capacity do not use the internal database because it's not supporting the concurrency, it tends to get corrupted, and again you want to have servers with separate responsibilities. So you need to create an external database. That's what we are going to do in this lecture. And then connect your Bamboo to the external database. Out of the box, MySQL, SQL Server, Oracle and Postgresql are supported. The only thing is that Bamboo doesn't come with the driver for MySQL, we need to install it separately. But for the licensing reasons it doesn't come with the driver for MySQL. But it's not a problem, we will install it. But if you use Oracle or SQL Server you don't need to install drivers separately. It's all good, you don't need to install anything. So that's about it, let's go and start installing things. So I'm going to install Bamboo, and also I'm going to create a MySQL database in Amazon web services. If you do not have Amazon web services it's okay, you can install MySQL on either your local server, on your local machine, on your personal laptop, it doesn't matter, wherever that you can and you want, you can have an instance of MySQL. Also if you are more comfortable with SQL Server it doesn't matter, you can install SQL Server. And also, I'm going to create an instance of EC2 in Amazon. I'm gonna use Windows for installing Bamboo. I use Windows because it's easier to show things in Windows. It's better for the sake of teaching things. But if you are more comfortable with installing Bamboo on your Mac machine or on an Ubuntu server, it doesn't matter, because Bamboo is a java application, so as long as you have java on your machine you basically deal with the same package and same files so it doesn't matter. You can learn it on Windows and then repeat and do the same things in another operating system. So let's go and create MySQL. To create MySQL I'm going to use the relational database service, or RDS, in Amazon web services. So I'm gonna just go there, and I click on get started now. And I will choose MySQL. If you don't have MySQL, sorry if you don't wanna use MySQL, use SQL Server or Oracle or PostgreSQL, whatever that works for you. I will choose MySQL. And I click on next. Because I'm just creating this instance to demo things, I'll choose Dev/Test. And we leave the license and default engine type as they are And we need to provide the instance class. This is the type and class of the EC2 machines that will host your MySQL. t2 marker will be probably a bit too slow, so let's choose small, t2 small. And we'll leave the disc size. And for the instance name we just need to provide a name, for example I can say, bambooinstance. And we need to provide a username, admin. And then password. So we go to next. In advanced settings, if you have a VPC, a kind of network for your build system, make sure that you put your database on Bamboo and everything within the same VPC, so they can connect to each other. Otherwise I just leave it in the default VPC. Also, you don't need to make your database public accessible The only reason that you may want to have your MySQL publicly accessible is that you want to have your database on Amazon, and then your build server will be somewhere else, and then you might want to have your database be public so it can connect to it, given that you don't want to use VPN. But if you put your Bamboo server and database in the same VPC, your database doesn't need to be publicly accessible, it's more secure to make it private. Availability zone and security group I leave it to RDS to decide. This bit is super important, you need to provide a database name in here, and if you don't use Amazon for creating MySQL instance, for example if you install it on your own laptop, if you install MySQL on a local server, make sure that once the installation of MySQL is completed you use a MySQL or even SQL Server client. You connect to your server and then you create an empty database, because Bamboo requires an empty database in order to create its database objects in it. If you forget to create this empty database, Bamboo's installation is gonna fail. Bamboo won't be able to install and create the database objects that it needs. So make sure that you provide the name of a database. I'll just type in Bamboo. And this database has to be empty. Without this database Bamboo cannot be installed. So make sure, before you install Bamboo, you create an empty database in your MySQL or SQL Server. We leave the port as it is. And all other options, we leave them as it is. I don't need basically any back ups. I change these to zero days. I don't need monitoring, logging, anything. And we can say launch DB instance. So it's gonna create MySQL for me, and it's gonna take actually a few minutes to have my database ready. In here it says that DB instance status is creating. While database is being created let's go and create a server So we will go to EC2. To create a server we will click on launch instance. Either you choose from the quick start images or you can go to community AMI and choose the type of operating system that you have. And choose one of these images. Or, like me, you can have your own image. This image is just a Windows Server 2016, plus Google Chrome is installed on it. And I normally use this because I am a lot more comfortable using Chrome. So we just choose a size, let's say t2 small. And I'm going to give it a public IP so I can connect to it. And we don't basically use any service, so I'm not gonna attach a role. It's a best practice to attach a role to your server, but I don't do it now. Let's go to storage and in here, because my snapshot has a disc of 30 GiB, I just leave it as 30 GiB and then we tag it. So I can say name, and in here name, and the value is Bamboo server. So in security group you have to make sure that you have the proper ports open. This port is for RDP, the custom TCP. This is for RDP because it's a Windows machine. It's for remote desktop. Also, you need to open the port which is for accessing Bamboo server. By default Bamboo is accessible on port 8085, if you don't change the configuration of Bamboo and you use the default configuration you will have to access it on port 8085. So that means that either in Amazon, if you use Amazon, or in your firewall, wherever it is, like it can be your Windows firewall, it can be your network firewall, you have to open port 8085 in order to access Bamboo. If you don't do this you won't be able to access it and then it's gonna be frustrating. What I'm gonna do in this lecture is that I'm going to change the default port to port 80 so we just access it on normal http protocols and port. So what I'm gonna do in here is that I will remove 8085 and I will add http. I don't have also IPP 6 so I don't need that. In here I'm allowing traffic from all sources. If you install for production use make sure that your IP is limited. So we click on review and we click on launch, and it's gonna create the machine for us. Perfect. So now I'm remotely connected to the Windows server that we created for installation of Bamboo. What I'm gonna do is just to launch Chrome and then I will go to Atlassian website. So I will say to atlassian.com/software/bamboo. And in here you just click on get started for free. Once you do that the website is going to detect my operating system and suggest the best package. So I just click on download, and it's gonna download either a compressed package or an installation file based on your operating system. If you get an installation file, you just run it. And it's gonna first decompress everything and then it's gonna run the installation wizard. The first path that you have to set, or basically specify, is where the executable files have to be copied. The next one is where Bamboo creates it's files, because Bamboo may create a whole lot of files when you run it. I normally change the default path because the default path is dependent on the current logged in user, which is administrator. And I also prefer shorter paths. So I go to C drive and I create a folder in here, you can call it Bamboo home, Bamboo data, Bamboo whatever that makes sense to you. So I will copy this and I will paste it back to the installation wizard in here. So I do control A, control V, and I click on next. And the installation wizard is gonna copy all the files for me. Okay, so the installation is completed. Now I'm going to change the configurations for two things. The first thing is that, as I said, we don't wanna access Bamboo on port 8085, we want to access it on port 80, so I need to change the port. And also, I managed to specify the home directory, which was C Bamboo home, because I'm in Windows and I have the luxury of using an installation wizard, but if you are for example installing Bamboo on Ubuntu you don't have that installation wizard so you have to update the configuration file to specify a home directory. So let's go to the installation folder, which was program files Bamboo. And in here you will go to conf folder, and there is a server.xml file in here. What you need is to edit it. When you open it, it's not really well formatted, but all you need to do is search for, is to search for 8085, and once you find it just change it to 80 and save it. Obviously you have to make sure that this server doesn't have a website or application that is already listening on port 80, otherwise Bamboo is not gonna work. So because this server is brand new, and I didn't install IIS I'm confident that there isn't anything listening on port 80, so I set it on port 80, right. Also, you go back, and to find the home directory you will have to go to atlassian-bamboo folder. And you will go to, all the way down in here, to WEB-INF. And then you will go to classes, and then look for bamboo-init file. Bamboo-init.properties, this file, we need this, bamboo-init.properties, and edit this file. So I will open it with notepad. So when you open it, you see that there is only one line in it and that value that I gave to the installation wizard, that C://BambooHome is in here. But again, because if you use for example Ubuntu you don't have that wizard, you will have to open this file manually and specify the home directory. That's it. Next step is that, as I said, Bamboo doesn't come with the driver for MySQL so we need to download the driver. The driver that we need is this. We Google for download connector/j. The first link that you get, if you look for download connectors/j is the driver that you need and it's on MySQL.com. So we go in here and based on the operating system that you have either you get the TAR file or the ZIP file. So I will get the ZIP file. And in here i will say, that no thank you I don't wanna login. So I will download the ZIP. So I will open this and I will extract the ZIP file. So it doesn't really matter where you extract it to be honest. You can extract it anywhere. So I will say extract it in here. And what you need from the file, so basically you don't need all the files. What you need from all these files is the Jar file in here, which is mysql-connector-java and then a number-bin. That's the file you need. So we just say, copy this file and then we take it back to Bamboo. So we go to C/ProgramFiles/Bamboo. And then we open the lib file, and then we paste that file in here. Again, if you use other and different operating systems, you just copy it with the proper copy command. That's it. Next step is to start Bamboo server. So what we need to do is that, I will show you which files you need to run. So we will go back to C/Program Files/Bamboo. In here, if you are using Windows, you will have a few batch files. One of them is Bamboo Console, and if you run it while the Bamboo Console is being run then you can access Bamboo. Or you can run a batch file called InstallAsService and it's gonna install Bamboo as a Windows service. And then you can, after that run, start Bamboo and it's gonna start that Windows service. That makes you sure that every time that you, basically reboot your machine, you don't need to run anything, Bamboo will be running automatically. So I'm gonna open a command prompt, and in here I will go to this path. And in here I will call InstallAsService.bat. So the last line in here it says, the service Bamboo has been installed, check and make sure the service has been installed. And then after that you want to run start Bamboo, and it's gonna start the service. So it says, service was started successfully. If you don't use Windows, if you are on for example Ubuntu or anything else, under bin folder you will find an sh file, it is normally like start.sh, something like that. That's the file you need to run. So you will go to bin file, find the proper sh file, which is normally either start up or start, and then use that file to start the service. So we are done with this, and now what we need to do is go to local host on port 80 and we should be able to see Bamboo. There you go, this is Bamboo. So when you run Bamboo for the first time, this is the first thing you will see and that is basically the license. Because there is no license there you need to have a license To get the license in here there is a link. It says, Contact Atlassian, you click on this. It will take you to the license page and then it will give you a license. If you already have an Atlassian account put your email here otherwise you can login with Google. So we can say this is my email. And I'm going to generate license. So what you need to do is to copy this code and go back to Bamboo, paste it in here. And after that, make sure you won't click on Express Installation, make sure you click on Custom Installation. If you click on Express Installation it's gonna install Bamboo with the default internal database. That's not what you want, you want to install Bamboo with MySQL. If you want you can change the name of your Bamboo instance. And other than that I'd leave all the configs as they are, and I will go to the next page. So in here we say that we don't want the embedded database, we want the external database. And our database type is MySQL. So we click on next. So now in here we need to connect to MySQL. So what we are gonna do is that we will go to AWS. This is MySQL instance, I will click on the instance name. And I need the endpoint address of it, which is in here. So we just grab this, copy, and then we go back in here. Make sure that you use this connection string, this is very important. Use jdbc and then call in MySQL and then there is your server address in here, and this is your database, Bamboo, after that. So this is the database name in here. So I just highlight it. This is your database name. So if you connect to MySQL and create an empty database, whatever name you put for your empty database, you put it here. This is your server address or the endpoint that we grab from AWS. We put it in here. And make sure the connection string is correct. So it's jdbc:mysql:// and then server after that / database. Username was admin and password, password. And then we click on continue. So it connected to MySQL, now it's creating all the database objects that it needs. It may take up to few minutes, it depends on the type of database you are using. Okay, so the installation is completed, and I'm connected to my database, which was MySQL. And then we are not importing data from previous installations, so we just click on continue. Now we need to create an admin user. So I will just say my username is admin, my password is 123, full name, just put your full name in here, for example Bamboo Admin and admin@mail.com, it's a made up email, it's not a valid email. And I just click on finish. So my Bamboo installation should be completed soon. So seems like the installation is completed and we should be now able to see Bamboo for the first time. There you go, so this is Bamboo. And from here we can start creating projects, and set up build agents, and basically we can start using Bamboo. I did all these things on the Bamboo server, but simply what you need is to replace this local host with the IP or DNS name of your server, and then you will be able to access Bamboo.

Contents