github.com/solo-io/service-mesh-hub@v0.9.2/docs/Makefile (about)

     1  # Note to developers/testers
     2  # >> to force docs publication and deployment during testing, do the following:
     3  # cd to repo root, connect to a cluster where you want to push your images, run the following (update SUFFIX as you like)
     4  # SUFFIX=a PROJECT_ID=solo-public TAGGED_VERSION=vtest-docs-build$SUFFIX make publish-docs -B && kubectl apply -f docs/install/manifest-latest.yaml -n docs
     5  # >> to run host the docs locally, do the following
     6  # cd to the docs dir
     7  # make serve-site -B
     8  ifeq ($(TAGGED_VERSION),)
     9  	TAGGED_VERSION := $(shell git describe --tags --dirty --always)
    10  	RELEASE := "false"
    11  endif
    12  VERSION ?= $(shell echo $(TAGGED_VERSION) | cut -c 2-)
    13  ### REPLACE with product name
    14  IMAGE_REGISTRY := soloio
    15  IMAGE_LEAF_NAME := service-mesh-hub-docs
    16  IMAGE_REPO := $(IMAGE_REGISTRY)/$(IMAGE_LEAF_NAME)
    17  
    18  ### REPLACE with product name
    19  PRODUCT_SCOPE := service-mesh-hub
    20  DOCS_VERSION := latest
    21  
    22  #----------------------------------------------------------------------------------
    23  # Docs
    24  #----------------------------------------------------------------------------------
    25  
    26  .PHONY: site-common
    27  site-common: clean
    28  	# this theme is crucial (has the nested scoped short codes: protobuf and versioned_link_path - see dev-portal docs for use demos)
    29  	if [ ! -d themes/hugo-theme-soloio ]; then git clone https://github.com/solo-io/hugo-theme-soloio themes/hugo-theme-soloio; fi
    30  	# style updates for putting docs in the dev-portal repo, see details here https://github.com/solo-io/hugo-theme-soloio/commit/e0c50784a92fb7f61c635ff9a6e3a010f636f550
    31  	git -C themes/hugo-theme-soloio checkout 91507dc0e262b5009327a741bc9fd5cc2a949c38
    32  
    33  .PHONY: site-test
    34  site-test: site-common
    35  	hugo --config docs.toml
    36  
    37  .PHONY: site-release
    38  site-release: site-common
    39  	HUGO_PARAMS_Version=$(VERSION) hugo --config docs.toml
    40  	mv site site-latest
    41  
    42  .PHONY: serve-site
    43  serve-site: site-test
    44  	HUGO_PARAMS_Version=$(VERSION) hugo --config docs.toml --themesDir themes server -D
    45  
    46  .PHONY: clean
    47  clean:
    48  	rm -rf ./site ./resources ./site-latest ./site-versioned ./themes
    49  
    50  
    51  .PHONY: tagged
    52  tagged: site-release
    53  	docker build \
    54  		--build-arg VERSION=latest \
    55  		--build-arg PRODUCT_SCOPE=$(PRODUCT_SCOPE) \
    56  		--build-arg FROM_DIR=./site-latest \
    57  		-t $(IMAGE_REPO):$(VERSION) .
    58  	docker push $(IMAGE_REPO):$(VERSION)
    59  
    60  .PHONY: latest
    61  latest: site-release
    62  	docker build \
    63  		--build-arg VERSION=latest \
    64  		--build-arg PRODUCT_SCOPE=$(PRODUCT_SCOPE) \
    65  		--build-arg FROM_DIR=./site-latest \
    66  		-t $(IMAGE_REPO):latest .
    67  	docker push $(IMAGE_REPO):latest
    68  
    69  
    70  # Uses https://github.com/gjtorikian/html-proofer
    71  # Does not require running site; just make sure you generate the site and then run it
    72  # Install with gem install html-proofer
    73  # Another option we could use is wget: https://www.digitalocean.com/community/tutorials/how-to-find-broken-links-on-your-website-using-wget-on-debian-7
    74  .PHONY: check-links
    75  check-links: site-release
    76  	htmlproofer ./site-latest/ --empty-alt-ignore  --allow-hash-href --url-ignore "/localhost/,/github.com/solo-io/solo-projects/"