forked from cockroachdb/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
76 lines (64 loc) · 2.81 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Copyright 2016 The Cockroach Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied. See the License for the specific language governing
# permissions and limitations under the License.
# Install all our ruby dependencies in an isolated environment. We
# depend on gem being installed globally, but not bundler. (Go
# developers sometimes manage to install
# https://github.com/golang/tools/tree/master/cmd/bundle in a location
# that conflicts with the ruby tool of the same name.)
# Note that we also amend the path to include /usr/local/opt/ruby/bin, which
# is where Homebrew will install a more up-to-date version of Ruby on macOS.
export GEM_HOME := vendor
export PATH := $(GEM_HOME)/bin:/usr/local/opt/ruby/bin:$(PATH)
# HACK: Make has a fast path and a slow path for command execution,
# but the fast path uses the PATH variable from when make was started,
# not the one we set on the previous line. In order for the above
# line to have any effect, we must force make to always take the slow path.
# Setting the SHELL variable to a value other than the default (/bin/sh)
# is one way to do this globally.
# http://stackoverflow.com/questions/8941110/how-i-could-add-dir-to-path-in-makefile/13468229#13468229
export SHELL := $(shell which bash)
ifeq ($(SHELL),)
$(error bash is required)
endif
.PHONY: all
all: bootstrap
comma := ,
extra-config := $(if $(JEKYLLCONFIG),$(comma)$(JEKYLLCONFIG))
jekyll-action := build
.PHONY: cockroachdb-build
cockroachdb-build: bootstrap
bundle exec jekyll $(jekyll-action) --incremental --trace --config _config_base.yml,_config_cockroachdb.yml$(extra-config) $(JEKYLLFLAGS)
.PHONY: cockroachdb
cockroachdb: jekyll-action := serve --port 4000
cockroachdb: bootstrap
bundle exec jekyll $(jekyll-action) --incremental --trace --config _config_base.yml,_config_cockroachdb.yml,_config_cockroachdb_local.yml$(extra-config) $(JEKYLLFLAGS)
.PHONY: standard
standard: cockroachdb
.PHONY: cockroachcloud-build
cockroachcloud-build: bootstrap
bundle exec jekyll $(jekyll-action) --incremental --trace --config _config_base.yml,_config_cockroachcloud.yml$(extra-config) $(JEKYLLFLAGS)
.PHONY: cockroachcloud
cockroachcloud: jekyll-action := serve --port 4001
cockroachcloud: cockroachcloud-build
.PHONY: test
test:
go get -u github.com/cockroachdb/htmltest
# Docker must be running locally for this to work.
./netlify/local
htmltest
vendor:
gem install bundler
bootstrap: Gemfile Gemfile.lock | vendor
bundle install
touch $@