Skip to content

Commit a805d2e

Browse files
authored
Merge pull request #58 from eeditiones/feat/callback
Feature: run callback after incremental update
2 parents a670025 + ba091c3 commit a805d2e

25 files changed

+4808
-22113
lines changed

.github/workflows/node.js.yml

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ name: Test
55

66
on:
77
push:
8-
pull_request:
98
schedule:
109
# weekly runs mondays at 08:40
1110
- cron: "40 8 * * 1"

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ With incremental update only the changes to the database collection are applied.
178178
2) click on 'full' to trigger a full deployment from git to existdb
179179
3) now you can update your collection with a click on 'incremental'
180180

181-
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.
181+
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.
182182

183183
> [!NOTE]
184184
> Note that there may be index problems if a collection is not installed as a package.

build.xml

-17
This file was deleted.

gulpfile.js

+9-14
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,15 @@ const rename = require('gulp-rename')
99
const del = require('delete')
1010

1111
const pkg = require('./package.json')
12-
const { version, license } = pkg
12+
const { app, version, license } = pkg
13+
const replacements = [app, { version, license }]
14+
15+
const packageUri = app.namespace
1316

1417
// read metadata from .existdb.json
1518
const existJSON = require('./.existdb.json')
16-
const replacements = [existJSON.package, { version, license }]
17-
18-
const packageUri = existJSON.package.namespace
1919
const serverInfo = existJSON.servers.localhost
20-
const target = serverInfo.root
21-
2220
const url = new URL(serverInfo.server)
23-
// console.log(url)
24-
25-
// FIXME read from .existdb.json
2621
const connectionOptions = {
2722
host: url.hostname,
2823
port: url.port,
@@ -38,7 +33,7 @@ const existClient = createClient(connectionOptions);
3833
* Use the `delete` module directly, instead of using gulp-rimraf
3934
*/
4035
function clean (cb) {
41-
del(['build'], cb);
36+
del(['build', 'dist'], cb);
4237
}
4338
exports.clean = clean
4439

@@ -94,22 +89,22 @@ function watchBuild () {
9489
}
9590

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

9994
/**
10095
* create XAR package in repo root
10196
*/
10297
function xar () {
10398
return src('build/**/*', {base: 'build/'})
104-
.pipe(zip(packageName()))
105-
.pipe(dest('.'))
99+
.pipe(zip(xarFilename))
100+
.pipe(dest('dist'))
106101
}
107102

108103
/**
109104
* upload and install the latest built XAR
110105
*/
111106
function installXar () {
112-
return src(packageName())
107+
return src(xarFilename, { cwd:'dist/', encoding: false })
113108
.pipe(existClient.install({ packageUri }))
114109
}
115110

0 commit comments

Comments
 (0)