Skip to content

Latest commit

 

History

History
84 lines (46 loc) · 3.48 KB

TEAM_CITY.md

File metadata and controls

84 lines (46 loc) · 3.48 KB

TeamCity

How to install TeamCity

Download TeamCity archive and follow installation instructions.

Basic installation:

  • extract TeamCity from archive
  • edit TeamCityFolder/buildAgent/conf/buildAgent.properties if needed (server url, etc.)
  • execute TeamCityFolder/bin/runAll.sh start to start TeamCity server
  • open TeamCity server page (address can be found in TeamCityFolder/buildAgent/conf/buildAgent.properties) and finish configuration.

How to create TeamCity job with clone/build/test/analyse/notify actions:

  1. TeamCity initiates first project configuration on configuration step. Also, is possible to create project in Administration -> Projects -> Create project

  2. On successful project import, project will have Github connection set up and ready to automatically start builds when change is pushed to remote repository:

  3. Configure build steps (TeamCity will try to automatically detect basic build steps (like clean assemble gradle tasks) on project import):

  4. Configure Build build step:

  5. Configure Unit tests build step:

  6. Configure Static Code Analysis build step:

  7. Configure UI tests build step:

    Shell script content can be found in ui_tests_on_emulator.sh file.

  8. Configure Upload to Fabric build step:

  9. Configure email notifications in settings Administration -> ServerAdministration -> Email Notifier (SMTP server information is required)

    and email notification rules in Administration -> Groups -> All Users -> Notification Rules:

  10. Configure environment variables used in build steps. Create Environment Variables using "Add new parameter" button:

  11. Configure build artifacts

    which will be published after the build and can be found in "Artifacts" tab:

  12. Configure JaCoCo code coverage report in jacoco.gradle file:

    if (project.hasProperty("teamcity")) {
        println '##teamcity[jacocoReport dataPath=\'app/build/jacoco/testDebugUnitTest.exec\' includes=\'com.vgaidarji.cimatters.*\' excludes=\'com.vgaidarji.cimatters.test.* **/*R*.* **/*Injector*.* **/*Activity*.* .*R .*CiMattersApplication .*BuildConfig .*Activity .*Test \']'
    }

    Coverage information will be available in Overview tab or in Code Coverage tab: