

Now that we have our meta-runner set up, let’s create a build using it. Anything we want to make configurable in your meta-runner, we can add here. On line 6, we have the parameter that will be used when using our meta-runner as a build task. On line 2, we’ve changed the name of the runner. Runs the specified Grunt task from the project file. I noticed after I finished creating the screenshots that I could have edited the name when extracting the runner. By default it’ll take the name of the project for the runner name. If we now click on Edit, we’ll see the XML definition of our runner. We can then enter some details about the task runner.Ĭlick Extract and our meta-runner will be saved. Select the Extract meta-runner option from the Actions menu.

Now that we have our task set up, we can extract the meta-runner. Since we’re going to extract this, enter a TeamCity config paramter as the Grunt task for now. Select to add a Grunt task (as shown above) and enter the details specific to your project. In build steps, open the dialogue to create a new one. You can manually create a meta-runner, but it’s easier to just create a build task and then generate the meta-runner from there.Ĭreate a temporary project in TeamCity to give us somewhere to define our task. Once that’s installed, you’ll have a Grunt runner available in your build steps. TeamCity doesn’t (at least as of v9) include a built-in runner for Grunt, but there’s a plugin available to add the required functionality.
#Karma teamcity code
We want TeamCity to run these in order ( coverage and test are done separately so we can generate coverage reports on the unminified code then run all unit tests on compressed code ). Grunt.loadNpmTasks('grunt-contrib-uglify') This build runner can then be used as any other build runner in a build step of any other build configuration or template.Įssentially, a meta-runner lets you fill in gaps in the TeamCity build runner library with custom tasks that you need.įor our use, this means setting up something to allow easy running of tasks through Grunt. It’s all about the Meta, Meta, MetaĪ Meta-Runner allows you to extract build steps, requirements and parameters from a build configuration and create a build runner out of them. It’s pretty straight-forward to set up but it can be made even easier using a meta-runner. As well as doing this locally, we need to be able to incorporate it in our build process on TeamCity.

In our current project, we’re using it to compress all of our JS in the project, run the Jasmine tests through Karma, and generate test code coverage reports. The coverage report will be a merged result in json format.As much as all the cool kids are now using Gulp, I’m still using Grunt for a few few automated tasks. You can either pass a string or a function which will beĬalled with the browser name passed as the only argument. config.dir/BROWSER_NAME/, this option allows you toĬustom the second part. By default, the outputĭirectory is set to.
#Karma teamcity full
Option to generate the full output directory path. subdirĭescription: This will be used in complement of the coverageReporter.dir You set a relative path, the directory is resolved against the basePath. Use to specify that no reporting is needed)ĭescription: This will be used to output coverage reports.
