README: Add some more documentation

* How to checkout the code
 * How to run straight from the git tree
 * Links to further reading
This commit is contained in:
Martin Pitt 2018-05-09 16:40:59 +02:00
parent 1edb6a070b
commit d265571538

View file

@ -2,10 +2,18 @@
Scaffolding for a [Cockpit](http://www.cockpit-project.org) module.
# Building
# Getting and building the source
Run `make` to build the package. It builds into the `dist` directory. Link or
copy that to a location were `cockpit-bridge` looks for packages.
Make sure you have `npm` available (usually from your distribution package).
These commands check out the source and build it into the `dist/` directory:
```
git clone https://github.com/cockpit-project/starter-kit.git`
cd starter-kit`
make
```
# Installing
`make install` compiles and installs the package in `/usr/share/cockpit/`. The
convenience targets `srpm` and `rpm` build the source and binary rpms,
@ -14,7 +22,18 @@ to generate the distribution tarball. In `production` mode, source files are
automatically minified and compressed. Set `NODE_ENV=production` if you want to
duplicate this behavior.
# Testing
For development, you usually want to run your module straight out of the git
tree. To do that, link that to the location were `cockpit-bridge` looks for packages:
```
mkdir -p ~/.local/share/cockpit
ln -s `pwd`/dist ~/.local/share/cockpit/starter-kit
```
After changing the code and running `make` again, reload the Cockpit page in
your browser.
# Automated Testing
Run `make check` to build an RPM, install it into a standard Cockpit test VM
(centos-7 by default), and run the test/check-application integration test on
@ -50,3 +69,10 @@ change:
find -iname '*starter*'
git grep -i starter
# Further reading
* The [Starter Kit announcement](http://cockpit-project.org/blog/cockpit-starter-kit.html)
blog post explains the rationale for this project.
* [Cockpit Deployment and Developer documentation](http://cockpit-project.org/guide/latest/)
* [Make your project easily discoverable](http://cockpit-project.org/blog/making-a-cockpit-application.html)