Skip to content

This Web server aims to synchronize git repositories and serve macros for the WarpFleet™ resolver

Notifications You must be signed in to change notification settings

senx/WarpFleetSynchronizer

Repository files navigation

WarpFleet™ Synchronizer

This Web server aims to synchronize git repositories and serve macros for the WarpFleet™ resolver

Configuration sample

{
  "host": "0.0.0.0",
  "port": 8080,
  "remotes": "www.myWebSite.com", // independant of your Warp 10 instance, for admin purpose
  "repos" : [
    {
      "owner": "hammet",
      "name": "warpfleet-macros", // must be unique
      "url": "git@gitlab.com:senx/warpfleet-macros.git",
      "passphrase": "sshPass"
    },
    {
      "owner": "hetfield",
      "name": "warpfleet-macros2",
      "url": "https://gitlab.com/senx/warpfleet-macros.git",
      "username": "oauth2",
      "password": "<gitlab oAuth Token>",
      "branch": "main"
    }
  ]
}

Docker

docker run -d  -v /path/to/conf/file/dir/:/data -p 8888:8080 warp10io/warpfleetsynchronizer:latest

Run

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

Now listen at 0.0.0.0:8080

Run as service

Add /etc/systemd/system/warpfleet-synchronizer.service with following content (adjust paths to your needs):

[Unit]
Description=Warp 10 - WarpFleet Synchronizer
Documentation=https://github.com/senx/WarpFleetSynchronizer
After=network-online.target

[Service]
Type=simple
User=warp10
Group=warp10
WorkingDirectory=/path/to/warpfleet/synchronizer
ExecStart=java -jar /path/to/warpfleet/synchronizer/bin/WarpFleetSynchronizer-all.jar /path/to/warpfleet/synchronizer/conf/synchronizer.conf
Restart=on-failure
SuccessExitStatus=143 

[Install]
WantedBy=multi-user.target

Then start service and enable at boot time:

sudo systemctl start warpfleet-synchronizer
sudo systemctl enable warpfleet-synchronizer

Check it works as expected:

sudo systemctl status warpfleet-synchronizer
or
journalctl -fu warpfleet-synchronizer

Note:

  • Clones of git repositories will be stored in /path/to/warpfleet/synchronizer/tmp
  • Macros will be stored in /path/to/warpfleet/synchronizer/macros/macros/<repo>

Usage

Test in your browser

http://localhost:8080/macros/<repo name>/path/to/macro.mc2

For WarpFleet Resolver

http://localhost:8080/macros/

API

Sync all

http://localhost:8080/api/sync

Sync specific repo

http://localhost:8080/api/sync/myRepo

List repositories

http://localhost:8080/api/repos/<owner>

Copyright 2019-2022 SenX S.A.S.

https://senx.io

About

This Web server aims to synchronize git repositories and serve macros for the WarpFleet™ resolver

Resources

Stars

Watchers

Forks

Packages

No packages published