• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

agama-project / agama / 11403686465
68%

Build:
DEFAULT BRANCH: master
Ran 18 Oct 2024 12:36PM UTC
Jobs 2
Files 630
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

18 Oct 2024 12:27PM UTC coverage: 71.629% (-0.2%) from 71.821%
11403686465

push

github

web-flow
feat: add support to run pre/post scripts (#1673)

This is the first implementation of pre/post-installation scripts. They
are not as capable as their AutoYaST counterparts, but the idea is to
evolve them in the future.

## Specifying a script

> [!WARNING]
> JSON does not support multiline values (a.k.a. blocks) but Jsonnet
does it. Perhaps we should consider using Jsonnet in the `agama config
edit` command.

```jsonnet
{
  scripts: {
    pre: [
      {
         name: "say-hi",
         body: |||
           #!/bin/bash
           echo "before starting the installation"
         |||
      }
    ]
  }
}
```

> [!NOTE]
> What about having a plain list where each script has a `type` (or
`group`) like `pre`, `post`, etc.?

## When scripts get executed

* Pre-scripts: when loading a profile. We plan to do [some
improvements](https://trello.com/c/PiOGzXSn/584-agama-running-pre-scripts-in-the-right-place)
to support the single-product case properly.
* Post-scripts: after the installation.

## Implementation details

The scripting support is written in Rust and does not use the YaST
scripts code anymore. We will rewrite the Manager in Rust (at least the
Agama-specific part) in the future, and the scripting support will be
part of that.

## Future

Agama scripts will gain additional features soon:

* Running in a `chroot`.
* Better error handling if the shebang line is not present.
* Running after the first boot.

## Pending tasks

- [x] Extend the JSON schema
- [x] Copy the resulting files to the installed system
- [x] Add some logging
- [x] Clean-up the old scripts when reloading a profile

73 of 148 new or added lines in 11 files covered. (49.32%)

4 existing lines in 3 files now uncovered.

16873 of 23556 relevant lines covered (71.63%)

34.93 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
0.0
0.0% rust/agama-server/src/web.rs
3
0.0
rust/agama-lib/src/scripts/settings.rs
4
0.0
0.0% rust/agama-lib/src/store.rs
5
86.11
rust/agama-lib/src/scripts/model.rs
9
0.0
rust/agama-lib/src/scripts/client.rs
26
0.0
rust/agama-lib/src/scripts/store.rs
27
0.0
rust/agama-server/src/scripts/web.rs

Uncovered Existing Lines

Lines Coverage ∆ File
1
0.0
0.0% rust/agama-lib/src/store.rs
1
0.0
0.0% rust/agama-server/src/web.rs
2
98.54
0.0% service/lib/agama/storage/finisher.rb
Subprojects
ID Flag name Job ID Ran Files Coverage
2 rust 11403686465.2 18 Oct 2024 12:36PM UTC 112
25.59
GitHub Action Run
2 service 11403686461.2 18 Oct 2024 12:30PM UTC 518
89.17
GitHub Action Run
Source Files on build 11403686465
  • Tree
  • List 630
  • Changed 20
  • Source Changed 1
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #11403686465
  • 78edd272 on github
  • Prev Build on master (#11403686461)
  • Next Build on master (#11458437041)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc