Connecting External CI

Limio Custom Components aim to put your development team in the driver seat's, enabling them to use the tools they already know and a CI process to release changes in a controlled environment.

In this tutorial we will be using CircleCI but any similar tool should be able to replicate this flow.

To get started you will need to make a Limio Support Request to gain Component Repository Credentials. This will give you the required access keys to access the repository and in turn connect your CI instance.

The easiest way to then mirror your repository using a Cron Job in your CI pipeline, though different tool packages can allow you to use Triggers, to duplicate your repository on pushes to specific branches in your GitHub repository.

Which ever way you choose to execute your mirroring process you can now use the Limio provided Credentials paired with the GitHub API Key to run a scripting process using tools like Python to clone your repository.

Your YAML file for CI should look something like this:

    working_repositories: ~/repositories
      - image: circleci/node:5.1
      - checkout
      - restore_cache:
          key: v1-dependencies-{{ checksum "<<YOUR DEPENDENCY LOCK FILE>>" }}
      - run:
          name: Install Dependencies
          command: |
      - save_cache:
          key: v1-dependencies-{{ checksum "<<YOUR DEPENDENCY LOCK FILE>>" }}
            - "~/.local/share/virtualenvs"
      - run:
          name: Setting up SSH access
          command: |
            chmod +x ./
            scripts/ $SSH_KEY_ID
      - run:
          name: Mirror Limio Repository to AWS CodeCommit
          command: node ./

  version: 2
      - clone
      - schedule:
          cron: “0 0 * * *” # Trigger every night at 00:00
                - master

This will be the file that will setup your credentials with your Limio Components Repository, this should look like this:

# Add CodeCommit to SSH Configuration
# see
 echo "Host git-codecommit.*
 User $1
 IdentityFile /home/circleci/.ssh/id_rsa" >> /home/circleci/.ssh/config

# Add CodeCommit Server as Known Host
ssh-keyscan -H >> ~/.ssh/known_hosts


This will be your work file that will do the cloning of the repository, while Node is used in this example any scripting language can be used, an example of how this looks is as follows. Notice it uses a clean up job the delete the local repository after the sync job is complete:

import { execSync } from "node:child_process"

// Enables synchronous execution
async function executeCommand(command) {
    try {
        return execSync(command, { stdio: `inherit` })
    } catch (e) {
        console.error(e); // should contain code (exit code) and signal (that caused the termination).

const repositoryName = <<YOUR REPOSITORY NAME>>

async function cloneRepo() {
    console.log(`Cloning repository ${repositoryName}`)
    await executeCommand(`git clone --mirror${repositoryName}/`)

async function deleteRepo() {
    console.log(`Deleting repository ${repositoryName}`)
    await executeCommand(`rm -Rf ${repositoryName}`)
async function syncRepo() {
    console.log(`Pushing changes from repository ${repositoryName} to Limio")
    await executeCommand(`cd ${repositoryName} && git remote add sync${repositoryName}`)
    await executeCommand(`cd ${repositoryName} && git push sync --mirror`)

async function run() {
    await cloneRepo()
    await syncRepo()
    await deleteRepo()


Last updated