added agent
This commit is contained in:
parent
e70f740a28
commit
7680d762b6
21
backup.sh.save
Normal file
21
backup.sh.save
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
BACKUP_DIR="/backup/$(date +%F_%H-%M)/"
|
||||||
|
DB_BACKUP_FILE="$BACKUP_DIR/gitea.sql"
|
||||||
|
|
||||||
|
$container_id = docker ps --filter "name=^gitea$" -q
|
||||||
|
$user = docker inspect -f '{{json .Config.Env}}' $container_id | jq -r '.[] | select(startswith("USER=")) | split("=")[1]'
|
||||||
|
|
||||||
|
PGPASSWORD="$DB_PASSWORD" pg_dump -h database -U $DB_USER -d $DB_DATABASE -F c -b -v -f $DB_BACKUP_FILE
|
||||||
|
|
||||||
|
TARGET_PATH="s3://$BACKUP_SPACE_NAME/backups/$(date +%F_%H-%M)"
|
||||||
|
BACKUP_FILE=$(date +%F_%H-%M)
|
||||||
|
tar -czf "backup"
|
||||||
|
|
||||||
|
|
||||||
|
s3cmd put --encrypt $BACKUP_DIR* $TARGET_PATH --recursive
|
||||||
|
|
||||||
|
|
||||||
|
rm -rf $BACKUP_DIR
|
||||||
|
|
||||||
|
echo "Files have been uploaded to $TARGET_PATH"
|
@ -24,6 +24,7 @@ services:
|
|||||||
- USER_GID=1000
|
- USER_GID=1000
|
||||||
- GITEA__security__SECRET=${GITEA_SECRET}
|
- GITEA__security__SECRET=${GITEA_SECRET}
|
||||||
- GITEA__security__INTERNAL_TOKEN=${GITEA_TOKEN}
|
- GITEA__security__INTERNAL_TOKEN=${GITEA_TOKEN}
|
||||||
|
- GITEA__security__ENFORCE_TWO_FACTOR_AUTH=true
|
||||||
- GITEA__database__DB_TYPE=${DB_TYPE}
|
- GITEA__database__DB_TYPE=${DB_TYPE}
|
||||||
- GITEA__database__HOST=database:5432
|
- GITEA__database__HOST=database:5432
|
||||||
- GITEA__database__NAME=${DB_DATABASE}
|
- GITEA__database__NAME=${DB_DATABASE}
|
||||||
@ -67,6 +68,18 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ./postgres/data:/var/lib/postgresql/data
|
- ./postgres/data:/var/lib/postgresql/data
|
||||||
|
|
||||||
|
runner_A0:
|
||||||
|
image: gitea/act_runner
|
||||||
|
restart: always
|
||||||
|
networks:
|
||||||
|
- gitea
|
||||||
|
environment:
|
||||||
|
- GITEA_INSTANCE_URL=https://git.openharbor.io
|
||||||
|
- GITEA_RUNNER_REGISTRATION_TOKEN=${GITEA_RUNNER_A0_REGISTRATION_TOKEN}
|
||||||
|
- GITEA_RUNNER_NAME=A0
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
gitea:
|
gitea:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
|
Loading…
Reference in New Issue
Block a user