Our previous strategy of just using `git describe --tags --dirty` to compute a version caused issues. The major one was that since version sort lexigrapically, git's strategy of having a commit count without leading zeros lead to cases where 0.11.0-dev-9 was "newer than" 0.11.0-dev-10 which is not what you want at all. With this change, we compute a version by first seeing if the commit is tagged, and if so, we use that tag. Otherwise, we take the closest tag and to it append the unix timestamp of the commit and then append a git hash. Because we use the commit timestamp, things will sort correctly again. Part of pulumi/home#174
51 lines
1.9 KiB
Makefile
51 lines
1.9 KiB
Makefile
PROJECT_NAME := Pulumi Node.JS SDK
|
|
NODE_MODULE_NAME := @pulumi/pulumi
|
|
VERSION := $(shell ../../scripts/get-version)
|
|
|
|
LANGUAGE_HOST := github.com/pulumi/pulumi/sdk/nodejs/cmd/pulumi-language-nodejs
|
|
|
|
GOMETALINTERBIN := gometalinter
|
|
GOMETALINTER := ${GOMETALINTERBIN} --config=../../Gometalinter.json
|
|
|
|
PROJECT_PKGS := $(shell go list ./cmd...)
|
|
TESTPARALLELISM := 10
|
|
TEST_FAST_TIMEOUT := 2m
|
|
|
|
include ../../build/common.mk
|
|
|
|
export PATH:=$(shell yarn bin 2>/dev/null):$(PATH)
|
|
export NODE_PATH:=$(NODE_PATH):./runtime/native/build/Release
|
|
|
|
ensure::
|
|
cd runtime/native && ./ensure_node_v8.sh
|
|
|
|
lint::
|
|
$(GOMETALINTER) cmd/pulumi-language-nodejs/main.go | sort ; exit "$${PIPESTATUS[0]}"
|
|
tslint -c tslint.json -p tsconfig.json
|
|
|
|
build::
|
|
go install -ldflags "-X github.com/pulumi/pulumi/pkg/version.Version=${VERSION}" ${LANGUAGE_HOST}
|
|
cd runtime/native && node-gyp configure
|
|
cd runtime/native && node-gyp build
|
|
tsc
|
|
cp README.md ../../LICENSE package.json ./dist/* bin/
|
|
node ../../scripts/reversion.js bin/package.json ${VERSION}
|
|
node ../../scripts/reversion.js bin/version.js ${VERSION}
|
|
cp -R proto/. bin/proto/
|
|
mkdir -p bin/tests/runtime/langhost/cases/
|
|
find tests/runtime/langhost/cases/* -type d -exec cp -R {} bin/tests/runtime/langhost/cases/ \;
|
|
|
|
install::
|
|
GOBIN=$(PULUMI_BIN) go install -ldflags "-X github.com/pulumi/pulumi/pkg/version.Version=${VERSION}" ${LANGUAGE_HOST}
|
|
cp dist/pulumi-language-nodejs-exec "$(PULUMI_BIN)"
|
|
cp dist/pulumi-resource-pulumi-nodejs "$(PULUMI_BIN)"
|
|
mkdir -p "$(PULUMI_BIN)/$(shell node --version)"
|
|
cp runtime/native/build/Release/nativeruntime-v0.11.0.node "$(PULUMI_BIN)/$(shell node --version)/nativeruntime-v0.11.0.node"
|
|
rm -rf "$(PULUMI_NODE_MODULES)/$(NODE_MODULE_NAME)/tests"
|
|
|
|
test_fast::
|
|
istanbul test --print none _mocha -- --timeout 15000 'bin/tests/**/*.spec.js'
|
|
istanbul report text-summary
|
|
istanbul report text
|
|
go test -timeout $(TEST_FAST_TIMEOUT) -cover -parallel ${TESTPARALLELISM} ${PROJECT_PKGS}
|