This is a smiple project to experiment with the TeamCity Portable Kotlin DSL.
It provides all required services in containers that can be run using docker-compose.
The Services included are:
- TeamCity with one agent as CI/CD tool
- Gogs to manage git repositories
- Mailhog to receive mails from TeamCity or Gogs
I wanted to experiment with the Portable Kotlin DSL in an isolated environment.
A simple mail server with web ui and API.
Leightweight UI to manage git repositories.
This server can be used for free as long as less than 100 Build configurations (jobs) are defined and no more than 3 agents are used. See JetBrains License Policy for more details.
init.sh script in the
docker directory. This will create the required keys in the
Then just run
docker-compose up (you may have to do a sudo). To run
everything in the background, use the
You will find more information about docker-compose at: https://docs.docker.com/compose/install/#install-compose
On first run Gogs will ask you to complete the installation.
Select the following options:
- Select the SQLite3 option
gogson the Domain and Application URL
- Email Service Settings
- Server and Other Services Settings
- Select Enable Mail Notifications
- Leave the other options disabled
- Select OK
- Log in and create an account via "Sign up now". The first account will be granted admin privileges by default.
- Add the public ssh key from the
docker/keysfolder to the SSH-Keys of the user.
- Click Proceed
- Select HSQLDB (local database)
- Accept License and disable anonoymous stats
- Create the Admin account
- Choose a username and password
- Go to Administration -> Email Notifier
mailhogfor the server
- Test Connection. You can choose any email address as the recipient.
- Add the Agent
- Select Agents -> Unauthorized (there should be 1)
- Select the Agent named
- Click Authorize Agent
- Setup the ssh keys
- Select the Root Project for example in Administration -> Projects
- Select SSH Keys on the left-hand menu
- Pick Upload SSH Keys and upload the private key from the
Accessing the repository
Depending on where you want to access the repository you need different URLs for the repository.
To access the repository from TeamCity use the following URL:
The same repository can be accessed from the outside using:
It seems to be important to explicitly add the port to the url. Otherwise you may get an error claiming that no key can be found.
Be sure to have the private key from the
docker/keys folder available
to your ssh client when operating with the repository from your machine.
Alternatively you can add your default public key to the Gogs account.