added init script
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Niklas 2021-03-29 22:55:10 +02:00
parent a210bfabbf
commit 4d7df3a39e
4 changed files with 18 additions and 2 deletions

1
.gitignore vendored
View File

@ -5,3 +5,4 @@
!entrypoint.sh
!README.md
!.drone.yml
!init.sh

View File

@ -5,6 +5,7 @@ RUN apk add --no-cache mysql-client restic rclone
RUN mkdir /app && mkdir /config
COPY entrypoint.sh /app/entrypoint.sh
COPY init.sh /app/init.sh
WORKDIR /config

View File

@ -3,8 +3,9 @@ version: "3"
services:
backup:
build: .
# entrypoint: /app/init.sh
environment:
- RCLONE_REMOTE=gdrive:/backup
- RCLONE_REMOTE=gdrive:/backupTest
- RCLONE_CONFIG=/config/rclone.conf
- RESTIC_PASSWORD=repopw
volumes:

13
init.sh Executable file
View 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"