dariok / exgit Goto Github PK
View Code? Open in Web Editor NEWJGit-based plugin for eXist-DB
License: BSD 3-Clause "New" or "Revised" License
JGit-based plugin for eXist-DB
License: BSD 3-Clause "New" or "Revised" License
Until recently (2020) distroless java 8 container did not contain enough configuration to use UTF-8 filenames correctly with the File.io API. The nio.Files API used by exist-db itself works.
Patching jgit did not help
This is not easy to fix on exgit side. Rebuilding the exist container is a better option and solves this.
running mvn clean package
inside a freshly checked version of the repository exits with
[WARNING] The POM for org.eclipse.jgit:org.eclipse.jgit:jar:3.2.0-SNAPSHOT is missing, no dependency information available
Environment:
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T13:57:37+02:00)
Java version: 1.8.0_25, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_25\jre
Default locale: de_DE, platform encoding: Cp1252
OS name: "windows 8.1", version: "6.3", arch: "amd64", family: "dos"
SSH transport and auth via key should be possible
-> load form config (#1)
In order to, e.g., check out a release from github, a list of tags is necessary.
This should be done while writing a new and improved Sync.java (#3)
It should be possible to pass a sequence of paths to these functions to explicitly say which files to sync. May be a part of #15
Though working, the eXist File XQuery module is rather outdated. It might be a good idea to write a smaller module that use current Java functions.
If the user has no write access, error 522a is returned.
Lines 395ff. need additional catches for the specific errors.
With a lot of file action, we may get a huge amount of data
Suggestion by @dasch124:
not only export/import of changed files, but also delete files
a) on the server
b) in the repo
c) both ways
Intermediary step for #25
Currently exgit:import() only imports XML data. It would be nice if also binary data would be imported (ideal would be a glob pattern to have some control over what file types get imported and which ones don't)
reported by @dasch124
The given path was found, not empty and is not a repo: /opt/exist/webapp/WEB-INF/data/exgitrepos/wboe_articles. [source: xquery version "3.1";
import module namespace exgit="http://exist-db.org/xquery/exgit" at "java:org.exist.xquery.modules.exgit.Exgit";
let $repoDir := "/opt/exist/webapp/WEB-INF/data/exgitrepos/wboe_articles"
let $collection := "/db/apps/wboe-api/data"
let $pull := exgit:pull($repoDir, "origin", "{user}", "{password}")
return exgit:import($repoDir, $collection)]
den pfad gibt es und er ist natürlich nicht leer, weil der clone vom repo darin liegt
In order to speed things up and avoid unnecessary load, compare hashes before importing/exporting
If a git repository contains a non-wellformed XML document, exgit:import() stops and the rest of the repository is not imported at all. It would be good that a well-formed XML document would be ignored (or uploaded as binary content into existdb).
adding new files to my exist-db collection and running something like the script below does not add (git add) those new files
let $repoDir := "C:\Users\pandorfer\Desktop\gittest"
let $collection := "/db/apps/rita-new/data"
let $export := exgit:export($repoDir, $collection)
let $message := "added a new file to see if it gets picked up"
let $authorName := "some name"
let $authorMail := "[email protected]"
let $commit := exgit:commit($repoDir, $message, $authorName, $authorMail)
let $push := exgit:push($repoDir, "origin", "username", "pw")
though changes in already added files are picked up perfectly
Both sync functions need an optional filter so only certain files are synced (e.g. to regularly sync wdbmeta or so that after a store trigger only the changed file and updates wdbmeta are exported, committed and pushed).
currently, one has to rely on a git repository already being present on the server side. It would be great to also clone a repository via eXgit (ideally also checking out a specific tag or commit)
Currently, only for pull
as reported by @dasch124: import will stall completely when the user executing the query has no +w righht
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.