diff --git a/.drone.yml b/.drone.yml index 597a9a9..4631ccb 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,6 +2,12 @@ kind: pipeline name: build-amd64 +trigger: + event: + - push + - pull_request + - tag + platform: os: linux arch: amd64 @@ -67,8 +73,36 @@ steps: event: - push +--- +kind: pipeline +name: update-cron + +trigger: + event: + - cron + +platform: + os: linux + arch: amd64 + +steps: +- name: update + pull: always + image: spritsail/alpine + commands: + - apk add bash curl jq git + - ./update.sh + +- name: push + pull: always + image: appleboy/drone-git-push + settings: + branch: master + remote: git@github.com:spritsail/plex-media-server.git + ssh_key: {from_secret: git_ssh_key} + --- kind: signature -hmac: 6d4fdd6274fdab370550ea310af156a7e6fdb74794c80bf234a825d7136f6783 +hmac: ffa33c4e8d4d71e4a1dcbc850859ebde679f6c574885d99df3ca9496e1db55b9 ... diff --git a/update.sh b/update.sh index e279b02..437d40d 100755 --- a/update.sh +++ b/update.sh @@ -11,13 +11,16 @@ sed -Ei \ Dockerfile if ! git diff --quiet --exit-code Dockerfile; then + export GIT_COMMITTER_NAME="Spritsail Bot" + export GIT_COMMITTER_EMAIL="" + export GIT_AUTHOR_NAME="$GIT_COMMITTER_NAME" + export GIT_AUTHOR_EMAIL="$GIT_COMMITTER_EMAIL" git reset --soft git add -- Dockerfile git commit \ - --author="Spritsail Bot " \ --no-gpg-sign \ + --signoff \ -m "Update to Plex ${VERSION%-*}" - git push origin HEAD else >&2 echo No update available fi