1
1
Fork 0

cosmetic changes and updated README.md

This commit is contained in:
david 2023-12-21 12:25:16 +01:00
parent 1b3c18243c
commit b5dd0f64f2
3 changed files with 71 additions and 45 deletions

View File

@ -2,17 +2,38 @@
My personal collection of handy scripts. mostly bash.
- [restic-backup.sh](#restic-backup.sh)
- [restic-repos.sh](#restic-repos.sh)
- [btrfs-snapshots.sh](#btrfs-snapshots.sh)
- [odroid-fancontrol.sh](#odroid-fancontrol.sh)
| Name | Description |
| :--- | :---------- |
| [ci.sh](#ci.sh) | A poor man's CI system |
| [restic-backup.sh](#restic-backup.sh) | Simple wrapper script for [Restic](https://github.com/restic/restic) |
More:
- [lib.sh](#lib.sh)
- [template.sh](#template.sh)
## ci.sh
### Install
---
Clone this repository anywhere on your system and link it into your `$PATH`.
```bash
sudo su; cd
git clone https://git.socialnerds.org/david/scripts.git
ln -s /root/scripts/ci.sh /usr/local/bin/ci
```
### Usage
```bash
Usage:
ci <options> <git-repo>
Options:
-s, --scripts <DIR> Specify the scripts directory (default: /root/ci-scripts)
-c, --checks <URL> Enable healthchecks.io integration
-n, --ntfy <URL> Enable ntfy.sh integration
-h, --help Print help screen and exit
-i, --info Print script information and exit
-v, --verbose More verbose output
-q, --quiet No output except errors (overrides -v)
```
## restic-backup.sh

2
ci.sh
View File

@ -199,6 +199,8 @@ else
nohup "$SCRIPTS_DIR/$GIT_HOST/$GIT_USER/$GIT_REPO.sh" > "$TEMP_DIR/$GIT_HOST/$GIT_USER/$GIT_REPO.log" 2>&1 &
echo $! > "$TEMP_DIR/$GIT_HOST/$GIT_USER/$GIT_REPO.pid"
# Inform user of a successful job execution
lib_print "CI job has been triggered [$GIT_HOST/$GIT_USER/$GIT_REPO]"
lib_ntfy "$NTFY_URL" "CI job has been triggered [$GIT_HOST/$GIT_USER/$GIT_REPO]"
lib_checks "$CHECKS_URL" "CI job has been triggered [$GIT_HOST/$GIT_USER/$GIT_REPO]"
fi

5
lib.sh
View File

@ -28,7 +28,9 @@ LIB_WEBSITE="https://git.socialnerds.org/david/scripts"
## Variables
##
# Reset text formatting
# Text formatting
if [[ -t 1 ]]; then
LIB_CLEAR="\e[0m"
# Text settings
@ -70,6 +72,7 @@ LIB_BLUE_BG_BOLD="\e[1;44m"
LIB_MAGENTA_BG_BOLD="\e[1;45m"
LIB_CYAN_BG_BOLD="\e[1;46m"
LIB_LIGHTGREY_BG_BOLD="\e[1;47m"
fi
##