Compare commits
16 Commits
4473dc9164
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 26df70f9f5 | |||
| 96e66be50e | |||
| c0b566fc70 | |||
| bdcb3d1d20 | |||
| cc2df21796 | |||
| f546ee450e | |||
| 6d165a3912 | |||
| 3edb5c33ee | |||
| ab87e943f3 | |||
| 39f85a3900 | |||
| af0f03758a | |||
| dee7c95542 | |||
| c7a3690129 | |||
| 0d8cddb9be | |||
| 9bca886629 | |||
| edc6d5acf3 |
@@ -41,6 +41,53 @@ jobs:
|
||||
fi
|
||||
${UPX_DIR}/upx build/converge
|
||||
|
||||
- name: Build Arch package
|
||||
run: |
|
||||
# Build the package inside an Arch Linux container.
|
||||
# Pipe workspace via stdin to avoid Docker-in-Docker volume mount issues.
|
||||
# All build output goes to stderr (visible in logs); only the package
|
||||
# tar goes to stdout so it can be captured cleanly.
|
||||
tar cf - --exclude=.stack-root --exclude=.stack-work . | \
|
||||
docker run --rm -i -w /build archlinux:latest bash -c "
|
||||
mkdir -p /build &&
|
||||
cd /build &&
|
||||
tar xf - &&
|
||||
pacman -Syu --noconfirm >&2 &&
|
||||
pacman -S --noconfirm git fakeroot debugedit >&2 &&
|
||||
useradd -m build &&
|
||||
chown -R build:build . &&
|
||||
runuser -u build -- makepkg --noconfirm --nodeps --nocheck >&2 &&
|
||||
tar cf /dev/stdout converge-*.pkg.tar.zst
|
||||
" > /tmp/packages.tar
|
||||
tar xf /tmp/packages.tar
|
||||
echo "pkgfile=$(ls converge-[0-9]*.pkg.tar.zst)" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Publish to Arch repo
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
env:
|
||||
SSH_AUTH_SOCK: /dev/null
|
||||
run: |
|
||||
# Set up SSH
|
||||
mkdir -p "$HOME/.ssh"
|
||||
echo "${{ secrets.ARCH_REPO_SSH_KEY }}" > "$HOME/.ssh/id_ed25519"
|
||||
chmod 600 "$HOME/.ssh/id_ed25519"
|
||||
ssh-keyscan -H "${{ vars.ARCH_REPO_HOST }}" >> "$HOME/.ssh/known_hosts" 2>/dev/null
|
||||
|
||||
PKGFILE="${{ env.pkgfile }}"
|
||||
echo "Uploading $PKGFILE to ${{ vars.ARCH_REPO_HOST }}..."
|
||||
|
||||
# Upload the package
|
||||
scp -v -i "$HOME/.ssh/id_ed25519" \
|
||||
"$PKGFILE" \
|
||||
"${{ vars.ARCH_REPO_USER }}@${{ vars.ARCH_REPO_HOST }}:${{ vars.ARCH_REPO_PATH }}/"
|
||||
|
||||
# Add to repo database
|
||||
ssh -v -i "$HOME/.ssh/id_ed25519" \
|
||||
"${{ vars.ARCH_REPO_USER }}@${{ vars.ARCH_REPO_HOST }}" \
|
||||
"cd '${{ vars.ARCH_REPO_PATH }}' && \
|
||||
repo-add '${{ vars.ARCH_REPO_DB }}' '$PKGFILE' && \
|
||||
rm -f '$PKGFILE.old'"
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
|
||||
@@ -12,3 +12,5 @@ dist-newstyle/
|
||||
.pi/
|
||||
converge-relay/.go-cache/
|
||||
converge-relay/build/
|
||||
*.pkg.tar
|
||||
pkg/
|
||||
|
||||
@@ -20,7 +20,7 @@ test/GitPullSpec.hs # Pull/rebase tests
|
||||
test/GitSafetySpec.hs # Operation-in-progress detection tests
|
||||
SPEC.md # Human-readable specifications
|
||||
converge.example.yaml # Example config file
|
||||
converge.service # systemd unit file
|
||||
converge.service # systemd user service (daemon mode)
|
||||
```
|
||||
|
||||
## Architecture
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Contributor: James Brechtel <james@leonard-brechtel.com.com>
|
||||
|
||||
pkgname=converge
|
||||
_pkgver=0.1.0.0
|
||||
_pkgver=0.2.0.0
|
||||
pkgver=${_pkgver//-/_}
|
||||
pkgrel=1
|
||||
pkgdesc="Auto-sync git repositories by watching for changes, committing, pulling, and pushing"
|
||||
@@ -24,6 +24,7 @@ md5sums=(
|
||||
|
||||
build() {
|
||||
cd "$startdir"
|
||||
echo "$startdir"
|
||||
|
||||
# Use pre-built binary if available (e.g. from scripts/build), otherwise build from source
|
||||
if [[ -x build/converge ]]; then
|
||||
@@ -53,7 +54,7 @@ package() {
|
||||
install -Dm755 "$srcdir/bin/converge" \
|
||||
"$pkgdir/usr/bin/converge"
|
||||
|
||||
# User systemd service
|
||||
# User systemd services
|
||||
install -Dm644 converge.service \
|
||||
"$pkgdir/usr/lib/systemd/user/converge.service"
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
## Supports logging to a file instead of stderr via --log-file or log_file config
|
||||
## Can notify on pull: per-repo notify_on_pull setting sends a desktop notification when new commits are pulled from the remote
|
||||
|
||||
## --sync / -s flag runs a single sync cycle (commit + pull + push) and exits, useful for wake-from-sleep hooks
|
||||
## --sync / -s flag runs a single sync cycle (commit + pull + push) and exits
|
||||
|
||||
## Can connect to a converge-relay SSE endpoint and automatically pull when push events arrive
|
||||
### Configured via --relay-url CLI flag or relay_url config file entry
|
||||
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
cabal-version: 2.2
|
||||
|
||||
-- This file has been generated from package.yaml by hpack version 0.38.1.
|
||||
--
|
||||
-- see: https://github.com/sol/hpack
|
||||
|
||||
name: converge
|
||||
version: 0.1.0.1
|
||||
synopsis: Auto-sync a git repository by watching for changes, committing, and pulling
|
||||
description: Converge watches a git repository for file changes, automatically
|
||||
commits them, and pulls from the remote. It notifies the user via
|
||||
libnotify/notify-send when merge conflicts arise.
|
||||
author: James Leonard-Brechtel
|
||||
maintainer: james@leonard-brechtel.com
|
||||
copyright: 2026 James Leonard-Brechtel
|
||||
license: BSD-3-Clause
|
||||
build-type: Simple
|
||||
|
||||
library
|
||||
exposed-modules:
|
||||
Converge
|
||||
other-modules:
|
||||
Paths_converge
|
||||
autogen-modules:
|
||||
Paths_converge
|
||||
hs-source-dirs:
|
||||
src
|
||||
default-extensions:
|
||||
OverloadedStrings
|
||||
RecordWildCards
|
||||
ScopedTypeVariables
|
||||
TupleSections
|
||||
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints
|
||||
build-depends:
|
||||
aeson
|
||||
, async
|
||||
, base >=4.7 && <5
|
||||
, bytestring
|
||||
, directory
|
||||
, filepath
|
||||
, fsnotify
|
||||
, http-client
|
||||
, http-client-tls
|
||||
, http-types
|
||||
, optparse-applicative
|
||||
, process
|
||||
, text
|
||||
, time
|
||||
, unix
|
||||
, yaml
|
||||
default-language: Haskell2010
|
||||
|
||||
executable converge
|
||||
main-is: Main.hs
|
||||
other-modules:
|
||||
Paths_converge
|
||||
autogen-modules:
|
||||
Paths_converge
|
||||
hs-source-dirs:
|
||||
app
|
||||
default-extensions:
|
||||
OverloadedStrings
|
||||
RecordWildCards
|
||||
ScopedTypeVariables
|
||||
TupleSections
|
||||
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N
|
||||
build-depends:
|
||||
aeson
|
||||
, async
|
||||
, base >=4.7 && <5
|
||||
, bytestring
|
||||
, converge
|
||||
, directory
|
||||
, filepath
|
||||
, fsnotify
|
||||
, http-client
|
||||
, http-client-tls
|
||||
, http-types
|
||||
, optparse-applicative
|
||||
, process
|
||||
, text
|
||||
, time
|
||||
, unix
|
||||
, yaml
|
||||
default-language: Haskell2010
|
||||
|
||||
test-suite converge-test
|
||||
type: exitcode-stdio-1.0
|
||||
main-is: Spec.hs
|
||||
other-modules:
|
||||
GitCommitSpec
|
||||
GitPullSpec
|
||||
GitSafetySpec
|
||||
RelaySpec
|
||||
TestHelper
|
||||
Paths_converge
|
||||
autogen-modules:
|
||||
Paths_converge
|
||||
hs-source-dirs:
|
||||
test
|
||||
default-extensions:
|
||||
OverloadedStrings
|
||||
RecordWildCards
|
||||
ScopedTypeVariables
|
||||
TupleSections
|
||||
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N
|
||||
build-depends:
|
||||
aeson
|
||||
, async
|
||||
, base >=4.7 && <5
|
||||
, bytestring
|
||||
, converge
|
||||
, directory
|
||||
, filepath
|
||||
, fsnotify
|
||||
, hspec
|
||||
, http-client
|
||||
, http-client-tls
|
||||
, http-types
|
||||
, optparse-applicative
|
||||
, process
|
||||
, temporary
|
||||
, text
|
||||
, time
|
||||
, unix
|
||||
, yaml
|
||||
default-language: Haskell2010
|
||||
+1
-1
@@ -6,7 +6,7 @@ Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=%h/.local/bin/converge --config %h/.config/converge/config.yaml
|
||||
ExecStart=/usr/bin/converge --config %h/.config/converge/config.yaml
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
name: converge
|
||||
version: 0.1.0.0
|
||||
version: 0.1.0.1
|
||||
synopsis: Auto-sync a git repository by watching for changes, committing, and pulling
|
||||
description: |
|
||||
Converge watches a git repository for file changes, automatically
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
[Unit]
|
||||
Description=Converge - sync repos after waking from sleep
|
||||
Documentation=https://github.com/jbrechtel/converge
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/converge --sync
|
||||
# Small delay as a safety net for environments (e.g. netctl) where
|
||||
# network-online.target may not gate properly on resume, giving the
|
||||
# network stack time to reconnect before converge attempts to pull.
|
||||
ExecStartPre=/bin/sleep 5
|
||||
|
||||
# Allow notify-send to reach the desktop session
|
||||
Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%U/bus
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
/work/personal/converge/converge.example.yaml
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
/work/personal/converge/converge.service
|
||||
Reference in New Issue
Block a user