Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
ca72a0c8f9
|
|||
7219caa4ff
|
@@ -14,6 +14,9 @@ jobs:
|
|||||||
name: Build image
|
name: Build image
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
container: catthehacker/ubuntu:act-latest
|
container: catthehacker/ubuntu:act-latest
|
||||||
|
env:
|
||||||
|
REGISTRY: git.realmanual.ru
|
||||||
|
IMAGE_NAME: ${{ gitea.repository }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -21,7 +24,7 @@ jobs:
|
|||||||
- name: Log in to the Container registry
|
- name: Log in to the Container registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: git.realmanual.ru
|
registry: ${{ env.REGISTRY }}
|
||||||
username: ${{ gitea.actor }}
|
username: ${{ gitea.actor }}
|
||||||
password: ${{ secrets.PUSH_TOKEN }}
|
password: ${{ secrets.PUSH_TOKEN }}
|
||||||
|
|
||||||
@@ -32,5 +35,5 @@ jobs:
|
|||||||
context: .
|
context: .
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
${{ gitea.registry_name }}/${{ gitea.repository }}:${{ gitea.ref_name }}
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ gitea.ref_name }}
|
||||||
${{ gitea.registry_name }}/${{ gitea.repository }}:latest
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
```yaml
|
```yaml
|
||||||
services:
|
services:
|
||||||
sqlite_backup:
|
sqlite_backup:
|
||||||
image: hub.realmanual.ru/pub/sqlite-backup/backup:latest
|
image: git.realmanual.ru/pub/sqlite-backup-s3
|
||||||
container_name: sqlite_backup
|
container_name: sqlite_backup
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
|
@@ -1,18 +1,32 @@
|
|||||||
#!/bin/bash
|
#!/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
|
||||||
|
EOF
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
copy)
|
copy)
|
||||||
echo "copy from $2 to $3"
|
echo "copy from $2 to $3"
|
||||||
rclone copy --progress $2 $3
|
rclone copy --progress $2 myminio:$3
|
||||||
;;
|
;;
|
||||||
list)
|
list)
|
||||||
echo "list $2"
|
echo "list $2"
|
||||||
rclone ls $2
|
rclone ls myminio:$2
|
||||||
;;
|
;;
|
||||||
delete)
|
delete)
|
||||||
echo "delete $2"
|
echo "delete $2"
|
||||||
rclone delete $2
|
rclone delete myminio:$2
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
Reference in New Issue
Block a user