Skip to content
This repository was archived by the owner on Mar 25, 2018. It is now read-only.

Commit dc1ab6f

Browse files
deploy: abort if local master != remote master
Don't continue with deploying if the local version of the repository is outdated to avoid uploads of an outdated website. Closes #78
1 parent b4c79ad commit dc1ab6f

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Makefile

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
VERSION=v`cat STABLE`
22
NODE_WEBSITE_PORT ?= 8080
33

4+
REMOTE_SHA = $(shell git ls-remote [email protected]:joyent/node-website.git | awk '/master/ {print $$1}')
5+
LOCAL_SHA = $(shell git rev-parse HEAD)
6+
47
generated_files1 = $(shell find doc -follow -type f -name \*.md | grep -v blog | xargs)
58
generated_files = $(addprefix out/,$(patsubst %.md,%.html,$(generated_files1)))
69

@@ -76,7 +79,7 @@ blog-upload: blog
7679
website-upload: doc
7780
rsync -r out/doc/ [email protected]:~/web/nodejs.org/
7881

79-
release: clean website-upload blog-upload
82+
release: predeploycheck clean website-upload blog-upload
8083
rsync -r out/doc/ [email protected]:~/web/nodejs.org/dist/$(VERSION)/docs/
8184

8285
docopen: out/doc/api/all.html
@@ -85,6 +88,12 @@ docopen: out/doc/api/all.html
8588
docclean:
8689
-rm -rf out/doc
8790

91+
predeploycheck:
92+
ifneq ($(REMOTE_SHA),$(LOCAL_SHA))
93+
@echo "remote repository and local repository not up to date... please pull latest master"
94+
exit 1
95+
endif
96+
8897
test: doc
8998
open http://localhost:${NODE_WEBSITE_PORT}
9099
node tools/server/server.js
@@ -95,4 +104,4 @@ test-blog: blog
95104

96105
clean: docclean blogclean
97106

98-
.PHONY: clean docopen docclean doc all website-upload blog blogclean
107+
.PHONY: clean docopen docclean doc all website-upload blog blogclean predeploycheck

0 commit comments

Comments
 (0)