Skip to content

livelykernel scripts

rksm edited this page Apr 23, 2013 · 10 revisions

lk build-libs

Used for assembling / compiling / minimizing the necessary lib files for Lively.

Available options:
  -h, --help         Show this help
      --lk-dir DIR   Path to Lively Kernel core directory

lk core-link

Make a new version of LivelyKernel core (specified by '--tag') and link that new version to webwerstatt. This operates on local LivelyKernel core and webwerkstatt repositories that are specified by '--lk-dir' and '--ww-dir'. The script will

  1. Update both repos
  2. Ask you to update the change log (release documentation, History.md)
  3. Update the version file (coreVersion.json)
  4. Update npm package file (package.json)
  5. Syncing the core source code with the webwerksatt code (uses lk sync)
  6. Tag the git core reposiory with the new version.

To really make the changes on the remote repositories you will have to run 'git push' and 'svn commit' afterwards

Available options:
  -h, --help         foo
  -t, --tag TAG      New version tag
      --lk-dir DIR   Path to Lively-Kernel repository
      --ww-dir DIR   Path to Lively-Kernel repository

lk jshint

Run jshint on files in ```lk-scripts dir``/minimal_server/and`lk-scripts dir`/scripts/testing/`

Available options:
  -h, --help    show this help
  -w, --watch   Run with nodemon and watch for file changes

lk partsbin

Installs and updates the webwerkstatt PartsBin

Available options:
  -h, --help      Show this help.
  -d, --dir DIR   Use DIR to install or update the PartsBin from http://lively-kernel.org/repository/webwerkstatt/PartsBin/. If DIR is not specified  use /Users/robert/Lively/webwerkstatt/PartsBin/.

lk scripts-dir

Prints the path to where livelykernel-scripts is located.

Available options:
  -h, --help   Show this help.

lk selfpublish

This function publishes the livelykernel-scripts project. It runs the following steps:

  1. update package json

  2. check if the new version is in History.md

  3. git add && git ci

  4. git tag

  5. git push

  6. git tag push

  7. npm publish optionalVersion can either be a version in the format x.y.z (a string) or null. If null, the existing minor version (z) is increased

    Available options: -h, --help Show this help -t, --tag TAG New version tag, in the form of x.y.z.

lk selftest

lk selftest: Run the script and server tests.

Available options:
  -h, --help   show this help

lk server

Start a server to be used for running the tests. Either -m or -s must be given.

Available options:
  -h, --help                     show this help
  -w, --watch [DIR]              Run with nodemon and watch for file changes
  -f, --forever                  Run with forever and restart server on a crash
      --forever-log-dir DIR      Where the forever stdout and stderr log is placed
  -p, --port NUMBER              On which port to run
  -m, --mini-server              Start the minimal server (this is the default)
  -s, --life-star                Start the Life Star server (fully operational!)
      --log-level STRING         Log level, accepted values: error, warning, info, debug
      --lk-dir DIR               The directory of the Lively Kernel core repository (git) 
      --behind-proxy             Add this option if requests going to the server are proxied by another server, e.g. Apache
      --enable-ssl               Enable https server
      --enable-ssl-client-auth   Whether to use authentication via SSL client certificate
      --ssl-server-key FILE      Where the server key is located
      --ssl-server-cert FILE     Where the server certificate is located
      --ssl-ca-cert FILE         Where the CA certificate is located
      --info                     Print whether there is a running server on the specified port or 9001 and the process pid
      --kill                     Stop the server process for the specified port or 9001 if there exist one.
      --no-subservers            By default servers in /Users/robert/Dropbox/Projects/LivelyKernel/ are started with the core server. Setting this option disables this behavior
      --subserver STRING         Add a subserver, expects filesystem path to js file like "foo/bar.js" to start subserver bar. Aliasing supported via "baz:foo/bar.js" to start subserver bar.js as baz.

lk sync

This utility rsyncs changes from local Webwerkstatt repositories to local Lively Kernel core repositories and vice versa. It is internally used by lk ww-mirror and lk core-link, however, it is also useful in itself when porting changes between git and svn.

It applies modifications only locally and will not commit any changes.

In case you want to reset the local changes following commands are handy: git: git clean -f -d && git reset --hard svn: svn revert core/ -R

