Skip to content

Commit

Permalink
Merge branch 'master' into nix-ca
Browse files Browse the repository at this point in the history
  • Loading branch information
Ericson2314 committed Feb 13, 2025
2 parents b207f20 + c6f9820 commit 5f8eb72
Show file tree
Hide file tree
Showing 87 changed files with 1,386 additions and 1,504 deletions.
42 changes: 1 addition & 41 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,48 +1,8 @@
/.pls_cache
*.o
*~
Makefile
Makefile.in
.deps
.hydra-data
/config.guess
/config.log
/config.status
/config.sub
/configure
/depcomp
/libtool
/ltmain.sh
/autom4te.cache
/aclocal.m4
/missing
/install-sh
.test_info.*
/src/sql/hydra-postgresql.sql
/src/sql/hydra-sqlite.sql
/src/sql/tmp.sqlite
/src/hydra-eval-jobs/hydra-eval-jobs
/src/root/static/bootstrap
/src/root/static/js/flot
/tests
/doc/manual/images
/doc/manual/manual.html
/doc/manual/manual.pdf
/t/.bzr*
/t/.git*
/t/.hg*
/t/nix
/t/data
/t/jobs/config.nix
t/jobs/declarative/project.json
/inst
hydra-config.h
hydra-config.h.in
result
result-*
outputs
config
stamp-h1
src/hydra-evaluator/hydra-evaluator
src/hydra-queue-runner/hydra-queue-runner
src/root/static/fontawesome/
src/root/static/bootstrap*/
2 changes: 0 additions & 2 deletions .yath.rc

This file was deleted.

12 changes: 0 additions & 12 deletions Makefile.am

This file was deleted.

10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ In order to evaluate and build anything you need to create _projects_ that conta
#### Creating A Project
Log in as administrator, click "_Admin_" and select "_Create project_". Fill the form as follows:

- **Identifier**: `hello`
- **Identifier**: `hello-project`
- **Display name**: `hello`
- **Description**: `hello project`

Click "_Create project_".

#### Creating A Jobset
After creating a project you are forwarded to the project page. Click "_Actions_" and choose "_Create jobset_". Fill the form with the following values:
After creating a project you are forwarded to the project page. Click "_Actions_" and choose "_Create jobset_". Change **Type** to Legacy for the example below. Fill the form with the following values:

- **Identifier**: `hello`
- **Identifier**: `hello-project`
- **Nix expression**: `examples/hello.nix` in `hydra`
- **Check interval**: 60
- **Scheduling shares**: 1
Expand All @@ -57,7 +57,7 @@ We have to add two inputs for this jobset. One for _nixpkgs_ and one for _hydra_

- **Input name**: `nixpkgs`
- **Type**: `Git checkout`
- **Value**: `https://github.com/nixos/nixpkgs-channels nixos-20.03`
- **Value**: `https://github.com/NixOS/nixpkgs nixos-24.05`

