-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
70 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM appscode/base:8.7 | ||
|
||
RUN set -x \ | ||
&& apt-get update \ | ||
&& apt-get install -y --no-install-recommends ca-certificates cron \ | ||
&& apt-get purge -y --auto-remove ca-certificates \ | ||
&& rm -rf /var/lib/apt/lists/* /usr/share/doc /usr/share/man /tmp/* | ||
|
||
COPY restic /restic | ||
COPY restik /restik | ||
|
||
# Setup runit scripts | ||
COPY sv /etc/sv/ | ||
RUN ln -s /etc/sv /etc/service | ||
|
||
ENTRYPOINT ["/runit.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
GOPATH=$(go env GOPATH) | ||
REPO_ROOT=$GOPATH/src/github.com/appscode/restik | ||
|
||
source "$REPO_ROOT/hack/libbuild/common/lib.sh" | ||
source "$REPO_ROOT/hack/libbuild/common/public_image.sh" | ||
|
||
detect_tag $REPO_ROOT/dist/.tag | ||
|
||
IMG=restic | ||
RESTIC_VER=0.4.0 | ||
|
||
build() { | ||
pushd $REPO_ROOT/hack/docker/restic | ||
|
||
# Download restic | ||
wget https://github.com/restic/restic/releases/download/v${RESTIC_VER}/restic_${RESTIC_VER}_linux_amd64.bz2 | ||
bzip2 -d restic_${RESTIC_VER}_linux_amd64.bz2 | ||
mv restic_${RESTIC_VER}_linux_amd64 restic | ||
|
||
# Download restik | ||
wget -O restik https://cdn.appscode.com/binaries/restik/$TAG/restik-linux-amd64 | ||
chmod +x restik | ||
local cmd="docker build -t appscode/$IMG:${RESTIC_VER} ." | ||
echo $cmd; $cmd | ||
rm restik | ||
popd | ||
} | ||
|
||
binary_repo $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
exec 1> >(logger -s -p daemon.info -t ${PWD##*/}) | ||
exec 2> >(logger -s -p daemon.error -t ${PWD##*/}) | ||
source /etc/envvars | ||
|
||
echo "Starting cron..." | ||
# sv start socklog-unix || exit 1 | ||
exec cron -f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
exec 1> >(logger -s -p daemon.info -t ${PWD##*/}) | ||
exec 2> >(logger -s -p daemon.error -t ${PWD##*/}) | ||
source /etc/envvars | ||
|
||
echo "Starting restik..." | ||
exec /restik watch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters