Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.

Setup file barryci.json

Liam Barry edited this page Feb 4, 2019 · 1 revision

Setup file

Each repo can optionally have a barryci.json file in the root which will define what happens when build or release happens. This file contains one large JSON object, with smaller settings. There are three main attributes:


  • focusBranch is a string which, if defined, will only build the branch defined when a push is triggered. If not defined, every branch will be built when pushed to. This attribute is optional.

    "focusBranch": "master"


  • build is an object with what commands to run for the build. This attribute is optional.

    "build": [{"command": string, "args": string[]}, {"command": string, "args": string[]}]


  • release contains more attributes to determine what happens when a release is made. This attribute is optional and is only triggered on the release flag from GitHub.

    • do_build determines whether to build before making a release. This attribute is optional and the default is true

      "do_build": true

    • post_commands is an array of objects which will run after the build and before the upload. This attribute is optional.

      "post_commands": [{"command": string, "args": string[]}, {"command": string, "args": string[]}]

    • upload_file is the relative path to the file which will be uploaded (usually generated by the build or commands after the build.) This attribute is required for a the release to upload, but is optional.

      "upload_file": "./release/release.savf"


Examples

  • Will just build into ILEUSION when a build is trigger (e.g. the push event)
{
  "build": [{
    "command": "gmake",
    "args": ["BIN_LIB=ILEUSION"]
  }]
}

  • When a build is triggered: will build into ILEUSION
  • When a release is triggered: will build into ILEUSION, then create a release save file and upload it To GitHub
{
  "build": [{
    "command": "gmake",
    "args": ["BIN_LIB=ILEUSION"]
  }],
  "release": {
    "post_commands": [{
      "command": "gmake",
      "args": ["release", "BIN_LIB=ILEUSION"]
    }],
    "upload_file": "./release/release.savf"
  }
}

  • When a build is triggered: will build into ILEUDEV
  • When a release is triggered: will build into ILEUPROD
{
  "build": [{
    "command": "gmake",
    "args": ["BIN_LIB=ILEUDEV"]
  }],
  "release": {
    "do_build": false,
    "post_commands": [{
      "command": "gmake",
      "args": ["release", "BIN_LIB=ILEUPROD"]
    }]
  }
}

  • When a release is triggered: will build into ILEUPROD - this is useful for deploying on different servers with their own webhook URLs.
{
  "release": {
    "post_commands": [{
      "command": "gmake",
      "args": ["release", "BIN_LIB=ILEUPROD"]
    }]
  }
}

Variables

In your barryci.json file, you can use the following variables in your commands:

  • &branch-short for the first three characters of the branch you are building.
  • &branch for the full name of the branch.

This can be useful for building and maintaining different branches in to specific libraries:

{
  "build": [{
    "command": "gmake",
    "args": ["-B", "BIN_LIB=PROD_&branch-short"]
  }]
}