From 4ace991b8acbbb3b567c349e4fb894610f2cf4ca Mon Sep 17 00:00:00 2001 From: 1138-4EB <1138-4EB@users.noreply.github.com> Date: Mon, 6 Aug 2018 05:02:59 +0100 Subject: [PATCH] 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 --- .travis.yml | 1 + build/push_ricebox.sh | 34 ++++++++++++++++++++++++++++++++++ build/release.sh | 3 +-- 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100755 build/push_ricebox.sh diff --git a/.travis.yml b/.travis.yml index 0de98adb..99187c03 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,6 +44,7 @@ jobs: - ./build/docker_login.sh - docker run --rm -itv $(pwd):$WDIR -v /var/run/docker.sock:/var/run/docker.sock filebrowser/dev goreleaser - docker logout + - ./build/push_ricebox.sh if: tag IS present deploy: provider: releases diff --git a/build/push_ricebox.sh b/build/push_ricebox.sh new file mode 100755 index 00000000..12f1ffd5 --- /dev/null +++ b/build/push_ricebox.sh @@ -0,0 +1,34 @@ +#!/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 + diff --git a/build/release.sh b/build/release.sh index b91c83fc..cf285d46 100644 --- a/build/release.sh +++ b/build/release.sh @@ -21,8 +21,7 @@ echo "> Checking matching $semver in frontend submodule" cd frontend git fetch --all -trash=$(git tag | grep "$semver") -if [ $? -ne 0 ]; then +if [ $(git tag | grep "$semver" | wc -l) -eq 0 ]; then echo "Tag $semver does not exist in submodule 'frontend'. Tag it and run this script again." exit 1 fi