Skip to content

Commit 3a4434c

Browse files
committed
website: Moved to netlify.
Signed-off-by: Bartek Plotka <bwplotka@gmail.com>
1 parent 7aad30d commit 3a4434c

File tree

8 files changed

+34
-18
lines changed

8 files changed

+34
-18
lines changed

Makefile

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ PROMU ?= $(GOBIN)/promu-$(PROMU_VERSION)
2424
PROMU_VERSION ?= 264dc36af9ea3103255063497636bd5713e3e9c1
2525
PROTOC ?= $(GOBIN)/protoc-$(PROTOC_VERSION)
2626
PROTOC_VERSION ?= 3.4.0
27-
# v0.54.0
28-
HUGO_VERSION ?= b1a82c61aba067952fdae2f73b826fe7d0f3fc2f
27+
# v0.55.3
28+
HUGO_VERSION ?= 993b84333cd75faa224d02618f312a0e96b53372
2929
HUGO ?= $(GOBIN)/hugo-$(HUGO_VERSION)
3030
# v3.1.1
3131
GOBINDATA_VERSION ?= a9c83481b38ebb1c4eb8f0168fd4b10ca1d3c523
@@ -34,6 +34,7 @@ GIT ?= $(shell which git)
3434
BZR ?= $(shell which bzr)
3535

3636
WEB_DIR ?= website
37+
WEBSITE_BASE_URL ?= thanos.io
3738
PUBLIC_DIR ?= $(WEB_DIR)/public
3839
ME ?= $(shell whoami)
3940

@@ -236,18 +237,16 @@ web-pre-process:
236237
web: web-pre-process $(HUGO)
237238
@echo ">> building documentation website"
238239
# TODO(bwplotka): Make it --gc
239-
@cd $(WEB_DIR) && HUGO_ENV=production $(HUGO) --config hugo-generated.yaml --minify -v
240+
@cd $(WEB_DIR) && HUGO_ENV=production $(HUGO) --config hugo.yaml --minify -v -b $(WEBSITE_BASE_URL)
240241

241242
.PHONY: web-serve
242243
web-serve: web-pre-process $(HUGO)
243244
@echo ">> serving documentation website"
244-
@cd $(WEB_DIR) && $(HUGO) --config hugo-generated.yaml -v server
245+
@cd $(WEB_DIR) && $(HUGO) --config hugo.yaml -v server
245246

246-
.PHONY: web-deploy
247+
# Deprecated.
248+
.PHONY: web-gh-pages-deploy
247249
web-deploy:
248-
ifndef GOOGLE_ANALYTICS_TOKEN
249-
$(error GOOGLE_ANALYTICS_TOKEN is not set)
250-
endif
251250
# Requires git creds configured beforehand.
252251
$(call require_clean_work_tree,"deploy website")
253252
@rm -rf $(PUBLIC_DIR)
@@ -278,7 +277,9 @@ $(PROMU):
278277
$(call fetch_go_bin_version,github.com/prometheus/promu,$(PROMU_VERSION))
279278

280279
$(HUGO):
281-
$(call fetch_go_bin_version,github.com/gohugoio/hugo,$(HUGO_VERSION))
280+
@go get github.com/gohugoio/hugo@$(HUGO_VERSION)
281+
@mv $(GOBIN)/hugo $(HUGO)
282+
@go mod tidy
282283

283284
$(GOBINDATA):
284285
$(call fetch_go_bin_version,github.com/go-bindata/go-bindata/go-bindata,$(GOBINDATA_VERSION))

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
[![GoDoc](https://godoc.org/github.com/improbable-eng/thanos?status.svg)](https://godoc.org/github.com/improbable-eng/thanos)
66
[![Slack](https://img.shields.io/badge/join%20slack-%23thanos-brightgreen.svg)](https://join.slack.com/t/improbable-eng/shared_invite/enQtMzQ1ODcyMzQ5MjM4LWY5ZWZmNGM2ODc5MmViNmQ3ZTA3ZTY3NzQwOTBlMTkzZmIxZTIxODk0OWU3YjZhNWVlNDU3MDlkZGViZjhkMjc)
77
[![Docker Pulls](https://img.shields.io/docker/pulls/improbable/thanos.svg?maxAge=604800)](https://hub.docker.com/r/improbable/thanos/)
8+
[![Netlify Status](https://api.netlify.com/api/v1/badges/664a5091-934c-4b0e-a7b6-bc12f822a590/deploy-status)](https://app.netlify.com/sites/kind-mayer-9cc74b/deploys)
89

910
## Overview
1011

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ require (
4141
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd
4242
golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890
4343
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4
44-
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 // indirect
44+
golang.org/x/sys v0.0.0-20190322080309-f49334f85ddc // indirect
4545
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2
4646
google.golang.org/api v0.1.0
4747
google.golang.org/appengine v1.4.0 // indirect

go.sum

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c h1:Ho+uVpke
249249
github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s=
250250
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ=
251251
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
252+
github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg=
252253
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
253254
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
254255
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
@@ -285,8 +286,8 @@ golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5h
285286
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
286287
golang.org/x/sys v0.0.0-20181218192612-074acd46bca6/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
287288
golang.org/x/sys v0.0.0-20190124100055-b90733256f2e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
288-
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 h1:DH4skfRX4EBpamg7iV4ZlCpblAHI6s6TDM39bFZumv8=
289-
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
289+
golang.org/x/sys v0.0.0-20190322080309-f49334f85ddc h1:4gbWbmmPFp4ySWICouJl6emP0MyS31yy9SrTlAGFT+g=
290+
golang.org/x/sys v0.0.0-20190322080309-f49334f85ddc/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
290291
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
291292
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2 h1:z99zHgr7hKfrUcX/KsoJk5FJfjTceCKIp96+biqP4To=
292293
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=

netlify.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[Settings]
2+
3+
[build]
4+
base = ""
5+
publish = "public"
6+
7+
[context.production]
8+
command = "make web"
9+
10+
[context.deploy-preview]
11+
command = "make web WEBSITE_BASE_URL=$DEPLOY_PRIME_URL"

scripts/websitepreprocess.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,4 @@ perl -pi -e 's/]\(\//]\(https:\/\/github.com\/improbable-eng\/thanos\/tree\/'${C
7070
# 4. All the relative links needs to have ../ This is because Hugo is missing: https://github.com/gohugoio/hugo/pull/3934
7171
perl -pi -e 's/]\(\.\//]\(..\//' ${ALL_DOC_CONTENT_FILES}
7272
perl -pi -e 's/]\((?!http)/]\(..\//' ${ALL_DOC_CONTENT_FILES}
73-
perl -pi -e 's/src=\"(?!http)/src=\"..\//' ${ALL_DOC_CONTENT_FILES}
74-
75-
# Pass Google analytics token:
76-
sed -e 's/${GOOGLE_ANALYTICS_TOKEN}/'${GOOGLE_ANALYTICS_TOKEN}'/' ${WEBSITE_DIR}/hugo.tmpl.yaml > ${WEBSITE_DIR}/hugo-generated.yaml
73+
perl -pi -e 's/src=\"(?!http)/src=\"..\//' ${ALL_DOC_CONTENT_FILES}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
title: "Thanos - Highly available Prometheus setup with long term storage capabilities"
2-
baseURL: "https://thanos.io"
2+
# This is controlled by makefile: baseURL: "https://thanos.io"
33
languageCode: "en-us"
44

55
enableGitInfo: true
@@ -9,7 +9,7 @@ pygmentsUseClasses: true
99

1010
# We use preprocessing script so it will not work as expected anyway.
1111
disableLiveReload: true
12-
googleAnalytics: "${GOOGLE_ANALYTICS_TOKEN}"
12+
googleAnalytics: "UA-137374921-1"
1313

1414
# So /thanos/docs/b link from /thanos/docs/some/a will be rewritten as ../b
1515
canonifyURLs: true

website/layouts/_default/baseof.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ <h6 class="font-weight-bold">Community</h6>
7171
<h6 class="font-weight-bold">About</h6>
7272
<p>Thanos is an OSS licensed project as Apache License 2.0</p>
7373
</div>
74+
<div class="col col-md-6 col-lg">
75+
<a href="https://www.netlify.com">
76+
<img src="https://www.netlify.com/img/global/badges/netlify-light.svg"/>
77+
</a>
78+
</div>
7479
</div>
7580
</div>
7681
</footer>

0 commit comments

Comments
 (0)