filebrowser/build/push_ricebox.sh
Henrique Dias 4267ebf0b4 fix: error at first sign
License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>

Former-commit-id: 649162e55f57817c6e2fd8cb66fb4de1ada68199 [formerly fe5e1f6df6320c2eb6f24ca64ebffd6cedf6659b] [formerly 2f6eea9879c754d67acdf8f0809dd9c39cc12df0 [formerly 4470e0b4500f059ac23bf02b13c632d68aeb3fb2]]
Former-commit-id: 3a3500d1492db1ca7c262c60390452892fccb97b [formerly 2ea468347c670e8dfeda99be204e0b22072ea9c5]
Former-commit-id: be6a317810a0a465db2e852c6839308bf4d346ad
2018-08-06 20:53:48 +01:00

37 lines
850 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 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