Introducing WarpFleet Synchronizer

WarpFleet™ Synchronizer is a Web server which aims to synchronize your Git repositories containing macros against your Warp 10 instance.

WarpFleet Synchronizer

WarpFleet Git Synchronizer for Warp 10 is a Web server that aims to synchronize your Git repositories containing macros (WarpScripts) with your Warp 10 instance.

Warp 10 provides a powerful repository manager through the WarpFleet mechanism and especially the WarpFleet Resolver.

The main idea is to use a post-commit hook in your favorite Git SCM (Github, Gitlab, ...) to run a synchronization. WarpFleet Synchronizer then runs a git clone/pull locally. Your Warp 10 instance uses WarpFleet Synchronizer as a WarpFleet Resolver backend.

Setup

The setup is easy. You have to compile and package WarpFleetSynchronizer. At first, get the source code here: https://github.com/senx/WarpFleetSynchronizer

git clone https://github.com/senx/WarpFleetSynchronizer.git
cd WarpFleetSynchronizer
./gradlew shadowJar

Now you have to configure your first repo. Create a file conf.json:

{
  "host": "0.0.0.0",
  "port": 8082,
  "remotes": "*",
  "repos" : [
    {
      "name": "my-warpfleet-macros", // must be unique
      "url": "git@github.com:senx/my-warpfleet-macros.git",
      "passphrase": "sshPass"
    }
  ]
}

You can configure public or private repositories depending of your needs, HTTP(S) or git URLs, with ssh or user/password authentication.

Public repo:

{
    "name": "my-warpfleet-macros",
    "url": "https://github.com/senx/my-warpfleet-macros.git"
}

Private repo with ssh (you may have a SSH key deployed on your server):

{
    "name": "my-warpfleet-macros",
    "url": "git@github.com:senx/my-warpfleet-macros.git"
}

Private repo with ssh and passphrase:

{
    "name": "my-warpfleet-macros",
    "url": "git@github.com:senx/my-warpfleet-macros.git",
    "passphrase": "sshPass"
}

And private repo with credentials:

{
    "name": "my-warpfleet-macros",
    "url": "https://github.com/senx/my-warpfleet-macros.git",
    "username": "homer",
    "password": "httpPass"
}

Run it

java -jar WarpFleetSynchronizer.jar ./path/to/conf.json

Of course, you can embed it into a Docker image.

FROM openjdk:8-jre-slim
WORKDIR /
ADD build/libs/WarpFleetSynchronizer.jar WarpFleetSynchronizer.jar
EXPOSE 8082
CMD java -jar WarpFleetSynchronizer /opt/conf.json
docker build -t WarpFleetSynchronizer .
docker run -d -p 8082:8082 -v /path/to/conf.json:/opt/conf.json WarpFleetSynchronizer 

First run

At first run, you have to synchronize your repo. You can use the dedicated endpoint (the post-commit webhook):

http://<ip of warpfleet sync>:8082/api/sync/my-warpfleet-macros

You can test if you can reach your macro:

http://<ip of warpfleet sync>:8082/macros/my-warpfleet-macros/path/to/macro.mc2

Now setup Warp 10 ( /path/to/warp10/etc/conf.d/20-warpfleet.conf)

warpfleet.macros.repos = http://<ip of warpfleet sync>/macros

More info about warp10.io.

Done!

Git webhook

WarpFleet Synchronizer exposes an API, especially this endpoint:

http://<ip of warpfleet sync>:8082/api/sync/my-warpfleet-macros

Use it to refresh your macros.

More info about APIs.

Roadmap

  • Distribute a binary
  • Provide a GUI
  • Publish a Doker image