Codacy Installation

1 - Prerequisites

In the Enterprise version, Codacy works by using Docker running in a containerized environment. This process will take around 20 min to complete, from an empty machine to a fully working Codacy installation.

1.1 - Hardware

Recommended specs:
16 cores CPU
32GB RAM
1TB+ Hard Drive

1.2 - Database

  • PostgreSQL 9.4.x

Codacy is able to run with its own local database so this requirement is optional. Note that the local database is recommended for testing purposes only. In a production environment, you should use an external PostgreSQL server.

1.3 - Software

Codacy is compatible with the following operating systems:

  • Ubuntu 14.04

If you need to install Codacy on a different operative system please contact us first. Although docker aims at being environment independent, not all Linux distributions fully support the docker features that Codacy relies on to run. Installing Codacy on a different OS may yield unpredictable results or it may not run at all.

2 - Installation


The installation is made with a one line shell script:

bash -c "$(curl -fsSL https://get.codacy.com/)"

This script will update the kernel and install the required Docker version to run Codacy. If you previously installed docker, please check the documentation on how to uninstall it before running this script.

The script will need to restart the server to apply the changes. After the server restarts, run the same bash command as before:

bash -c "$(curl -fsSL https://get.codacy.com/)"

The script will detect that docker is installed (it was installed with this script so you can ignore the warning) then ask for proxy configurations and whether a database should be installed. It will then proceed to install the Codacy Control Panel.

Included Database

Using the provided Postgres will allow you to evaluate Codacy without having to properly install a Postgres database but, as stated in the Postgres installation guide, this database is not supported for production environments.

After this, you will be ready to start the configuration process in step (3).

3 - Configuration


The configuration interface is web-based and can be accessed via port 9000 over HTTP (e.g., http://192.168.0.1:9000) of the server you've installed on (make sure that the port 9000 is accessible from your local computer).

3.1 - Server license


The first screen will ask you for a license to be installed to access the application web UI. This will be a file with the extension .dlk. This will provide you access to download a custom built virtual infrastructure of Codacy that you can run in your own infrastructure.

The license should be provided by a Codacy representative.

3.2 - Control panel


After validating the license, you will be presented with the Codacy Control Panel, used to configure and update the application.

 

Codacy Control Panel

The console provides access to configuration keys and allows Codacy to be updated so it is strongly advised that the console is secured against unwanted access.

 

3.4 Application updates


For the initial application installation or future Codacy updates, click the button CHECK FOR UPDATES, on the top right corner. If a new update is available, a new option will appear:

 

New version available

Before any new version is ready to start running, a manual check of configurations is required. To configure the new version, click on the upper right corner link CONFIGURE. This will open a new screen with every configuration key required to run Codacy.

 

Application configuration

Codacy will run with the default settings, so if you are just evaluating the product with the default database there is no need to change anything; just click save.

If you want to configure an external database change following settings:

 

Mandatory settings to be reviewed

 

Host IP and Host Docker IP are automatically evaluated and secret keys to cipher database contents are created randomly per installation so no change is required.

 

 

After configuring the application, saving will return you to the update screen. This time, however, a new option to pull the version is presented in the upper left corner:

 

PULL option available

 

Pressing PULL will start an async method that can take up to 30 min, depending on your internet connection. This will pull Codacy images from dockerhub, making them available in the local registry for application execution.

 


Pulling dockers

 

When done, a success message will show in the logs, and refreshing the page will show a new option RUN in the upper right corner toolbar:

 

Docker pulled & RUN

 

Pressing RUN will start the application. At any time, you can check the status of Codacy by navigating to Support:

Support screen

There, all dockers will show their status. Also, the DOWNLOAD LOGS link will create a zip file with all container logs, that can be used to debug your installation at any time.

 

3.4.1 - Updating the Control Panel

Deprecated step

Since the Control Panel version 1.0.60 (July 2016) the client can now update itself.

Some updates might require the latest version of the control panel. To download the latest version you need to login to the machine via SSH and execute:

 

bash -c "$(curl -fsSL https://getenterprise.codacy.com/get)" -s update

After the installation is completed you'll be able to access your server via HTTP on port 9000. There should be a new version running.

 

3.5 Running Codacy


Database IP

If the database IP is incorrectly configured, Codacy will try to do an initial connection and wait on it before enabling the HTTP server. If the server is inaccessible, this will render Codacy unavailable.

You can navigate to port 80 of your server in order to test your installation of Codacy. Codacy will provide you with a checkup page that will scan for any missed configuration setting.


Failed settings screen

 

3.6 Registration


When all settings are correct, Codacy will ask you to accept the License Agreement

 


 

After accepting it, you will be redirected to the initial registration screen.


Registration panel

The first user to register will be admin and will be able to administer the platform and create additional users.

 

3.7 Initial configuration


Internet access

At this point, as the application finished downloading all components; internet access can be removed from the machine if required.

 

Default patterns

You should now go to 'Admin > Patterns' to select the default patterns. These defaults will be applied to new projects when registered into the platform.

 


Code patterns 

Codacy is now ready to be used.

 

4.0 Additional configurations


HTTP - Custom Port

To change the default control panel port (9000) you should export the environment variable "DOPLICATED_CLIENT_PORT" before invoking the control panel update command. 

bash -c "$(curl -fsSL https://getenterprise.codacy.com/get)" -s update

HTTPS - Control Panel

To have the control panel accessible with HTTPS, simply navigate to it and, in the settings panel, upload your CSR file without password, and the certificate key to the CSR file. By enabling the HTTPS settings, the control panel will be accessible through HTTPS, and it will use the configured port (9443 by default).  

 

 

HTTPS - Codacy

To have Codacy accessible through HTTPS, simply configure the same settings in the configuration panel:

Again, the CSR file uploaded should be without password. When applied and restarted, Codacy will be available at the configured HTTPS port.

 

Have more questions? Submit a request

0 Comments

Article is closed for comments.