This commit is contained in:
parent
a210bfabbf
commit
4d7df3a39e
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,3 +5,4 @@
|
|||||||
!entrypoint.sh
|
!entrypoint.sh
|
||||||
!README.md
|
!README.md
|
||||||
!.drone.yml
|
!.drone.yml
|
||||||
|
!init.sh
|
@ -5,6 +5,7 @@ RUN apk add --no-cache mysql-client restic rclone
|
|||||||
RUN mkdir /app && mkdir /config
|
RUN mkdir /app && mkdir /config
|
||||||
|
|
||||||
COPY entrypoint.sh /app/entrypoint.sh
|
COPY entrypoint.sh /app/entrypoint.sh
|
||||||
|
COPY init.sh /app/init.sh
|
||||||
|
|
||||||
WORKDIR /config
|
WORKDIR /config
|
||||||
|
|
||||||
|
@ -3,8 +3,9 @@ version: "3"
|
|||||||
services:
|
services:
|
||||||
backup:
|
backup:
|
||||||
build: .
|
build: .
|
||||||
|
# entrypoint: /app/init.sh
|
||||||
environment:
|
environment:
|
||||||
- RCLONE_REMOTE=gdrive:/backup
|
- RCLONE_REMOTE=gdrive:/backupTest
|
||||||
- RCLONE_CONFIG=/config/rclone.conf
|
- RCLONE_CONFIG=/config/rclone.conf
|
||||||
- RESTIC_PASSWORD=repopw
|
- RESTIC_PASSWORD=repopw
|
||||||
volumes:
|
volumes:
|
||||||
|
13
init.sh
Executable file
13
init.sh
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
[ -z "${RCLONE_REMOTE}" ] && echo "\$RCLONE_REMOTE is not set" && exit 1
|
||||||
|
[ -z "${RCLONE_CONFIG}" ] && echo "\$RCLONE_CONFIG is not set" && exit 1
|
||||||
|
[ -z "${RESTIC_PASSWORD}" ] && echo "\$RESTIC_PASSWORD is not set" && exit 1
|
||||||
|
|
||||||
|
echo "Init new repo"
|
||||||
|
|
||||||
|
restic -r "rclone:$RCLONE_REMOTE" init
|
||||||
|
|
||||||
|
echo "Created new repo at $RCLONE_REMOTE"
|
Loading…
Reference in New Issue
Block a user