Commit graph

263 commits

Author SHA1 Message Date
Pino Toscano
0ece83483d Makefile: avoid spurious echo
Disable the printing of the echo commands that write the filename of the
VM image for tests in the 'vm' and 'print-vm' targets.

This makes it possible to use their outputs, especially the 'print-vm'
target.
2022-04-27 06:55:58 +02:00
Martin Pitt
a937b82cd2 test: Bump Cockpit test API to 267, use --track-naughties option
run-tests recently got a new `--track-naughties` option [1] to explicitly
enable updating known issues on GitHub. Enable it for CI runs, and leave
it disabled for local runs and PackIt, as in these cases we don't want
to try and talk to GitHub.

[1] 7ef88e80ce
2022-04-19 13:14:21 +02:00
Pino Toscano
fde873e0bd Makefile: add convenience 'devel-uninstall' target
Add a simple convenience target to "undo" what the devel-install did
(creating a symlink to ~/.local/share/cockpit), i.e. simply removing
that symlink.

Suggested by: Christopher Snyder
2022-03-31 10:35:11 +02:00
Pino Toscano
9357e55fc6 Makefile: add convenience 'print-vm' target
Add a simple convenience target that prints the filename of the test
image without creating it beforehand. This can be useful to know what is
the expected filename, so it is possible to provide an own test image
instead of the generated one.
2022-03-31 10:01:53 +02:00
Pino Toscano
29abcaab98 Makefile: set reproducible args for tar
When creating the tarballs for sources and node modules, apply some
hardening to the tar compression to remove some variances that may cause
the tarballs to not be reproducible; in particular:
- set fixed modes, and ownership
- set the mtime from the author's timestamp of the top-level commit
- sort the files by name
2022-03-25 09:25:06 +01:00
Pino Toscano
0e0d5bedc5 po: ignore js/jsx/html files under src/lib
Cockpit's PF/React/build library (pkg/lib from cockpit.git) is checked
out as src/lib, so exclude it from the search of js/jsx, and html
sources for the extraction of i18n messages.

This avoids the cockpit messages in case the message extraction is
performed in a source tree after build.
2022-03-23 19:20:19 +01:00
Pino Toscano
c2d704e130 Makefile: add convenience 'srpm' target
Add a simple 'srpm' target that builds the src.rpm file for the current
project.

Partially reverts commit b2662eeebd (at
least to bring the 'srpm' target back).
2022-03-22 14:11:27 +01:00
Pino Toscano
a46b26a8ff Makefile: depend on test/vm.install for the VM image target
Make sure to recreate the VM image in case the test/vm.install script
changes.
2022-03-18 09:10:55 +01:00
Martin Pitt
2f92610f28 Bump cockpit lib and test API to 265
Drop the obsolete expect_load().
2022-03-17 11:43:39 +01:00
Martin Pitt
e2d5995323 Quiesce mock
Drop the image-customize `--verbose` option. mock is incredibly blabbery
about its internals otherwise, and seeing the build log isn't
particularly interesting.
2022-03-17 11:43:39 +01:00
Pino Toscano
80b8949192 Makefile: allow setup of integration tests w/o running them
Add a convenience target in Makefile to perform all the setup targets
for integration tests without actually running them.
2022-03-17 10:21:57 +01:00
Pino Toscano
e0a1fb8a2b Makefile: factorize AppStream filename in own variable
Makes it easier to read, and also to modify for modules outside the
cockpit-project org.
2022-03-10 10:07:26 +01:00
Pino Toscano
4377c4fe19 po: merge translations for metainfo file
When installing the module, instead of copying the metainfo file to the
destination, merge the available translations for it. Since this is done
at install time, add gettext as BuildRequires for the RPM packaging;
add libappstream-glib-devel as well only on RHEL/CentOS 8, since it
contains the metainfo.its for gettext in order to handle .metainfo.xml
files.

This requires a LINGUAS file with the list of translations currently
available: this is the way msgfmt picks the available languages to
merge. Generate it dynamically from the list of available .po files.
2022-03-09 16:02:26 +01:00
Pino Toscano
b5969c1c9b po: extract messages also for metainfo files
Recent versions of gettext know how to extract messages also from XML
files such as AppStream metadata. Hence, extract their messages, and
append them together with the global message catalog.
2022-03-09 16:02:26 +01:00
Pino Toscano
19300113fc po: do not hardcode the domain name
Use $(PACKAGE_NAME) to represent the current project.
2022-03-09 08:45:40 +01:00
Martin Pitt
90ae15d812 test: Prepare VM image without networking
This ensures that we stay independent from any changes that go on in
online repositories, and our mock/pbuilders are sufficiently pre-cached.

