forked from Shiloh/githaven
go1.15 (#12475)
* go1.15 * update makefile xgo version * fix vet issue * update docs to version of go in use * add TODO for asyncpreemptoff Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
parent
e01bac8404
commit
bd7d6a3d73
28
.drone.yml
28
.drone.yml
@ -26,7 +26,7 @@ steps:
|
|||||||
|
|
||||||
- name: lint-backend
|
- name: lint-backend
|
||||||
pull: always
|
pull: always
|
||||||
image: golang:1.14
|
image: golang:1.15
|
||||||
commands:
|
commands:
|
||||||
- make lint-backend
|
- make lint-backend
|
||||||
environment:
|
environment:
|
||||||
@ -53,7 +53,7 @@ steps:
|
|||||||
|
|
||||||
- name: build-backend-arm64
|
- name: build-backend-arm64
|
||||||
pull: always
|
pull: always
|
||||||
image: golang:1.14
|
image: golang:1.15
|
||||||
environment:
|
environment:
|
||||||
GO111MODULE: on
|
GO111MODULE: on
|
||||||
GOPROXY: off
|
GOPROXY: off
|
||||||
@ -67,7 +67,7 @@ steps:
|
|||||||
|
|
||||||
- name: build-backend-386
|
- name: build-backend-386
|
||||||
pull: always
|
pull: always
|
||||||
image: golang:1.14
|
image: golang:1.15
|
||||||
environment:
|
environment:
|
||||||
GO111MODULE: on
|
GO111MODULE: on
|
||||||
GOPROXY: off
|
GOPROXY: off
|
||||||
@ -150,7 +150,7 @@ steps:
|
|||||||
|
|
||||||
- name: build
|
- name: build
|
||||||
pull: always
|
pull: always
|
||||||
image: golang:1.14
|
image: golang:1.15
|
||||||
commands:
|
commands:
|
||||||
- make backend
|
- make backend
|
||||||
environment:
|
environment:
|
||||||
@ -166,7 +166,7 @@ steps:
|
|||||||
|
|
||||||
- name: unit-test
|
- name: unit-test
|
||||||
pull: always
|
pull: always
|
||||||
image: golang:1.14
|
image: golang:1.15
|
||||||
commands:
|
commands:
|
||||||
- make unit-test-coverage test-check
|
- make unit-test-coverage test-check
|
||||||
environment:
|
environment:
|
||||||
@ -177,7 +177,7 @@ steps:
|
|||||||
|
|
||||||
- name: test-mysql
|
- name: test-mysql
|
||||||
pull: always
|
pull: always
|
||||||
image: golang:1.14
|
image: golang:1.15
|
||||||
commands:
|
commands:
|
||||||
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
|
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
|
||||||
- apt-get install -y git-lfs
|
- apt-get install -y git-lfs
|
||||||
@ -192,7 +192,7 @@ steps:
|
|||||||
|
|
||||||
- name: test-mysql8
|
- name: test-mysql8
|
||||||
pull: always
|
pull: always
|
||||||
image: golang:1.14
|
image: golang:1.15
|
||||||
commands:
|
commands:
|
||||||
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
|
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
|
||||||
- apt-get install -y git-lfs
|
- apt-get install -y git-lfs
|
||||||
@ -207,7 +207,7 @@ steps:
|
|||||||
|
|
||||||
- name: test-mssql
|
- name: test-mssql
|
||||||
pull: always
|
pull: always
|
||||||
image: golang:1.14
|
image: golang:1.15
|
||||||
commands:
|
commands:
|
||||||
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
|
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
|
||||||
- apt-get install -y git-lfs
|
- apt-get install -y git-lfs
|
||||||
@ -222,7 +222,7 @@ steps:
|
|||||||
|
|
||||||
- name: generate-coverage
|
- name: generate-coverage
|
||||||
pull: always
|
pull: always
|
||||||
image: golang:1.14
|
image: golang:1.15
|
||||||
commands:
|
commands:
|
||||||
- make coverage
|
- make coverage
|
||||||
environment:
|
environment:
|
||||||
@ -295,7 +295,7 @@ steps:
|
|||||||
|
|
||||||
- name: build
|
- name: build
|
||||||
pull: always
|
pull: always
|
||||||
image: golang:1.14
|
image: golang:1.15
|
||||||
commands:
|
commands:
|
||||||
- make backend
|
- make backend
|
||||||
environment:
|
environment:
|
||||||
@ -305,7 +305,7 @@ steps:
|
|||||||
|
|
||||||
- name: test-sqlite
|
- name: test-sqlite
|
||||||
pull: always
|
pull: always
|
||||||
image: golang:1.14
|
image: golang:1.15
|
||||||
commands:
|
commands:
|
||||||
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
|
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
|
||||||
- apt-get install -y git-lfs
|
- apt-get install -y git-lfs
|
||||||
@ -319,7 +319,7 @@ steps:
|
|||||||
|
|
||||||
- name: test-pgsql
|
- name: test-pgsql
|
||||||
pull: always
|
pull: always
|
||||||
image: golang:1.14
|
image: golang:1.15
|
||||||
commands:
|
commands:
|
||||||
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
|
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
|
||||||
- apt-get install -y git-lfs
|
- apt-get install -y git-lfs
|
||||||
@ -427,7 +427,7 @@ steps:
|
|||||||
|
|
||||||
- name: static
|
- name: static
|
||||||
pull: always
|
pull: always
|
||||||
image: techknowlogick/xgo:go-1.14.x
|
image: techknowlogick/xgo:go-1.15.x
|
||||||
commands:
|
commands:
|
||||||
- apt update && apt -y install curl
|
- apt update && apt -y install curl
|
||||||
- curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs
|
- curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs
|
||||||
@ -525,7 +525,7 @@ steps:
|
|||||||
|
|
||||||
- name: static
|
- name: static
|
||||||
pull: always
|
pull: always
|
||||||
image: techknowlogick/xgo:go-1.14.x
|
image: techknowlogick/xgo:go-1.15.x
|
||||||
commands:
|
commands:
|
||||||
- apt update && apt -y install curl
|
- apt update && apt -y install curl
|
||||||
- curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs
|
- curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
###################################
|
###################################
|
||||||
#Build stage
|
#Build stage
|
||||||
FROM golang:1.14-alpine3.12 AS build-env
|
FROM golang:1.15-alpine3.12 AS build-env
|
||||||
|
|
||||||
ARG GOPROXY
|
ARG GOPROXY
|
||||||
ENV GOPROXY ${GOPROXY:-direct}
|
ENV GOPROXY ${GOPROXY:-direct}
|
||||||
|
2
Makefile
2
Makefile
@ -25,7 +25,7 @@ SHASUM ?= shasum -a 256
|
|||||||
HAS_GO = $(shell hash $(GO) > /dev/null 2>&1 && echo "GO" || echo "NOGO" )
|
HAS_GO = $(shell hash $(GO) > /dev/null 2>&1 && echo "GO" || echo "NOGO" )
|
||||||
COMMA := ,
|
COMMA := ,
|
||||||
|
|
||||||
XGO_VERSION := go-1.14.x
|
XGO_VERSION := go-1.15.x
|
||||||
MIN_GO_VERSION := 001012000
|
MIN_GO_VERSION := 001012000
|
||||||
MIN_NODE_VERSION := 010013000
|
MIN_NODE_VERSION := 010013000
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ params:
|
|||||||
website: https://docs.gitea.io
|
website: https://docs.gitea.io
|
||||||
version: 1.12.2
|
version: 1.12.2
|
||||||
minGoVersion: 1.12
|
minGoVersion: 1.12
|
||||||
goVersion: 1.14
|
goVersion: 1.15
|
||||||
minNodeVersion: 10.13
|
minNodeVersion: 10.13
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
|
@ -129,6 +129,7 @@ func (c *Command) RunInDirTimeoutEnvFullPipelineFunc(env []string, timeout time.
|
|||||||
cmd.Env = append(cmd.Env, fmt.Sprintf("LC_ALL=%s", DefaultLocale))
|
cmd.Env = append(cmd.Env, fmt.Sprintf("LC_ALL=%s", DefaultLocale))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: verify if this is still needed in golang 1.15
|
||||||
cmd.Env = append(cmd.Env, "GODEBUG=asyncpreemptoff=1")
|
cmd.Env = append(cmd.Env, "GODEBUG=asyncpreemptoff=1")
|
||||||
cmd.Dir = dir
|
cmd.Dir = dir
|
||||||
cmd.Stdout = stdout
|
cmd.Stdout = stdout
|
||||||
|
@ -6,6 +6,7 @@ package public
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"path"
|
"path"
|
||||||
@ -158,7 +159,7 @@ func (opts *Options) handle(ctx *macaron.Context, log *log.Logger, opt *Options)
|
|||||||
// Add an Expires header to the static content
|
// Add an Expires header to the static content
|
||||||
if opt.ExpiresAfter > 0 {
|
if opt.ExpiresAfter > 0 {
|
||||||
ctx.Resp.Header().Set("Expires", time.Now().Add(opt.ExpiresAfter).UTC().Format(http.TimeFormat))
|
ctx.Resp.Header().Set("Expires", time.Now().Add(opt.ExpiresAfter).UTC().Format(http.TimeFormat))
|
||||||
tag := GenerateETag(string(fi.Size()), fi.Name(), fi.ModTime().UTC().Format(http.TimeFormat))
|
tag := GenerateETag(fmt.Sprintf("%d", fi.Size()), fi.Name(), fi.ModTime().UTC().Format(http.TimeFormat))
|
||||||
ctx.Resp.Header().Set("ETag", tag)
|
ctx.Resp.Header().Set("ETag", tag)
|
||||||
if ctx.Req.Header.Get("If-None-Match") == tag {
|
if ctx.Req.Header.Get("If-None-Match") == tag {
|
||||||
ctx.Resp.WriteHeader(304)
|
ctx.Resp.WriteHeader(304)
|
||||||
|
Loading…
Reference in New Issue
Block a user