cosmetic changes and updated README.md
This commit is contained in:
parent
1b3c18243c
commit
b5dd0f64f2
37
README.md
37
README.md
|
@ -2,17 +2,38 @@
|
||||||
|
|
||||||
My personal collection of handy scripts. mostly bash.
|
My personal collection of handy scripts. mostly bash.
|
||||||
|
|
||||||
- [restic-backup.sh](#restic-backup.sh)
|
| Name | Description |
|
||||||
- [restic-repos.sh](#restic-repos.sh)
|
| :--- | :---------- |
|
||||||
- [btrfs-snapshots.sh](#btrfs-snapshots.sh)
|
| [ci.sh](#ci.sh) | A poor man's CI system |
|
||||||
- [odroid-fancontrol.sh](#odroid-fancontrol.sh)
|
| [restic-backup.sh](#restic-backup.sh) | Simple wrapper script for [Restic](https://github.com/restic/restic) |
|
||||||
|
|
||||||
More:
|
## ci.sh
|
||||||
- [lib.sh](#lib.sh)
|
|
||||||
- [template.sh](#template.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
|
## restic-backup.sh
|
||||||
|
|
||||||
|
|
2
ci.sh
2
ci.sh
|
@ -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 &
|
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"
|
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_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]"
|
lib_checks "$CHECKS_URL" "CI job has been triggered [$GIT_HOST/$GIT_USER/$GIT_REPO]"
|
||||||
fi
|
fi
|
||||||
|
|
77
lib.sh
77
lib.sh
|
@ -28,48 +28,51 @@ LIB_WEBSITE="https://git.socialnerds.org/david/scripts"
|
||||||
## Variables
|
## Variables
|
||||||
##
|
##
|
||||||
|
|
||||||
# Reset text formatting
|
|
||||||
LIB_CLEAR="\e[0m"
|
|
||||||
|
|
||||||
# Text settings
|
# Text formatting
|
||||||
LIB_BOLD="\e[1m"
|
if [[ -t 1 ]]; then
|
||||||
LIB_UNDERLINE="\e[4m"
|
LIB_CLEAR="\e[0m"
|
||||||
|
|
||||||
# Text color
|
# Text settings
|
||||||
LIB_RED="\e[31m"
|
LIB_BOLD="\e[1m"
|
||||||
LIB_GREEN="\e[32m"
|
LIB_UNDERLINE="\e[4m"
|
||||||
LIB_YELLOW="\e[33m"
|
|
||||||
LIB_BLUE="\e[34m"
|
|
||||||
LIB_MAGENTA="\e[35m"
|
|
||||||
LIB_CYAN="\e[36m"
|
|
||||||
LIB_LIGHTGREY="\e[37m"
|
|
||||||
|
|
||||||
# Text color with bold font
|
# Text color
|
||||||
LIB_RED_BOLD="\e[1;31m"
|
LIB_RED="\e[31m"
|
||||||
LIB_GREEN_BOLD="\e[1;32m"
|
LIB_GREEN="\e[32m"
|
||||||
LIB_YELLOW_BOLD="\e[1;33m"
|
LIB_YELLOW="\e[33m"
|
||||||
LIB_BLUE_BOLD="\e[1;34m"
|
LIB_BLUE="\e[34m"
|
||||||
LIB_MAGENTA_BOLD="\e[1;35m"
|
LIB_MAGENTA="\e[35m"
|
||||||
LIB_CYAN_BOLD="\e[1;36m"
|
LIB_CYAN="\e[36m"
|
||||||
LIB_LIGHTGREY_BOLD="\e[1;37m"
|
LIB_LIGHTGREY="\e[37m"
|
||||||
|
|
||||||
# Background color
|
# Text color with bold font
|
||||||
LIB_RED_BG="\e[41m"
|
LIB_RED_BOLD="\e[1;31m"
|
||||||
LIB_GREEN_BG="\e[42m"
|
LIB_GREEN_BOLD="\e[1;32m"
|
||||||
LIB_YELLOW_BG="\e[43m"
|
LIB_YELLOW_BOLD="\e[1;33m"
|
||||||
LIB_BLUE_BG="\e[44m"
|
LIB_BLUE_BOLD="\e[1;34m"
|
||||||
LIB_MAGENTA_BG="\e[45m"
|
LIB_MAGENTA_BOLD="\e[1;35m"
|
||||||
LIB_CYAN_BG="\e[46m"
|
LIB_CYAN_BOLD="\e[1;36m"
|
||||||
LIB_LIGHTGREY_BG="\e[47m"
|
LIB_LIGHTGREY_BOLD="\e[1;37m"
|
||||||
|
|
||||||
# Background color with bold font
|
# Background color
|
||||||
LIB_RED_BG_BOLD="\e[1;41m"
|
LIB_RED_BG="\e[41m"
|
||||||
LIB_GREEN_BG_BOLD="\e[1;42m"
|
LIB_GREEN_BG="\e[42m"
|
||||||
LIB_YELLOW_BG_BOLD="\e[1;43m"
|
LIB_YELLOW_BG="\e[43m"
|
||||||
LIB_BLUE_BG_BOLD="\e[1;44m"
|
LIB_BLUE_BG="\e[44m"
|
||||||
LIB_MAGENTA_BG_BOLD="\e[1;45m"
|
LIB_MAGENTA_BG="\e[45m"
|
||||||
LIB_CYAN_BG_BOLD="\e[1;46m"
|
LIB_CYAN_BG="\e[46m"
|
||||||
LIB_LIGHTGREY_BG_BOLD="\e[1;47m"
|
LIB_LIGHTGREY_BG="\e[47m"
|
||||||
|
|
||||||
|
# Background color with bold font
|
||||||
|
LIB_RED_BG_BOLD="\e[1;41m"
|
||||||
|
LIB_GREEN_BG_BOLD="\e[1;42m"
|
||||||
|
LIB_YELLOW_BG_BOLD="\e[1;43m"
|
||||||
|
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
|
||||||
|
|
||||||
|
|
||||||
##
|
##
|
||||||
|
|
Loading…
Reference in New Issue