Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
14f0018b3a
|
|||
|
2d09ec74f5
|
|||
|
391ca1d275
|
|||
|
cd6013461c
|
|||
|
31309f2576
|
|||
|
db8e656613
|
|||
|
9725a09c06
|
|||
|
bd300718e7
|
44
.drone.yml
44
.drone.yml
@@ -1,44 +0,0 @@
|
|||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: default
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: build
|
|
||||||
image: docker.asperti.com/paspo/docker-deb-builder:debian_bullseye
|
|
||||||
commands:
|
|
||||||
- debuild -i -us -uc
|
|
||||||
- mkdir debs
|
|
||||||
- mv ../*.deb debs/
|
|
||||||
|
|
||||||
- name: gitea release
|
|
||||||
image: plugins/gitea-release
|
|
||||||
settings:
|
|
||||||
checksum:
|
|
||||||
- md5
|
|
||||||
- sha256
|
|
||||||
api_key:
|
|
||||||
from_secret: gitea_token
|
|
||||||
base_url: https://git.asperti.com
|
|
||||||
files:
|
|
||||||
- debs/*.deb
|
|
||||||
title: server01-crowdsec-whitelist
|
|
||||||
|
|
||||||
- name: push to repo
|
|
||||||
image: docker.asperti.com/paspo/docker-aptly-pusher
|
|
||||||
settings:
|
|
||||||
api_url: https://deb.server01.it/api
|
|
||||||
repo: server01
|
|
||||||
distribution: server01
|
|
||||||
http_user:
|
|
||||||
from_secret: repo_http_user
|
|
||||||
http_pass:
|
|
||||||
from_secret: repo_http_pass
|
|
||||||
passphrase:
|
|
||||||
from_secret: repo_passphrase
|
|
||||||
files:
|
|
||||||
- debs/*.deb
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
event:
|
|
||||||
- tag
|
|
||||||
37
.gitea/workflows/build_and_publish.yaml
Normal file
37
.gitea/workflows/build_and_publish.yaml
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
---
|
||||||
|
name: Package creation
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
build-image:
|
||||||
|
runs-on:
|
||||||
|
labels: [ubuntu-latest, arch-amd64]
|
||||||
|
container:
|
||||||
|
image: catthehacker/ubuntu:act-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y build-essential devscripts debhelper dpkg-dev
|
||||||
|
|
||||||
|
- name: Create .deb packages
|
||||||
|
run: |
|
||||||
|
debuild -i -us -uc --lintian-opts --profile debian
|
||||||
|
mkdir debs
|
||||||
|
mv ../*.deb debs/
|
||||||
|
|
||||||
|
- name: Publish Package
|
||||||
|
run: |
|
||||||
|
curl --user ${{ github.repository_owner }}:${{ secrets.DOCKER_GITEA_PASSWORD }} \
|
||||||
|
--upload-file debs/*.deb \
|
||||||
|
${{ github.server_url }}/api/packages/${{ github.repository_owner }}/debian/pool/stable/main/upload
|
||||||
@@ -24,6 +24,7 @@ fi
|
|||||||
HEALTHCHECK_URL=${HEALTHCHECK_URL:-http://127.0.0.1}
|
HEALTHCHECK_URL=${HEALTHCHECK_URL:-http://127.0.0.1}
|
||||||
HEALTHCHECK_ENABLE=${HEALTHCHECK_ENABLE:-false}
|
HEALTHCHECK_ENABLE=${HEALTHCHECK_ENABLE:-false}
|
||||||
FAIL_IF_TARGET_UNREACHABLE=${FAIL_IF_TARGET_UNREACHABLE:-true}
|
FAIL_IF_TARGET_UNREACHABLE=${FAIL_IF_TARGET_UNREACHABLE:-true}
|
||||||
|
IGNORE_TARGET_UNREACHABLE=${IGNORE_TARGET_UNREACHABLE:-false}
|
||||||
CURLOPTS=(-fsS -m 10 --retry 5)
|
CURLOPTS=(-fsS -m 10 --retry 5)
|
||||||
|
|
||||||
if [[ ! -d /run/btrbk ]] ; then
|
if [[ ! -d /run/btrbk ]] ; then
|
||||||
@@ -66,6 +67,7 @@ SSHUSER=$(echo "${SSHUSER}" | sed -r 's/.*ssh_user[\ \t]+//g')
|
|||||||
|
|
||||||
SSH_OK=$(ssh -i "${IDENTITYFILE}" "${SSHUSER}@${HOST}" "which btrfs")
|
SSH_OK=$(ssh -i "${IDENTITYFILE}" "${SSHUSER}@${HOST}" "which btrfs")
|
||||||
|
|
||||||
|
if [[ "${IGNORE_TARGET_UNREACHABLE}" = "false" ]] ; then
|
||||||
if [[ "${SSH_OK}" = "" ]] ; then
|
if [[ "${SSH_OK}" = "" ]] ; then
|
||||||
echo "Warning: exiting because of backup destination unreachable" | tee -a "${LOGFILE}"
|
echo "Warning: exiting because of backup destination unreachable" | tee -a "${LOGFILE}"
|
||||||
if [[ "${HEALTHCHECK_ENABLE}" = "true" ]] ; then
|
if [[ "${HEALTHCHECK_ENABLE}" = "true" ]] ; then
|
||||||
@@ -78,6 +80,7 @@ if [[ "${SSH_OK}" = "" ]] ; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Start backup: $(date||true)" | tee -a "${LOGFILE}"
|
echo "Start backup: $(date||true)" | tee -a "${LOGFILE}"
|
||||||
if [[ "${HEALTHCHECK_ENABLE}" = "true" ]] ; then
|
if [[ "${HEALTHCHECK_ENABLE}" = "true" ]] ; then
|
||||||
@@ -85,7 +88,7 @@ if [[ "${HEALTHCHECK_ENABLE}" = "true" ]] ; then
|
|||||||
fi
|
fi
|
||||||
echo
|
echo
|
||||||
echo "healthcheck notified! (start)" | tee -a "${LOGFILE}"
|
echo "healthcheck notified! (start)" | tee -a "${LOGFILE}"
|
||||||
(nice -n 19 /usr/bin/ionice -c idle /usr/bin/btrbk -v --progress run >> "${LOGFILE}" ; ) 2>&1
|
(nice -n 19 /usr/bin/ionice -c idle /usr/bin/btrbk -v --progress run 2>&1 || true) | tee -a "${LOGFILE}" 2>&1
|
||||||
ret=$?
|
ret=$?
|
||||||
if [[ "${ret}" -eq "0" ]]; then
|
if [[ "${ret}" -eq "0" ]]; then
|
||||||
if [[ "${HEALTHCHECK_ENABLE}" = "true" ]] ; then
|
if [[ "${HEALTHCHECK_ENABLE}" = "true" ]] ; then
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
HEALTHCHECK_ENABLE=true
|
HEALTHCHECK_ENABLE=true
|
||||||
HEALTHCHECK_URL=https://my.selfhosted.healthcheck.com/ping/e48e4add-c17c-467c-9a91-7b245ad57fe8
|
HEALTHCHECK_URL=https://my.selfhosted.healthcheck.com/ping/e48e4add-c17c-467c-9a91-7b245ad57fe8
|
||||||
FAIL_IF_TARGET_UNREACHABLE=true
|
FAIL_IF_TARGET_UNREACHABLE=true
|
||||||
|
IGNORE_TARGET_UNREACHABLE=false
|
||||||
|
|||||||
18
debian/changelog
vendored
18
debian/changelog
vendored
@@ -1,3 +1,21 @@
|
|||||||
|
btrbk-cron (0.4.3) stable; urgency=medium
|
||||||
|
|
||||||
|
* added flag IGNORE_TARGET_UNREACHABLE
|
||||||
|
|
||||||
|
-- Paolo Asperti <paolo@asperti.com> Sat, 01 Feb 2025 14:06:08 +0100
|
||||||
|
|
||||||
|
btrbk-cron (0.4.2) stable; urgency=medium
|
||||||
|
|
||||||
|
* gather all logs
|
||||||
|
|
||||||
|
-- Paolo Asperti <paolo@asperti.com> Tue, 22 Oct 2024 11:21:43 +0200
|
||||||
|
|
||||||
|
btrbk-cron (0.4.1) stable; urgency=medium
|
||||||
|
|
||||||
|
* fix error redir
|
||||||
|
|
||||||
|
-- Paolo Asperti <paolo@asperti.com> Wed, 16 Oct 2024 11:56:39 +0200
|
||||||
|
|
||||||
btrbk-cron (0.4) stable; urgency=medium
|
btrbk-cron (0.4) stable; urgency=medium
|
||||||
|
|
||||||
* stale lockfile check
|
* stale lockfile check
|
||||||
|
|||||||
Reference in New Issue
Block a user