Drop the explicit install of `cockpit-ws` -- all our bots images have it
pre-installed.
2022-02-22 14:26:15 +01:00
Martin Pitt
e4732583a9 Use image-customize's new --fresh function
See 468ee1b39e

This avoids hardcoding the test image overlay paths.
2022-02-08 10:47:33 +01:00
Martin Pitt
b2662eeebd Use image-customize --build to build/install distribution packages
This centralizes/factorizes the rpm package builds, and builds
RPM packages in the VM instead of on the host, which is cleaner. It also
paves the way for supporting Debian and arch builds.

Drop the `make srpm` rule, as it's not very useful. Keep the `make rpm`
rule, as sometimes developers do this manually. This might be replaced
later on with another image-customize feature which copies the built rpm
out of the VM.
2022-02-07 15:42:01 +01:00
Martin Pitt
799d8f5cc9 Move spec file into packaging/
This is cleaner once projects add debian and arch packaging.

Factorize the spec name/path in the Makefile.
2022-02-04 08:47:32 +01:00
Martin Pitt
0493621504 Makefile: Factorize rpm name 2022-02-04 08:47:32 +01:00
Martin Pitt
8eaa689491 Bump cockpit lib and test to 262
Create test/reference-image as required by testlib 261.
2022-02-04 08:47:32 +01:00
Jelle van der Waa
9662fb2ffc Add ability to rsync artifacts to a remote machine
Use the CockpitRsyncWebpack plugin to optionally rsync build code to a
remote machine, the destination is determined by looking at the
package.json's name field.
2022-01-04 15:36:52 +01:00
Martin Pitt
5966735547 po: Pick up also strings with specified context
Strings like `_("Context", "String to translate")` were not picked up.

Taken from ba95d680d2
2021-11-19 09:56:23 +01:00
Martin Pitt
cd0b88682d Bump cockpit lib and test framework to 253
No changes necessary.
2021-09-16 10:32:58 +02:00
Martin Pitt
64b83498aa Makefile: Avoid cockpit-po-plugin.js hardlink in dist tarball
Drop the redundant `$(LIB_TEST)` from the tar file list; it is
src/lib/cockpit-po-plugin.js, which is already contained in src/lib, and
tar turns that into an unsightly hardlink.

See https://github.com/cockpit-project/cockpit-machines/issues/379
2021-09-16 09:12:18 +02:00
Martin Pitt
9574611768 Rebuild webpack during RPM build
This is necessary to comply with Fedora's packaging policy:
https://docs.fedoraproject.org/en-US/packaging-guidelines/JavaScript/

Include the node cache in the source rpm, unpack it into the main source
dir, and force a webpack rebuild in `%build`.
2021-09-10 17:50:06 +02:00
Martin Pitt
4ca75f143c Move to xz dist tarballs
For consistency with the already xz'ed node tarball.

Rename the oddly named `dist-gzip` target to the standard `dist`.
2021-09-10 17:50:06 +02:00
Martin Pitt
26be6c8540 Add a make node-cache
The node_modules cache tarball will be published as release artifact, to
make sure that any release can be rebuilt in a reproducible way.

Cockpituous' release-source will call this if available:
https://github.com/cockpit-project/cockpituous/pull/438
2021-09-10 17:50:06 +02:00
Martin Pitt
94194c5187 Makefile: Ship full src/lib/ in release tarballs
Otherwise it is incomplete and can't be rebuilt.
2021-09-10 17:50:06 +02:00
Martin Pitt
e49b2747bc Makefile: Avoid npm dependency for building webpack
Avoid the indirection, and directly call webpack. This avoids adding an
`npm` build dependency if/when the RPM wants to rebuild the webpack
during package build.
2021-09-10 17:50:06 +02:00
Martin Pitt
03d8324c19 Makefile: Avoid moving node_modules/ during dist build
This is ugly as it races with other make targets which expect
node_modules/ to exist. It's also unnecessary, we can just tell tar to
ignore node_modules/.
2021-09-10 17:50:06 +02:00
Martin Pitt
3d227bcb36 Bump Cockpit pkg/lib to 249
Cockpit 247 changed cockpit-po-plugin.js to always expect a line number
in msgid references [1]. Also sync manifest2po from Cockpit 249 to
generate that reference for manifests, so that they keep getting
included into the translation js.

[1] 0ecc3a705d
2021-07-27 09:42:10 +02:00
Martin Pitt
0016765d01 Bump cockpit test API to 249 2021-07-27 09:42:10 +02:00
Allison Karlitskaya
37b2ee5056 various: master → main updates
cockpit/ bots/ and cockpituous/ all use the 'main' branch now.
2021-07-05 10:47:18 +02:00
Martin Pitt
180a48caaa Bump cockpit test/common and lib to 242
731fdf82c0 fixed the
deprecation warning in cockpit-po-plugin:

