filebrowser/build/push_ricebox.sh
1138-4EB 4ace991b8a update ricebox in caddy/assets
Former-commit-id: af8d9982d961f4c8e5a301dc0eeb1dc790f35231 [formerly 6f678bfadf1e1db8c8dc5e368087a23a3dba8b65] [formerly 3d06b4d8d6b2ffe209f10b9ae4ce30955839e721 [formerly 6f7fded3f19a8357f0a36f8a50b0ff83f76f5c9c]]
Former-commit-id: 4016e6b9b12d5f945c67fd0960a3460cd1fbfda1 [formerly 1ead636502f6b0991e1b18f3de5889546cedfa24]
Former-commit-id: 03bb7d11a2062ca3fe4ffd5d3efc702e4652c260
2018-08-06 20:08:56 +01:00

35 lines
842 B
Bash
Executable File

#!/bin/sh
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 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