Skip to content

Commit

Permalink
Merge pull request #58 from eeditiones/feat/callback
Browse files Browse the repository at this point in the history
Feature: run callback after incremental update
  • Loading branch information
line-o authored Feb 11, 2025
2 parents a670025 + ba091c3 commit a805d2e
Show file tree
Hide file tree
Showing 25 changed files with 4,808 additions and 22,113 deletions.
1 change: 0 additions & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ name: Test

on:
push:
pull_request:
schedule:
# weekly runs mondays at 08:40
- cron: "40 8 * * 1"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ With incremental update only the changes to the database collection are applied.
2) click on 'full' to trigger a full deployment from git to existdb
3) now you can update your collection with a click on 'incremental'

Repositories from which a valid XAR (existing `expath-pkg.xml` and `repo.xml`) package can be generated are installed as a package, all others are created purely on the DB.
Repositories from which a valid XAR (existing `expath-pkg.xml`) package can be generated are installed as a package, all others are created purely on the DB.

> [!NOTE]
> Note that there may be index problems if a collection is not installed as a package.
Expand Down
17 changes: 0 additions & 17 deletions build.xml

This file was deleted.

23 changes: 9 additions & 14 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,15 @@ const rename = require('gulp-rename')
const del = require('delete')

const pkg = require('./package.json')
const { version, license } = pkg
const { app, version, license } = pkg
const replacements = [app, { version, license }]

const packageUri = app.namespace

// read metadata from .existdb.json
const existJSON = require('./.existdb.json')
const replacements = [existJSON.package, { version, license }]

const packageUri = existJSON.package.namespace
const serverInfo = existJSON.servers.localhost
const target = serverInfo.root

const url = new URL(serverInfo.server)
// console.log(url)

// FIXME read from .existdb.json
const connectionOptions = {
host: url.hostname,
port: url.port,
Expand All @@ -38,7 +33,7 @@ const existClient = createClient(connectionOptions);
* Use the `delete` module directly, instead of using gulp-rimraf
*/
function clean (cb) {
del(['build'], cb);
del(['build', 'dist'], cb);
}
exports.clean = clean

Expand Down Expand Up @@ -94,22 +89,22 @@ function watchBuild () {
}

// construct the current xar name from available data
const packageName = () => `${existJSON.package.target}-${pkg.version}.xar`
const xarFilename = `${app.abbrev}-${pkg.version}.xar`

/**
* create XAR package in repo root
*/
function xar () {
return src('build/**/*', {base: 'build/'})
.pipe(zip(packageName()))
.pipe(dest('.'))
.pipe(zip(xarFilename))
.pipe(dest('dist'))
}

/**
* upload and install the latest built XAR
*/
function installXar () {
return src(packageName())
return src(xarFilename, { cwd:'dist/', encoding: false })
.pipe(existClient.install({ packageUri }))
}

Expand Down
Loading

0 comments on commit a805d2e

Please sign in to comment.