> node:37175) [DEP_WEBPACK_COMPILATION_ASSETS] DeprecationWarning:
> Compilation.assets will be frozen in future, all modifications are
> deprecated.
> BREAKING CHANGE: No more changes should happen to Compilation.assets
> after sealing the Compilation.
2021-04-19 10:33:02 +02:00
Martin Pitt
2624dbb891 Build and ship LICENSE file
Bring back terser-webpack-plugin from commit c52136c051 and re-enable
it. It builds the autogenerated dist/index.js.LICENSE.txt which is quite
important for shipping distribution packages -- c-{podman,machines} both
do this.

Backport 95021c336e
to make sure that the webpack for the release tarball is *actually*
built in production mode.
2021-04-12 08:45:52 +02:00
Martin Pitt
a26f4048c2 packit: Enable RPM builds and Fedora testing
Teach `make dist-gzip` to print the tarball name as last line, and use
it as `create-archive` action.

Add a `make print-version` command which packit can use. The builtin
default only works if there is at least one git tag, which is not the
case for starter-kit (which is never released).
2021-03-04 11:25:53 +01:00
Martin Pitt
f02f0fd08f Move default TEST_OS to centos-8-stream
We don't run centos-7 in CI any more, and thus can't guarantee that it
works.
2021-03-04 07:43:16 +01:00
Martin Pitt
d4c81c9152 Bump cockpit test API to 239
Replace the deprecated wait_present().
2021-03-04 07:42:37 +01:00
Martin Pitt
b000d6b374 Bump cockpit component library to 238 2021-02-25 08:34:15 +01:00
Martin Pitt
bb06422996
Use Cockpit webpack helpers from cockpit.git
Drop the cockpit-po-plugin.js and sassc-loader.js code copies, and check
them out from a stable cockpit tag, similarly to how we already get the
PatternFly CSS.
2021-01-22 16:04:35 +01:00
Martin Pitt
7f6ef51c12
Build translations with webpack
Convert the `po2json` script into a webpack plugin, and integrate the
(now trivial) po.empty.js template.

This is the last step for building the entire dist/ directory with
`npm run build` (i.e. a tool that web developers are familiar with),
and not having a split webpack+make toolchain any more.
2021-01-05 14:52:59 +01:00
Martin Pitt
07017f79d8 Eliminate POTFILES.*.in files
The `find` is so cheap that there is little point in the POTFILES.*.in
indirection.
2021-01-04 14:01:59 +01:00
Martin Pitt
7fca9b9a26 webpack: Compress css in production mode
Adjust the WEBPACK_TEST file, as index.css is now not reliable (in
production mode it's .css.gz).

Closes #395
2020-11-26 11:17:04 +01:00
Martin Pitt
c1c2d83b81 Bump test/common dependency to 233
This gets rid of the hack for
<https://github.com/cockpit-project/cockpit/issues/14133>.
2020-11-25 21:09:53 +01:00
Martin Pitt
180dde395e Makefile: Fix PO template generation dependencies
*2po tools need the npm modules installed.
2020-10-29 07:23:54 +01:00
Sanne Raymaekers
3703120a23
Makefile: Bump test/common to 230
Closes #385
2020-10-28 10:15:32 +01:00
Martin Pitt
a5ade152a8 npm: Upgrade webpack related development dependencies
compression-webpack-plugin fixes https://www.npmjs.com/advisories/1548

Adjust to new copy-webpack-plugin API.

Thew new modules now create dist/index.html.gz in `NODE_ENV=production`
mode, so switch `WEBPACK_TEST` to index.css instead (which remains
uncompressed in both modes).
2020-09-28 07:49:01 +02:00
Martin Pitt
6bd2f3ed94 Makefile: Serialize git commands using flock
We previously made directories depend on files for the synthetic
serialization of git commands. git does not track directories, and
time stamps across repos (starter-kit vs. bots) work rather poorly --
for example, this broke "bots" being a symlink to a previously existing
checkout.

Use file locking instead, which is a more direct way of ensuring that
there is only one git operation that affects the current checkout. We
don't need to flock bots/, as that's an independent git repository.

Closes #371
2020-09-22 08:50:54 +02:00
Martin Pitt
661ca771b3
Makefile: Replace git restore command
This is a relatively recent git feature which is not present in e.g.
Debian 9 yet. Use `git reset` instead, like in the test/common rule.

Fixes #369
Closes #370
2020-09-22 07:51:54 +02:00