Init empty project
This commit is contained in:
parent
d9a67b1f86
commit
3a5489ce00
10 changed files with 22 additions and 164 deletions
120
README.md
120
README.md
|
|
@ -1,119 +1,7 @@
|
||||||
# Cockpit Starter Kit
|
# cockpitcertificates-
|
||||||
|
|
||||||
Scaffolding for a [Cockpit](http://www.cockpit-project.org) module.
|
A certificate management plugin for [Cockpit](https://cockpit-project.org/)
|
||||||
|
|
||||||
# Getting and building the source
|
Work in progress.
|
||||||
|
|
||||||
Make sure you have `npm` available (usually from your distribution package).
|
Based on the [Cockpit Starter Kit](https://github.com/cockpit-project/starter-kit).
|
||||||
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,
|
|
||||||
respectively. Both of these make use of the `dist-gzip` target, which is used
|
|
||||||
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.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
You can also use
|
|
||||||
[watch mode](https://webpack.js.org/guides/development/#using-watch-mode) to
|
|
||||||
automatically update the webpack on every code change with
|
|
||||||
|
|
||||||
$ npm run watch
|
|
||||||
|
|
||||||
or
|
|
||||||
|
|
||||||
$ make watch
|
|
||||||
|
|
||||||
# Running eslint
|
|
||||||
|
|
||||||
Cockpit Starter Kit uses [ESLint](https://eslint.org/) to automatically check
|
|
||||||
JavaScript code style in `.js` and `.jsx` files.
|
|
||||||
|
|
||||||
The linter is executed within every build as a webpack preloader.
|
|
||||||
|
|
||||||
For developer convenience, the ESLint can be started explicitly by:
|
|
||||||
|
|
||||||
$ npm run eslint
|
|
||||||
|
|
||||||
Violations of some rules can be fixed automatically by:
|
|
||||||
|
|
||||||
$ npm run eslint:fix
|
|
||||||
|
|
||||||
Rules configuration can be found in the `.eslintrc.json` file.
|
|
||||||
|
|
||||||
# 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
|
|
||||||
it. This uses Cockpit's Chrome DevTools Protocol based browser tests, through a
|
|
||||||
Python API abstraction. Note that this API is not guaranteed to be stable, so
|
|
||||||
if you run into failures and don't want to adjust tests, consider checking out
|
|
||||||
Cockpit's test/common from a tag instead of master (see the `test/common`
|
|
||||||
target in `Makefile`).
|
|
||||||
|
|
||||||
After the test VM is prepared, you can manually run the test without rebuilding
|
|
||||||
the VM, possibly with extra options for tracing and halting on test failures
|
|
||||||
(for interactive debugging):
|
|
||||||
|
|
||||||
TEST_OS=centos-7 test/check-application -tvs
|
|
||||||
|
|
||||||
You can also run the test against a different Cockpit image, for example:
|
|
||||||
|
|
||||||
TEST_OS=fedora-28 make check
|
|
||||||
|
|
||||||
# Vagrant
|
|
||||||
|
|
||||||
This directory contains a Vagrantfile that installs and starts cockpit on a
|
|
||||||
Fedora 26 cloud image. Run `vagrant up` to start it and `vagrant rsync` to
|
|
||||||
synchronize the `dist` directory to `/usr/local/share/cockit/starter-kit`. Use
|
|
||||||
`vagrant rsync-auto` to automatically sync when contents of the `dist`
|
|
||||||
directory change.
|
|
||||||
|
|
||||||
# Customizing
|
|
||||||
|
|
||||||
After cloning the Starter Kit you should rename the files, package names, and
|
|
||||||
labels to your own project's name. Use these commands to find out what to
|
|
||||||
change:
|
|
||||||
|
|
||||||
find -iname '*starter*'
|
|
||||||
git grep -i starter
|
|
||||||
|
|
||||||
# Automated release
|
|
||||||
|
|
||||||
Once your cloned project is ready for a release, you should consider automating
|
|
||||||
that. [Cockpituous release](https://github.com/cockpit-project/cockpituous/tree/master/release)
|
|
||||||
aims to fully automate project releases to GitHub, Fedora, Ubuntu, COPR, Docker
|
|
||||||
Hub, and other places. The intention is that the only manual step for releasing
|
|
||||||
a project is to create a signed tag for the version number; pushing the tag
|
|
||||||
then triggers a GitHub webhook that calls a set of release scripts (on
|
|
||||||
Cockpit's CI infrastructure).
|
|
||||||
|
|
||||||
starter-kit includes an example [cockpitous release script](./cockpituous-release)
|
|
||||||
that builds an upstream release tarball and source RPM. Please see the above
|
|
||||||
cockpituous documentation for details.
|
|
||||||
|
|
||||||
# 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)
|
|
||||||
|
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
Name: cockpit-starter-kit
|
|
||||||
Version: @VERSION@
|
|
||||||
Release: 1%{?dist}
|
|
||||||
Summary: Cockpit Starter Kit Example Module
|
|
||||||
License: LGPLv2+
|
|
||||||
|
|
||||||
Source: cockpit-starter-kit-%{version}.tar.gz
|
|
||||||
BuildArch: noarch
|
|
||||||
BuildRequires: libappstream-glib
|
|
||||||
|
|
||||||
Requires: cockpit-system
|
|
||||||
|
|
||||||
%define debug_package %{nil}
|
|
||||||
|
|
||||||
%description
|
|
||||||
Cockpit Starter Kit Example Module
|
|
||||||
|
|
||||||
%prep
|
|
||||||
%setup -n cockpit-starter-kit
|
|
||||||
|
|
||||||
%install
|
|
||||||
%make_install
|
|
||||||
appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/metainfo/*
|
|
||||||
|
|
||||||
# drop source maps, they are large and just for debugging
|
|
||||||
find %{buildroot}%{_datadir}/cockpit/ -name '*.map' | xargs rm --verbose
|
|
||||||
|
|
||||||
%files
|
|
||||||
%{_datadir}/cockpit/*
|
|
||||||
%{_datadir}/metainfo/*
|
|
||||||
|
|
||||||
%changelog
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
# Check cockpituous documentation for available release targets.
|
# Check cockpituous documentation for available release targets.
|
||||||
|
|
||||||
RELEASE_SOURCE="_release/source"
|
RELEASE_SOURCE="_release/source"
|
||||||
RELEASE_SPEC="cockpit-starter-kit.spec"
|
RELEASE_SPEC="cockpit-certificates.spec"
|
||||||
RELEASE_SRPM="_release/srpm"
|
RELEASE_SRPM="_release/srpm"
|
||||||
|
|
||||||
job release-source
|
job release-source
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
{
|
{
|
||||||
"name": "starter-kit",
|
"name": "certificates",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"description": "Scaffolding for a cockpit module",
|
"description": "Scaffolding for a cockpit module",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"repository": "git@github.com:cockpit/starter-kit.git",
|
"repository": "git@github.com:skobyda/certificates.git",
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "LGPL-2.1",
|
"license": "LGPL-2.1",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
||||||
8
po/de.po
8
po/de.po
|
|
@ -1,8 +1,8 @@
|
||||||
# starter-kit German translations
|
# certificates German translations
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: starter-kit 1.0\n"
|
"Project-Id-Version: certificates 1.0\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2018-08-29 00:14+0200\n"
|
"POT-Creation-Date: 2018-08-29 00:14+0200\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
|
|
@ -14,7 +14,7 @@ msgstr ""
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
#: src/index.html:20
|
#: src/index.html:20
|
||||||
msgid "Cockpit Starter Kit"
|
msgid "Cockpit Certificates"
|
||||||
msgstr "Cockpit Bausatz"
|
msgstr "Cockpit Bausatz"
|
||||||
|
|
||||||
#: src/app.jsx:42
|
#: src/app.jsx:42
|
||||||
|
|
@ -22,7 +22,7 @@ msgid "Running on $0"
|
||||||
msgstr "Läuft auf $0"
|
msgstr "Läuft auf $0"
|
||||||
|
|
||||||
#: src/manifest.json
|
#: src/manifest.json
|
||||||
msgid "Starter Kit"
|
msgid "Certificates"
|
||||||
msgstr "Bausatz"
|
msgstr "Bausatz"
|
||||||
|
|
||||||
#: src/app.jsx:29
|
#: src/app.jsx:29
|
||||||
|
|
|
||||||
|
|
@ -34,11 +34,13 @@ export class Application extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
const path = getRequests();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="container-fluid">
|
<div className="container-fluid">
|
||||||
<h2>Starter Kit</h2>
|
<h2>Certificates</h2>
|
||||||
<p>
|
<p>
|
||||||
{ cockpit.format(_("Running on $0"), this.state.hostname) }
|
{ cockpit.format(_("Running on $0"), path) }
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ along with this package; If not, see <http://www.gnu.org/licenses/>.
|
||||||
-->
|
-->
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title translatable="yes">Cockpit Starter Kit</title>
|
<title translatable="yes">Cockpit Certificates</title>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="description" content="">
|
<meta name="description" content="">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
"tools": {
|
"tools": {
|
||||||
"index": {
|
"index": {
|
||||||
"label": "Starter Kit"
|
"label": "Certificates"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,9 @@ class TestApplication(testlib.MachineCase):
|
||||||
b = self.browser
|
b = self.browser
|
||||||
m = self.machine
|
m = self.machine
|
||||||
|
|
||||||
self.login_and_go("/starter-kit")
|
self.login_and_go("/certificates")
|
||||||
# verify expected heading
|
# verify expected heading
|
||||||
b.wait_text(".container-fluid h2", "Starter Kit")
|
b.wait_text(".container-fluid h2", "Certificates")
|
||||||
|
|
||||||
# verify expected host name
|
# verify expected host name
|
||||||
hostname = m.execute("hostname").strip()
|
hostname = m.execute("hostname").strip()
|
||||||
|
|
@ -43,10 +43,10 @@ class TestApplication(testlib.MachineCase):
|
||||||
b.reload(ignore_cache=True)
|
b.reload(ignore_cache=True)
|
||||||
b.wait_present("#content")
|
b.wait_present("#content")
|
||||||
# menu label (from manifest) should be translated
|
# menu label (from manifest) should be translated
|
||||||
b.wait_text("#host-apps a[href='/starter-kit']", "Bausatz")
|
b.wait_text("#host-apps a[href='/certificates']", "Bausatz")
|
||||||
|
|
||||||
b.go("/starter-kit")
|
b.go("/certificates")
|
||||||
b.enter_page("/starter-kit")
|
b.enter_page("/certificates")
|
||||||
# page label (from js) should be translated
|
# page label (from js) should be translated
|
||||||
b.wait_in_text(".container-fluid p", "Läuft auf")
|
b.wait_in_text(".container-fluid p", "Läuft auf")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue