From 6f117546708b1d55eca5f2d83d6b02b339e69f90 Mon Sep 17 00:00:00 2001 From: Luke Hanley Date: Fri, 3 Aug 2018 19:23:16 +0100 Subject: [PATCH] Wercker + Docker + Version bump --- Dockerfile | 6 +++--- http_test.go | 20 ++++++++++---------- main.go | 2 +- skin.go | 2 +- storage/util/benchmark/bench.go | 1 + wercker.yml | 12 +++++++----- 6 files changed, 23 insertions(+), 20 deletions(-) create mode 100644 storage/util/benchmark/bench.go diff --git a/Dockerfile b/Dockerfile index 92c4c94..1003545 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,8 +3,8 @@ FROM golang:alpine AS builder WORKDIR /go/src/github.com/minotar/imgd COPY . . RUN apk add --no-cache git -RUN go-wrapper download # "go get -d -v ./..." -RUN go-wrapper install # "go install -v ./..." +RUN go get -d -v ./... +RUN go install -v ./... #final stage FROM alpine:latest @@ -12,5 +12,5 @@ RUN apk --no-cache add ca-certificates COPY --from=builder /go/bin/imgd /imgd COPY config.example.gcfg /config.gcfg ENTRYPOINT ./imgd -LABEL Name=imgd Version=2.11.0 +LABEL Name=imgd Version=3.0.0 EXPOSE 8000 diff --git a/http_test.go b/http_test.go index d0bc1e2..b3947ae 100644 --- a/http_test.go +++ b/http_test.go @@ -59,34 +59,34 @@ func TestHTTPMockVersion(t *testing.T) { workingUsernames := []string{ "clone1018", "citricsquid", + "404stexture", } + // Manually add the Steve hash for the 404stexture user + mockminecraft.TexturesHash["/texture/404Texture"] = "98903c1609352e11552dca79eb1ce3d6" avatarHash := map[string]string{ "clone1018": "71bdaacd85812af7cd7f4226c6c91c43", "citricsquid": "91ae8bcc4f238ede2e234e685a7009fb", + "404stexture": "35021cc9febae6e275a3212b8c6afc51", } cubeHash := map[string]string{ "clone1018": "a9055bca4a27c0ef7b2bc511e18c7576", "citricsquid": "0fe263aef4b749c58e42a9089a416154", + "404stexture": "77c6e031b9df248964a50ae7fb935a7a", } bustHash := map[string]string{ "clone1018": "725ddd51b55b15db173279694df43d5d", "citricsquid": "94d506fe4846b01d033c22ac509e1dc7", + "404stexture": "3cef88fe7bc87c8f75378ecc3e8133c4", } bodyHash := map[string]string{ "clone1018": "3e8ee3e1ed24f685820625cf80c12432", "citricsquid": "eed549817c360c77ac2aa3201e51aa1c", - } - armorBustHash := map[string]string{ - "clone1018": "725ddd51b55b15db173279694df43d5d", - "citricsquid": "94d506fe4846b01d033c22ac509e1dc7", - } - armorBodyHash := map[string]string{ - "clone1018": "3e8ee3e1ed24f685820625cf80c12432", - "citricsquid": "eed549817c360c77ac2aa3201e51aa1c", + "404stexture": "d921d3646a62b0617f1a3767560ca877", } downloadHash := map[string]string{ "clone1018": "602026c3174c3ba63737e4b82675afa8", "citricsquid": "37afc5d1a03364dc554e2f5859ac461d", + "404stexture": "97d1b39ad94b896faff826cb93d45c98", } resourceHashes := map[string]map[string]string{ "avatar": avatarHash, @@ -94,8 +94,8 @@ func TestHTTPMockVersion(t *testing.T) { "cube": cubeHash, "bust": bustHash, "body": bodyHash, - "armor/bust": armorBustHash, - "armor/body": armorBodyHash, + "armor/bust": bustHash, + "armor/body": bodyHash, "skin": downloadHash, "download": downloadHash, } diff --git a/main.go b/main.go index 1f58d2b..32ecd4b 100644 --- a/main.go +++ b/main.go @@ -24,7 +24,7 @@ const ( MinWidth = uint(8) MaxWidth = uint(300) - ImgdVersion = "2.11.0" + ImgdVersion = "3.0.0" ) var ( diff --git a/skin.go b/skin.go index c695eb5..7b0297a 100644 --- a/skin.go +++ b/skin.go @@ -29,7 +29,7 @@ const ( uuidRateLimitTTL = 1 * time.Hour uuidErrorTTL = 30 * time.Minute - skinTTL = 30 * day + skinTTL = 1 * time.Hour skinErrorTTL = 15 * time.Minute metaUnknownCode = "204" diff --git a/storage/util/benchmark/bench.go b/storage/util/benchmark/bench.go new file mode 100644 index 0000000..354df9d --- /dev/null +++ b/storage/util/benchmark/bench.go @@ -0,0 +1 @@ +package bench diff --git a/wercker.yml b/wercker.yml index 462b8d3..d126ee3 100644 --- a/wercker.yml +++ b/wercker.yml @@ -20,14 +20,16 @@ build: - script: name: go build code: | - GOOS=linux GOARCH=amd64 go build -o $WERCKER_OUTPUT_DIR/imgd_linux_amd64 ./... - GOOS=darwin GOARCH=amd64 go build -o $WERCKER_OUTPUT_DIR/imgd_darwin_amd64 ./... + GOOS=linux GOARCH=amd64 go build -o $WERCKER_OUTPUT_DIR/imgd_linux_amd64 + GOOS=darwin GOARCH=amd64 go build -o $WERCKER_OUTPUT_DIR/imgd_darwin_amd64 # Test the project - script: name: go test code: | - go test ./... + # If we don't pull in sub-packages imports, then this will fail + # go test ./... + go test release: steps: @@ -40,8 +42,8 @@ release: # Should ideally use some intelligence to get version, eg $(./imgd -version) would be cool - github-create-release: token: $GITHUB_TOKEN - tag: 2.11.0 - title: imgd 2.11.0 + tag: 3.0.0 + title: imgd 3.0.0 draft: true - github-upload-asset: