Mortar has joined Datadog, the leading SaaS-based monitoring service for cloud applications. Read more about what this means here.

Using Your Own Source Control

With Embedded Mortar Projects, you can use your own source control with a Mortar Project.

Embedded Mortar Projects

Every Mortar Project is associated with a private git repository in github. This repository is used to synchronize code between your computer and the Mortar platform when you run a job.

However, with Embedded Mortar Projects, you can use your own source control—git, svn, or any other, and can embed a Mortar Project anywhere inside your source tree. Mortar will still create a private git repository, and will automatically manage deployment to it when you want to run a job.

Setting Up an Embedded Mortar Project

First, ensure that you have installed the Mortar Development Framework, and are logged in to the github user associated with your Mortar account.

Next, checkout your internal source control repository, and create a new Embedded Mortar Project:

# cd to parent directory above where you
# want new Embedded Mortar Project to live
cd /parent/path/to/embed/mortar/project

# generate and register a new Embedded Mortar Project
mortar projects:create name_of_my_embedded_project --embedded

Finally, be sure to check the Embedded Mortar Project into your source control system.

Using Embedded Mortar Projects

All of the regular mortar commands will work exactly the same for Embedded Mortar Projects. Any commands that need to deploy code to the Mortar Platform (e.g. mortar jobs:run) will automatically sync the code via the private, backing github repository.

Advanced: Controlling Which Files are Synced

Embedded Mortar Projects have a whitelist of directories and files to synchronize to the Mortar Platform. The whitelist is stored in the project.manifest file, and by default contains the directories:

  • pigscripts
  • macros
  • udfs
  • lib

You can change the values in this file to control which files are synced to the Mortar Platform.