Available options:
  -h, --help               Show this help
      --from-ww-to-lk      Update a lk repo with ww changes
      --from-lk-to-ww      Update ww working copy with lk changes
      --ww-dir DIR         Path to Webwerkstatt repository
      --lk-dir DIR         Path to Lively Kernel repository
  -cp, --cherry-pick FILE   read cherry-pick spec (according to ww-merge/cherry-pick.js) from FILE which will apply and commit changes from ww-mirror

lk test

Run the core tests.

Available options:
  -h, --help               show this help
  -w, --watch [DIR]        Run with nodemon and watch for file changes
  -v, --verbose            Print progress and debug information.
  -b, --browser NAME       Which browser to use. Options are "chrome", "firefox". If not specified then "chrome" is used.
  -n, --notifier NAME      Use a system notifier to output results. Currently "growlnotify" is supported.
  -m, --modules NAMES      Additional modules to load, comma separated
  -d, --display NUMBER     Secify a display id for running chrome with xvfb
  -f, --focus FILTER       A filter is a string that can have threeparts separated by "|". All parts define JS regexps.
                The first is for matching test modules to load, the second matches test classes, the third test methodnames.
                Example: "testframework|.*|filter" will only run those tests that are in modules matching 'testframework' and are
                defined inthose test methods that match 'filter'.
      --test-script FILE   Script file that is sent to the browser and runs the tests. If not specified then "run_tests.js" is used.
      --nodejs             Runs the nodejs test suite instead of the browser tests

lk userdir

Installs and updates the user directories from webwerkstatt.

Available options:
  -h, --help        Show this help.
  -d, --dir DIR     Use DIR to install or update the user directory from http://lively-kernel.org/repository/webwerkstatt/users/. If DIR is not specified  use /Users/robert/Dropbox/Projects/users.
  -u, --user NAME   Mandatory. Definies which user directory to sync.

lk workspace

Script that manages local copies of the LivelyKernel core and webwerksatt repository in /Users/robert/Dropbox/Projects/lk-scripts/workspace/

Available options:
  -h, --help                        show this help
  -u, --update                      update the svn and git repositories with remote changes if they exist
  -r, --reset                       reset the svn and git repositories if they exist but do not delete them
      --github-write-access [URL]   Initialize the lk core git repo with commit access to either the given URL or when not specified to git@github.com:LivelyKernel/LivelyKernel.git
      --remove                      completely delete the workspace
      --checkout-ww                 create ./workspace/ww/, checked out from http://lively-kernel.org/repository/webwerkstatt/
      --checkout-lk                 create ./workspace/lk/, checked out from git@github.com:LivelyKernel/LivelyKernel.git on branch master
      --init                        Do both a --checkout-lk and download the PartsBin with "lk partsbin -d /Users/robert/Dropbox/Projects/LivelyKernel/"

lk ww-diff

This tool will produce a JSON diff between the current webwerkstatt version and the HEAD of the master branch of the LK core git repository.

Available options:
  -h, --help          show this help
      --lk DIR        Root directory of the Lively Kernel git repository.If not set then look for /Users/robert/Dropbox/Projects/LivelyKernel/
      --ww DIR        Root directory of the Webwerksatt svn repository.If not set then look for /Users/robert/Lively/webwerkstatt/
      --output FILE   JSON file to write the diff report into. If not specified then /Users/robert/Dropbox/Projects/lk-scripts/workspace/ww-lk-diff.json is used

lk ww-mirror

This script will rsync the webwerkstatt core directory with the ww-mirror branch of the Lively Kernel core repository. The commit message includes the svn revision that was used for the sync. The steps that are done:

  1. lock using a file to not allow concurrent syncs (sync will wait a certain time)
  2. if no core commit, unlock and do nothing
  3. update webwerkstatt working copy
  4. lk sync svn repo with git repo (takes care of deletions, renames)
  5. git reset, clean, pull -- the git repo should be OK, just to be sure
  6. git add, commit, push
  7. unlock

The script is currently used as a post-commit hook for the webwerkstatt repository.

Available options:
  -h, --help            This tool requires a local path to a svn repository and a version number.From that it will rsync
      --svn-repo DIR    Path to svn repository
      --svn-wc DIR      Path to SVN workingcopy that is svn updated and used as a source for the sync
      --git-repo DIR    local path to the git repository with the branch that mirrors the svn reository
      --rev NUM         svn revision that should be synced
      --lockfile FILE   path to lock file used for synchronisation