In this article we will explain how to create an ec2 ubuntu instance with the Teamcity server installed.
To begin with in this case we will create an instance from an Ubuntu 20.0 image. However, you can take a look at other alternatives that Amazon provides for us here: here.
When we are creating this instance it's important to save the pem file, so that you can access the machine through ssh.
After we have created the instance we will go to security and use the Public IPv4 DNS, in order to create a CNAME record on your domain to access that machine.
- Access to the machine
> ssh -i "<file_name>.pem" ubuntu@ec2-ip-address.sa-east-1.compute.amazonaws.com
- Install java 8 to install teamcity
> sudo apt-get update
> sudo apt-get install openjdk-8-jdk
- Check the java version
> java -version
- Download the Teamcity Server, in our case we downloaded the latest version: 2020-2
> sudo wget https://download-cf.jetbrains.com/teamcity/TeamCity-<version>.tar.gz
> tar xfz TeamCity-<version>.tar.gz
> sudo useradd teamcity
> sudo chown -R teamcity:teamcity TeamCity
To change the server port, in the <TeamCityHome>/conf/server.xml file, change the port number in the not commented XML node (here the port number is 8111):
Now if you browse the IP address of your server using port 8111 you should see the TeamCity web interface.
Before creating the projects we need to create at least one build agent.
> cd Teamcity/buildAgent/build
> sudo sh install.sh localhost
Finally we need to run our TeamCity Server with the following command line from: <TeamCityHome>/bin .
> sudo sh runAll.sh start
We strongly recommend that you use docker instead of installing everything locally on this server, so that you can dockerize all your applications.
You can find more information about how to Install Docker Engine on Ubuntu, here: (https://docs.docker.com/engine/install/ubuntu/)
Moreover, in my previous post you can read about Dockerizing an angular app.
On this link: (https://dev.to/ollita7/dockerizing-an-angular-app-3nef)
Top comments (0)