diff --git a/Dockerfile b/Dockerfile index 8f8182c..43e1f5a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM alpine/git:latest -RUN apk add --no-cache bash findutils +RUN apk add --no-cache bash rsync git COPY entrypoint.sh / RUN chmod +x /entrypoint.sh diff --git a/entrypoint.sh b/entrypoint.sh index 08a805c..2056526 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -50,11 +50,8 @@ tmp_dir=$(mktemp -d -t ci-XXXXXXXXXX) git pull "$GIT_REPOSITORY_URL" ) -debug "Enumerating contents of $1" -for file in $(find $1 -maxdepth 1 -type f -name '*.md' -execdir basename '{}' ';'); do - debug "Copying $file" - cp "$1/$file" "$tmp_dir" -done +debug "Syncing contents of $1 to repository" +rsync -avzr --delete --exclude='.git/' "$1" "$tmp_dir" || exit 1 debug "Committing and pushing changes" (