Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: run callback after incremental update #58

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Loading