Compare commits
19 Commits
Author | SHA1 | Date | |
---|---|---|---|
63f6f969cc
|
|||
03fa82b223
|
|||
235b1a10d8
|
|||
1a01c67759
|
|||
a45b2cfc60
|
|||
2b47398f95
|
|||
f04c1ec1b9
|
|||
ca72a0c8f9
|
|||
7219caa4ff
|
|||
2cd46e37ef
|
|||
7c8bfad01f
|
|||
4821316ee9
|
|||
798cd355b2
|
|||
eab152e928
|
|||
60e7136bcd
|
|||
99b5401c38
|
|||
b6c133bb54
|
|||
58a1a8ee2f
|
|||
bbeebda027
|
@@ -11,18 +11,29 @@ permissions:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: dind
|
||||
name: Build image
|
||||
runs-on: ubuntu-22.04
|
||||
container: catthehacker/ubuntu:act-latest
|
||||
env:
|
||||
REGISTRY: hub.realmanual.ru
|
||||
REGISTRY: git.realmanual.ru
|
||||
IMAGE_NAME: ${{ gitea.repository }}
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Login to Gitea Docker Registry
|
||||
run: echo "${{ secrets.GITEA_TOKEN }}" | docker login "${{ env.REGISTRY }}" --username "${{ github.actor }}" --password-stdin
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ gitea.actor }}
|
||||
password: ${{ secrets.PUSH_TOKEN }}
|
||||
|
||||
- name: Build Docker image
|
||||
run: docker build -t "$GITHUB_REPOSITORY:${GITHUB_REF#refs/tags/}" -t "$GITHUB_REPOSITORY:latest" .
|
||||
|
||||
- name: Push Docker image
|
||||
run: docker push "$GITHUB_REPOSITORY:${GITHUB_REF#refs/tags/}" "$GITHUB_REPOSITORY:latest"
|
||||
- name: Build and push Docker image
|
||||
id: push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: |
|
||||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ gitea.ref_name }}
|
||||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
||||
|
@@ -3,7 +3,7 @@
|
||||
```yaml
|
||||
services:
|
||||
sqlite_backup:
|
||||
image: hub.realmanual.ru/pub/sqlite-backup/backup:latest
|
||||
image: git.realmanual.ru/pub/sqlite-backup-s3
|
||||
container_name: sqlite_backup
|
||||
restart: always
|
||||
volumes:
|
||||
|
@@ -1,6 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
DOCKER_BASEIMAGE=alpine:latest
|
||||
TAG=$1
|
||||
|
||||
docker buildx build --platform linux/amd64,linux/arm64 --push -t hub.realmanual.ru/pub/sqlite-backup \
|
||||
--build-arg DOCKER_BASEIMAGE=${DOCKER_BASEIMAGE} .
|
||||
if [ -z "$TAG" ]; then
|
||||
TAG=latest
|
||||
fi
|
||||
|
||||
docker buildx build --platform linux/amd64,linux/arm64 --push -t git.realmanual.ru/pub/sqlite-backup:${TAG} .
|
||||
|
@@ -1,6 +1,6 @@
|
||||
services:
|
||||
sqlite_backup:
|
||||
image: hub.realmanual.ru/pub/sqlite-backup/backup:latest
|
||||
image: git.realmanual.ru/pub/sqlite-backup/backup:latest
|
||||
container_name: sqlite_backup
|
||||
restart: always
|
||||
volumes:
|
||||
|
@@ -1,6 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "${CRONTAB} /scripts/backup.sh" > /etc/crontabs/root
|
||||
# Create crontab in a writable location and set proper permissions
|
||||
mkdir -p /tmp/crontabs
|
||||
echo "${CRONTAB:-"0 * * * *"} /scripts/backup.sh" > /tmp/crontabs/root
|
||||
chmod 644 /tmp/crontabs/root
|
||||
|
||||
# Run initial backup
|
||||
/scripts/backup.sh
|
||||
exec crond -f
|
||||
|
||||
# Start crond with debug output
|
||||
echo "Starting crond with config:"
|
||||
cat /tmp/crontabs/root
|
||||
echo "---"
|
||||
|
||||
# Start crond in foreground with debug output
|
||||
exec crond -f -c /tmp/crontabs -d 8
|
||||
|
@@ -1,6 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
rclone config create myminio s3 provider Minio access_key_id $MINIO_ACCOUNT_ID secret_access_key $MINIO_APPLICATION_KEY endpoint $MINIO_ENDPOINT region $MINIO_LOCATION acl private
|
||||
# Create rclone config on-the-fly in a writable location
|
||||
RCLONE_CONFIG_DIR="/tmp/rclone"
|
||||
mkdir -p "$RCLONE_CONFIG_DIR"
|
||||
export RCLONE_CONFIG="$RCLONE_CONFIG_DIR/rclone.conf"
|
||||
|
||||
cat > "$RCLONE_CONFIG" << EOF
|
||||
[myminio]
|
||||
type = s3
|
||||
provider = Minio
|
||||
access_key_id = $MINIO_ACCOUNT_ID
|
||||
secret_access_key = $MINIO_APPLICATION_KEY
|
||||
endpoint = $MINIO_ENDPOINT
|
||||
region = $MINIO_LOCATION
|
||||
acl = private
|
||||
no_check_bucket = true
|
||||
EOF
|
||||
|
||||
case $1 in
|
||||
copy)
|
||||
@@ -8,11 +23,11 @@ case $1 in
|
||||
rclone copy --progress $2 $3
|
||||
;;
|
||||
list)
|
||||
echo "list $2"
|
||||
rclone ls $2
|
||||
echo "list ${MINIO_PATH}/$2"
|
||||
rclone ls ${MINIO_PATH}/$2
|
||||
;;
|
||||
delete)
|
||||
echo "delete $2"
|
||||
rclone delete $2
|
||||
echo "delete ${MINIO_PATH}/$2"
|
||||
rclone delete ${MINIO_PATH}/$2
|
||||
;;
|
||||
esac
|
||||
|
Reference in New Issue
Block a user