This page permanently redirects to gemini://gemini.complete.org/gitsync-nncp-over-filespooler/.

gitsync-nncp over Filespooler

You can use gitsync-nncp[1] (a tool for Asynchronous[2] syncing of git[3] repositories) atop Filespooler[4]. This page shows how. Please consult the links in this paragraph for background on gitsync-nncp and Filespooler.

=> 1: /gitsync-nncp/ | 2: /asynchronous-communication/ | 3: /git/ | 4: /filespooler/

Basics

How you will set up Filespooler depends, of course, on what kind of transport you are using. These examples assume a directory synchronization as with, for instance, Using Filespooler over Syncthing[5]. Of course, other transports are available.

=> 5: /using-filespooler-over-syncthing/

There are two things to consider with gitsync-nncp: sending and receiving. Let's discuss sending first.

Sending

gitsync-nncp commands like push_full take a command (with optional parameters) to use to send data. After that command (and parameters), gitsync-nncp adds its own additional parameter: a branch name. This is a perfect fit for Filespooler. Here's an example script you might use. Let's call it gitsync-send-fspl:

#!/usr/bin/env bash

set -euo pipefail

fspl prepare -s ~/statefile -i - -- "$@" | \
    fspl queue-write -q ~/queuedir

Now, call gitsync-nncp like this:

gitsync-nncp push ~/bin/gitsync-send-fspl

Easy! Of course, your send-fspl script could just as easily run over some other transport, add compression or encryption, etc.

Receiving

Now, the counterpart: receiving. We can use the loosely-ordered mode here to allow us to receive from many machines in a Many-To-One with Filespooler[6] or many-to-many configuration.

=> 6: /many-to-one-with-filespooler/

fspl queue-process -q ~/queuedir --allow-job-params --order-by=Timestamp \
  --on-error=Leave gitsync-nncp -- receive ~/repopath

This will cause the parameter given to prepare -- the branch name -- to be appended after gitsync-nncp receive ~/repopath.

That's it!


Links to this note

=> 7: /gitsync-nncp/

gitsync-nncp is a tool for using Asynchronous Communication[8] tools such as NNCP[9] or Filespooler[10], or even (with some more work) Syncthing[11] to synchronize git[12] repositories.

=> 8: /asynchronous-communication/ | 9: /nncp/ | 10: /filespooler/ | 11: /syncthing/ | 12: /git/

=> 13: /many-to-one-with-filespooler/

Since Filespooler[14] is an ordered queue processor by default, it normally insists on a tight mapping between the sequence numbers in job files and execution order in a queue.

=> 14: /filespooler/

=> 15: /one-to-many-with-filespooler/

In some cases, you may want to use Filespooler[16] to send the data from one machine to many others. An example of this could be using gitsync-nncp over Filespooler[17] where you would like to propagate the changes to many computers.

=> 16: /filespooler/ | 17: /gitsync-nncp-over-filespooler/

=> 18: /filespooler/

Filespooler lets you request the remote execution of programs, including stdin and environment. It can use tools such as S3, Dropbox, Syncthing[19], NNCP[20], ssh, UUCP[21], USB drives, CDs, etc. as transport; basically, a filesystem is the network for Filespooler.
Filespooler is particularly suited to distributed and Asynchronous Communication[22].

=> 19: /syncthing/ | 20: /nncp/ | 21: /uucp/ | 22: /asynchronous-communication/

More on www.complete.org

=> Homepage
=> Interesting Topics
=> How This Site is Built
=> About John Goerzen
=> Web version of this site

(c) 2022-2024 John Goerzen

Proxy Information
Original URL
gemini://gemini.complete.org/gitsync-nncp-over-filespooler
Status Code
Success (20)
Meta
text/gemini; charset=utf-8; lang=en; size=4293
Capsule Response Time
871.19098 milliseconds
Gemini-to-HTML Time
2.350595 milliseconds

This content has been proxied by September (ba2dc).