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

agama-project / agama / 11403686461
68%

Build:
DEFAULT BRANCH: master
Ran 18 Oct 2024 12:30PM UTC
Jobs 2
Files 625
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.821% (+0.1%) from 71.72%
11403686461

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

42 of 43 new or added lines in 5 files covered. (97.67%)

60 existing lines in 5 files now uncovered.

16842 of 23450 relevant lines covered (71.82%)

35.09 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
0.0
0.0% rust/agama-lib/src/store.rs

Uncovered Existing Lines

Lines Coverage ∆ File
2
0.0
0.0% rust/agama-lib/src/install_settings.rs
2
98.54
0.21% service/service/lib/agama/storage/finisher.rb
6
31.25
0.0% rust/agama-lib/src/lib.rs
13
0.0
0.0% rust/agama-lib/src/store.rs
37
0.0
0.0% rust/agama-server/src/web.rs
Subprojects
ID Flag name Job ID Ran Files Coverage
2 service 11403686461.2 18 Oct 2024 12:30PM UTC 518
89.17
GitHub Action Run
2 rust 11380886983.2 17 Oct 2024 08:16AM UTC 107
25.53
GitHub Action Run
Source Files on build 11403686461
  • Tree
  • List 625
  • Changed 46
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #11403686461
  • 78edd272 on github
  • Prev Build on master (#11400572126)
  • Next Build on master (#11403686465)
  • 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