#!/bin/sh -x
rm -rf node_modules
npm install \
    nci \
    nci-gogs-webhook \
    nci-github-webhook \
    nci-gitlab-webhook \
    nci-ssh-node \
    nci-mail-notification \
    nci-express \
    nci-yaml-reader \
    nci-scheduler \
    nci-projects-reloader \
    nci-static-server \
    nci-rest-api-server
version=`grep '"version"' node_modules/nci/package.json | head -1 | sed -e 's;.*: ";;' -e 's;".*;;'`
date=`date '+%Y%m%d'`
tar cvf - node_modules | xz -9 >nci-$version-$date.tar.xz
rm -rf node_modules
