kopia lustrzana https://github.com/modem7/docker-borgmatic
Removed docker-cli version
Removed docker-cli version as can now install via variable.pull/119/head
rodzic
1d3c101a3f
commit
f13a21be90
51
.drone.yml
51
.drone.yml
|
@ -64,54 +64,3 @@ steps:
|
|||
trigger:
|
||||
event:
|
||||
- custom
|
||||
|
||||
---
|
||||
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: Dockercli
|
||||
|
||||
clone:
|
||||
depth: 1
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
steps:
|
||||
- name: Docker-CLI
|
||||
image: thegeeklab/drone-docker-buildx
|
||||
privileged: true
|
||||
settings:
|
||||
repo: modem7/borgmatic-docker
|
||||
purge: true
|
||||
compress: true
|
||||
no_cache: false
|
||||
build_args: BUILDKIT_INLINE_CACHE=1
|
||||
cache_from: modem7/borgmatic-docker:dockercli
|
||||
dockerfile: base-dockercli/Dockerfile
|
||||
context: base-dockercli/
|
||||
platforms: # if it doesn't work run docker run --privileged --rm tonistiigi/binfmt --install all
|
||||
- linux/amd64
|
||||
- linux/arm64
|
||||
username:
|
||||
from_secret: docker_username
|
||||
password:
|
||||
from_secret: docker_password
|
||||
tags:
|
||||
- dockercli
|
||||
|
||||
- name: slack
|
||||
image: themaz/drone-slack
|
||||
settings:
|
||||
webhook:
|
||||
from_secret: slack_hook
|
||||
when:
|
||||
status: [ success, failure ]
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- custom
|
||||
|
||||
depends_on:
|
||||
- FullBuild
|
||||
|
|
|
@ -28,7 +28,6 @@ It uses cron to run the backups at a time you can configure in `data/borgmatic.d
|
|||
| Tag | Description |
|
||||
| :----: | --- |
|
||||
| Latest | Latest version of Borgmatic|
|
||||
| dockercli | Borgmatic with Docker-CLI baked in. |
|
||||
| 1.6.xx-1.2.x | Specific versions of Borgmatic |
|
||||
|
||||
# Environment Variables
|
||||
|
@ -39,6 +38,9 @@ It uses cron to run the backups at a time you can configure in `data/borgmatic.d
|
|||
| CRON_COMMAND | Command cron will run | borgmatic --stats -v 0 2>&1 | borgmatic --stats -v 0 2>&1 |
|
||||
| EXTRA_CRON | Extra cron lines | 0 5 2 * * command1 | Empty |
|
||||
|
||||
## Breaking change
|
||||
dockercli tag has been removed as there is now a variable to install it at container startup.
|
||||
|
||||
### Usage
|
||||
|
||||
Please look at this [guide](https://www.modem7.com/books/docker-backup/page/backup-docker-using-borgmatic) to help you run this container.
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
# syntax = docker/dockerfile:latest
|
||||
|
||||
FROM modem7/borgmatic-docker:latest
|
||||
|
||||
COPY --link root/ /
|
||||
|
||||
RUN apk add --update --no-cache \
|
||||
docker-cli
|
||||
|
||||
ENTRYPOINT [ "/init" ]
|
|
@ -1,10 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
if test "$1" -eq 256 ; then
|
||||
e=$((128 + $2))
|
||||
else
|
||||
e="$1"
|
||||
fi
|
||||
|
||||
echo "Received exit code $e."
|
||||
echo "$e" > /run/s6-linux-init-container-results/exitcode
|
|
@ -1,56 +0,0 @@
|
|||
#!/usr/bin/with-contenv bash
|
||||
|
||||
# Version variables
|
||||
dockerver=$(docker --version | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+')
|
||||
borgver=$(borg --version)
|
||||
borgmaticver=$(borgmatic --version)
|
||||
apprisever=$(apprise --version | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+')
|
||||
pythonver=$(python3 --version | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+')
|
||||
|
||||
# Software versions
|
||||
echo "Software Versions:
|
||||
-----------------------------------
|
||||
docker $dockerver
|
||||
borgmatic $borgmaticver
|
||||
$borgver
|
||||
apprise $apprisever
|
||||
python $pythonver
|
||||
-----------------------------------
|
||||
Time Zone: $TZ
|
||||
-----------------------------------
|
||||
"
|
||||
|
||||
# Disable cron if it's set to disabled.
|
||||
if [[ "$CRON" =~ ^(false|disabled|off)$ ]]; then
|
||||
echo "Disabling cron, removing configuration"
|
||||
# crontab -r # quite destructive
|
||||
# echo -n > /etc/crontabs/root # Empty config, doesn't look as nice with "crontab -l"
|
||||
echo "# Cron disabled" > /etc/crontabs/root
|
||||
echo "Cron is now disabled"
|
||||
# Apply default or custom cron if $CRON is unset or set (not null):
|
||||
elif [[ -v CRON ]]; then
|
||||
CRON="${CRON:-"0 1 * * *"}"
|
||||
CRON_COMMAND="${CRON_COMMAND:-"borgmatic --stats -v 0 2>&1"}"
|
||||
echo "$CRON $CRON_COMMAND" > /etc/crontabs/root
|
||||
echo "Applying custom cron"
|
||||
# If nothing is set, revert to default behaviour
|
||||
else
|
||||
echo "Applying crontab.txt"
|
||||
crontab /etc/borgmatic.d/crontab.txt
|
||||
fi
|
||||
|
||||
# Apply extra cron if it's set
|
||||
if [ -v EXTRA_CRON ]
|
||||
then
|
||||
echo "$EXTRA_CRON" >> /etc/crontabs/root
|
||||
fi
|
||||
|
||||
# Current crontab var
|
||||
crontab=$(crontab -l)
|
||||
|
||||
# Output cron settings to console
|
||||
printf "Cron job set as: \n$crontab\n"
|
||||
|
||||
# Start Cron
|
||||
# exec supercronic -passthrough-logs /etc/crontabs/root
|
||||
exec /usr/sbin/crond -f -L /dev/stdout
|
|
@ -1 +0,0 @@
|
|||
longrun
|
|
@ -21,7 +21,7 @@ echo "Software Versions:
|
|||
apprise $apprisever
|
||||
$borgver
|
||||
borgmatic $borgmaticver
|
||||
docker $dockerver
|
||||
dockercli $dockerver
|
||||
python $pythonver
|
||||
-----------------------------------
|
||||
Time Zone: $TZ
|
||||
|
|
Ładowanie…
Reference in New Issue