Appendix: RepoSense with Travis

You can use the CI tool Travis to automate generating and publishing of RepoSense reports.

Setting up

The instructions below assume you are using GitHub pages to host your report.

Step 1 Fork the publish-RepoSense repository using this link. Optionally, you can rename the fork to match your RepoSense report e.g., project-code-dashboard.

Step 2 Generate a personal access token or deploy key on GitHub as explained in the panel below.

Step 3 Login to Travis-CI. You may have to sign up first.

Step 4 Sync your Travis account with GitHub:

  1. Go to your account.
  2. Click on Sync account to fetch all your repositories into Travis-CI.

Step 5 Activate the repository:

  1. Go to your publish-RepoSense fork in Travis-CI
  2. Under Current tab, click on Activate repository.

Step 6 Set the token/key:

  1. In the same page, click on More options on the right.
  2. Then, click on the Settings option:
    Travis-CI Dashboard
  3. Under Environment Variables, name a variable as GITHUB_TOKEN or GITHUB_DEPLOY_KEY depending on your earlier choice and paste the token/key into its value field; then click Add.
  4. Ensure that the Display value in build log is switched off for security reasons:
    Travis-CI Environment Variable

Step 7 Update the report configuration:

In your fork, edit run.sh (and if applicable, repo-config.csv, author-config.csv, group-config.csv) to customize the command line parameters or repositories to be analyzed.

Step 8 View the generated report:

  1. Go to the Settings page of your fork in GitHub.
  2. Under the GitHub Pages section, look for Your site is published at [LINK]. It should look something like https://[YOUR_GITHUB_ID].github.io/publish-RepoSense. GitHub Setting

It takes a few minutes for report generation. Meanwhile, you can monitor the progress live at Travis-CI's Builds.

Updating the report

Manual: Travis UI has a way for you to trigger a build, using which you can cause the report to be updated.

  1. Go to your fork in Travis-CI, click on More options on the right then Trigger build.
  2. In the pop up, click Trigger custom build.

Automated: Travis-CI offers Cron Jobs in intervals of daily, weekly or monthly.

  1. Login to Travis-CI.
  2. Go to your fork in Travis-CI, click on More options on the right then access Settings.
  3. Under Cron Jobs, choose master for Branch, Always run for Options and pick an Interval of your choice; then click Add. Travis-CI Cron