Documentation


Analyze projects not accessible by SymfonyInsight

SymfonyInsight needs to access your source code in order to analyze the quality of your projects. Depending on your project configuration, the code can be obtained via pull mode or push mode.

The pull mode is used when SymfonyInsight gets your code automatically from a Git repository hosted elsewhere (e.g. in GitHub), no matter if the repository is public or private. The push mode is used when you set up a private Git repository on Symfony's infrastructure and you explicitly push the code before each analysis.

The push mode is the easiest way to analyze private projects without giving SymfonyInsight access to your repository.

Follow these steps to analyze a project using the push mode:

  1. Access to your private SymfonyInsight dashboard and click on the Add project link located at the top of the right sidebar.
  2. Click on the Other SCM tab and choose the name of your project.
  3. Click on the Create repository button and SymfonyInsight will now create and host a private Git repository where you can push your code.

Pushing your code

If your project is already using Git to manage its code, add a new remote to start pushing your code right away:

1
2
$ git remote add symfony git@git.symfony.com:<your-username>/<your-project>.git
$ git push symfony master

From now on, whenever you want to run a new analysis, don't forget to push your code first to the symfony remote.

If your project doesn't use Git to manage its code, install Git on your own machine and then, execute the following commands to initialize your Git project and to push the source code to SymfonyInsight:

1
2
3
4
5
6
7
8
9
10
11
$ mkdir myproject/
$ cd myproject/
$ git init

# copy the source code of your project on this new directory:
# cp -r /your/project/files/ myproject/

$ git add .
$ git commit -m "Added initial set of files"
$ git remote add symfony git@git.symfony.com:<your-username>/<your-project>.git
$ git push symfony master

For subsequent analysis, copy again the files that have changed and push the code before running the analysis:

1
2
3
4
$ cd myproject/
$ git add .
$ git commit "Updated project files"
$ git push symfony master