feat: Add Alpine hooks blog post
This commit is contained in:
parent
f28dd4bbb0
commit
e75153f319
|
@ -0,0 +1,24 @@
|
|||
---
|
||||
title: "How to use Alpine Linux commit hooks"
|
||||
date: 2021-04-18T13:56:06+02:00
|
||||
draft: false
|
||||
---
|
||||
|
||||
|
||||
- Create directory "/etc/apk/commit_hooks.d"
|
||||
- Put your executable files in there
|
||||
- First argument passed to your script is the stage (`pre-commit`/`post-commit`)
|
||||
|
||||
Example hook:
|
||||
```bash
|
||||
#!/bin/bash
|
||||
|
||||
if ! mount | grep -q '/boot/efi'; then
|
||||
mount /boot/efi
|
||||
fi
|
||||
|
||||
if [[ "$1" == "post-commit" ]]; then
|
||||
cp /boot/initramfs-renoir /boot/efi/alpine/initramfs-renoir
|
||||
cp /boot/vmlinuz-renoir /boot/efi/alpine/vmlinuz-renoir
|
||||
fi
|
||||
```
|
Loading…
Reference in New Issue