filebrowser/build/push_ricebox.sh
1138-4EB 3f4db6b81e chore: fix author in push_rice (#514)
Former-commit-id: f2b1df2b3387ae61c9e165de5763a0e06c2eb7d7 [formerly b3b5751c000a722e5d61e20ecfd0f7ef18420b0f] [formerly d951176d0cf0e0f1db255eb9d4fb0f52688c8cb9 [formerly 7afaf59e5d133806eb83d740b8aae9901031cf28]]
Former-commit-id: 28fa6fdbd6b6414e303cf52ce57288e534a0a50c [formerly 780354453afc8940fec77d9b5765aeacc56dc924]
Former-commit-id: a83f01e72a88cdcc557f85b84f513c38b565f08e
2018-08-16 09:56:06 +01:00

39 lines
969 B
Bash
Executable File

#!/bin/sh
set -e
cd $(dirname $0)
COMMIT_SHA="$(git rev-parse --verify HEAD | cut -c1-8)"
eval `ssh-agent -s`
openssl aes-256-cbc -K $encrypted_9ca81b5594f5_key -iv $encrypted_9ca81b5594f5_iv -in ./deploy_key.enc -d | ssh-add -
git clone git@github.com:filebrowser/caddy caddy
cd caddy
cp ../../rice-box.go assets/
git checkout -b update-rice-box origin/master
git config --local user.name "Filebrowser Bot"
git config --local user.email "FilebrowserBot@users.noreply.github.com"
git commit -am "update rice-box $COMMIT_SHA"
if [ $(git tag | grep "$TRAVIS_TAG" | wc -l) -ne 0 ]; then
git tag -d "$TRAVIS_TAG"
fi
git tag "$TRAVIS_TAG"
if [ "$(git ls-remote --heads origin update-rice-box)" != "" ]; then
git push -u origin update-rice-box
else
git push origin +update-rice-box
fi
if [ "$(git ls-remote --heads origin update-rice-box)" != "" ]; then
git push origin "$TRAVIS_TAG"
else
git push origin :"$TRAVIS_TAG"
git push origin "$TRAVIS_TAG"
fi