- **Input name**: `hydra`
- **Type**: `Git checkout`
Expand Down Expand Up @@ -140,7 +140,7 @@ You can also interface with Hydra through a JSON API. The API is defined in [hyd
## Additional Resources

- [Hydra User's Guide](https://nixos.org/hydra/manual/)
- [Hydra on the NixOS Wiki](https://nixos.wiki/wiki/Hydra)
- [Hydra on the NixOS Wiki](https://wiki.nixos.org/wiki/Hydra)
- [hydra-cli](https://github.com/nlewo/hydra-cli)
- [Peter Simons - Hydra: Setting up your own build farm (NixOS)](https://www.youtube.com/watch?v=RXV0Y5Bn-QQ)

Expand Down
91 changes: 0 additions & 91 deletions configure.ac

This file was deleted.

2 changes: 1 addition & 1 deletion default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The `default.nix` in flake-compat reads `flake.nix` and `flake.lock` from `src` and
# returns an attribute set of the shape `{ defaultNix, shellNix }`

(import (fetchTarball https://github.com/edolstra/flake-compat/archive/master.tar.gz) {
(import (fetchTarball "https://github.com/edolstra/flake-compat/archive/master.tar.gz") {
src = ./.;
}).defaultNix
4 changes: 0 additions & 4 deletions doc/Makefile.am

This file was deleted.

6 changes: 0 additions & 6 deletions doc/manual/Makefile.am

This file was deleted.

36 changes: 36 additions & 0 deletions doc/manual/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
srcs = files(
'src/SUMMARY.md',
'src/about.md',
'src/api.md',
'src/configuration.md',
'src/hacking.md',
'src/installation.md',
'src/introduction.md',
'src/jobs.md',
'src/monitoring/README.md',
'src/notifications.md',
'src/plugins/README.md',
'src/plugins/RunCommand.md',
'src/plugins/declarative-projects.md',
'src/projects.md',
'src/webhooks.md',
)

manual = custom_target(
'manual',
command: [
mdbook,
'build',
'@SOURCE_ROOT@/doc/manual',
'-d', meson.current_build_dir() / 'html'
],
depend_files: srcs,
output: ['html'],
build_by_default: true,
)

install_subdir(
manual.full_path(),
install_dir: get_option('datadir') / 'doc/hydra',
strip_directory: true,
)
3 changes: 2 additions & 1 deletion doc/manual/src/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ Example configuration:
<role_mapping>
# Make all users in the hydra_admin group Hydra admins
hydra_admin = admin
# Allow all users in the dev group to restart jobs and cancel builds
# Allow all users in the dev group to eval jobsets, restart jobs and cancel builds
dev = eval-jobset
dev = restart-jobs
dev = cancel-build
</role_mapping>
Expand Down
10 changes: 9 additions & 1 deletion doc/manual/src/hacking.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,18 @@ and dependencies can be found:
$ nix-shell
```

of when flakes are enabled:

```console
$ nix develop
```

To build Hydra, you should then do:

```console
[nix-shell]$ autoreconfPhase
[nix-shell]$ configurePhase
[nix-shell]$ make
[nix-shell]$ make -j$(nproc)
```

You start a local database, the webserver, and other components with
Expand All @@ -30,6 +36,8 @@ foreman:
$ foreman start
```

The Hydra interface will be available on port 63333, with an admin user named "alice" with password "foobar"

You can run just the Hydra web server in your source tree as follows:

```console
Expand Down
10 changes: 9 additions & 1 deletion doc/manual/src/plugins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,22 @@ Sets CircleCI status.

## Compress build logs

Compresses build logs after a build with bzip2.
Compresses build logs after a build with bzip2 or zstd.

### Configuration options

- `compress_build_logs`

Enable log compression

- `compress_build_logs_compression`

Which compression format to use. Valid values are bzip2 (default) and zstd.

- `compress_build_logs_silent`

Whether to compress logs silently.

### Example

```xml
Expand Down
20 changes: 17 additions & 3 deletions doc/manual/src/webhooks.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
# Webhooks

Hydra can be notified by github's webhook to trigger a new evaluation when a
Hydra can be notified by github or gitea with webhooks to trigger a new evaluation when a
jobset has a github repo in its input.
To set up a github webhook go to `https://github.com/<yourhandle>/<yourrepo>/settings` and in the `Webhooks` tab
click on `Add webhook`.

## GitHub

To set up a webhook for a GitHub repository go to `https://github.com/<yourhandle>/<yourrepo>/settings`
and in the `Webhooks` tab click on `Add webhook`.

- In `Payload URL` fill in `https://<your-hydra-domain>/api/push-github`.
- In `Content type` switch to `application/json`.
- The `Secret` field can stay empty.
- For `Which events would you like to trigger this webhook?` keep the default option for events on `Just the push event.`.

Then add the hook with `Add webhook`.

## Gitea

To set up a webhook for a Gitea repository go to the settings of the repository in your Gitea instance
and in the `Webhooks` tab click on `Add Webhook` and choose `Gitea` in the drop down.

- In `Target URL` fill in `https://<your-hydra-domain>/api/push-gitea`.
- Keep HTTP method `POST`, POST Content Type `application/json` and Trigger On `Push Events`.
- Change the branch filter to match the git branch hydra builds.

Then add the hook with `Add webhook`.
2 changes: 1 addition & 1 deletion examples/hello.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# jobset example file. This file canbe referenced as Nix expression
# jobset example file. This file can be referenced as Nix expression
# in a jobset configuration along with inputs for nixpkgs and the
# repository containing this file.
#
Expand Down
Loading

0 comments on commit 5f8eb72

Please sign in to comment.