Source Code Assets

Source Code Assets are used to check out, build and install uncompiled code. Pointers to the external source repositories are contained in each asset. When built, these assets contain the latest updates to source. Scripts are executed on CONS3RT's SourceBuilder service, and then installed on your system(s).

You can find a sample Source Code asset here on Github. Take a look at the sample scripts in the script directory to assist in creating your Source Code asset.

You may need to grant CONS3RT access to your Source Code Repository. That can be accomplished by configuring Source Code Accounts as described in this article on Source Code Accounts.

Asset Structure

The directory structure for these scripts will be available in the UI once imported. The main directory is made up of various sub-directories that contain important files for your asset. Among these are:

  • An asset.properties file, which includes things like name, description and metadata.

  • A doc directory, which contains optional documentation for the asset. This documentation will be displayed in the GUI under the "Help" tab.

  • A LICENSE.md file, which will be displayed in the GUI under the "License" tab.

  • A README.md file, which can be viewed in HTML format. Populating the README and LICENSE files is highly recommended, but not required unless the asset is shared.

The key to Source Code development lies in the scripts sub-directory, which contains the scripts necessary for compiling an asset.

  • checkout.sh: Must be a Linux Shell Script, runs on sourcebuilder. Used to retrieve the software asset from its source control repository. May need credentials (see this article). Use the following example for Forge and DI2E checkout/clone commands:
$ git clone ssh://git@bitbucket.di2e.net:7999/hmc/cons3rt-sourcecode-sample.git

$ svn checkout --non-interactive https://svn.forge.mil/svn/repos/cons3rt-sourcecode-sample/HelloWorld ${ASSET_DIR}/src
  • build.sh: Must be a Linux Shell Script, runs on sourcebuilder. Used to build the software asset.

  • deploy.sh: Must be a Linux Shell Script, runs on sourcebuilder. Used to stage the software before installation.

  • install.sh: Runs on your Deployment Run Host. Used to install the software onto a Linux system.

  • install.ps1: Runs on your Deployment Run Host. Used to install the software onto a Windows system.

Once these steps are completed, your Asset can be imported through the UI. Click on the navigation icon and go to the "Software" section. Select the "Import Software" button and follow the instructions in the popup menu. (see also this Knowledge Base article. CONS3RT will scan your Asset and report any issues in an automated email. If no issues are found, it will appear as a "Source Code Asset" that is ready for use in your environment. Before changing your Asset's state to "Published," you will be able to make changes to the install script via a WSYWIG inline editor in the UI.

Sample Source Code Asset

A sample Source Code Asset template from GitHub:

$ git clone https://github.com/cons3rt/source-code-asset.git

This template can be used to create your source code asset. Please

Repository Access

Some CONS3RT sites provide built in credentials for common repositories so a Source Code asset can use this CONS3RT account and avoid the need for including credentials in the assets. Please see this Knowledge Base article for more information on existing accounts.