From 6957374d3cda174b2296a0e4bc62aa228a66cbe0 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Mon, 31 Dec 2018 16:43:01 +0000 Subject: [PATCH] feat: revert some scripts License: MIT Signed-off-by: Henrique Dias --- .github/ISSUE_TEMPLATE/caddy_bug_report.md | 33 +++++++++++++++++++ .travis.yml | 1 + build/push_ricebox.sh | 38 ++++++++++++++++++++++ types/files.go | 5 --- types/version.go | 6 ++++ 5 files changed, 78 insertions(+), 5 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/caddy_bug_report.md create mode 100644 build/push_ricebox.sh create mode 100644 types/version.go diff --git a/.github/ISSUE_TEMPLATE/caddy_bug_report.md b/.github/ISSUE_TEMPLATE/caddy_bug_report.md new file mode 100644 index 00000000..18d8074e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/caddy_bug_report.md @@ -0,0 +1,33 @@ +--- +name: Caddy related bug report +about: Create a report to help us improve +--- + +**Are you asking for help with using Caddy or File Browser?** +Please use our forum instead: https://forum.caddyserver.com. + +**When did you download File Browser from caddyserver.com?** + +**What is your entire Caddyfile?** + +```text +(Put Caddyfile here) +``` + +**Description** +A clear and concise description of what the issue is about. What are you trying to do? + +**Expected behaviour** +What did you expect to happen? + +**What is happening instead?** +Please, give full error messages and/or log. + +**Additional context** +Add any other context about the problem here. If applicable, add screenshots to help explain your problem. + +**How to reproduce?** +Tell us how to reproduce this issue. How can someone who is starting from scratch reproduce this behaviour as minimally as possible? + +**Files** +A list of relevant files for this issue. Large files can be uploaded one-by-one or in a tarball/zipfile. diff --git a/.travis.yml b/.travis.yml index 5f8be73e..263c4ae7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,6 +35,7 @@ jobs: script: - docker run --rm -itv $(pwd):/go/src/github.com/filebrowser/filebrowser -v /var/run/docker.sock:/var/run/docker.sock filebrowser/dev goreleaser - ./build/push_images.sh + - ./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 100644 index 00000000..5f3c634a --- /dev/null +++ b/build/push_ricebox.sh @@ -0,0 +1,38 @@ +#!/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 ../../lib/rice-box.go assets/ +sed -i 's/package lib/package assets/g' assets/rice-box.go +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 diff --git a/types/files.go b/types/files.go index 26644e85..5dd6d879 100644 --- a/types/files.go +++ b/types/files.go @@ -18,11 +18,6 @@ import ( "github.com/spf13/afero" ) -const ( - // Version is the current File Browser version. - Version = "(untracked)" -) - // File describes a file. type File struct { *Listing diff --git a/types/version.go b/types/version.go new file mode 100644 index 00000000..845426c8 --- /dev/null +++ b/types/version.go @@ -0,0 +1,6 @@ +package types + +const ( + // Version is the current File Browser version. + Version = "(untracked)" +)