2017-06-22 23:57:09 +02:00
|
|
|
SHELL=/bin/bash
|
2017-08-24 01:51:16 +02:00
|
|
|
.SHELLFLAGS=-ec
|
2017-06-21 23:23:48 +02:00
|
|
|
|
2017-09-22 04:18:21 +02:00
|
|
|
PROJECT=github.com/pulumi/pulumi
|
Makeify more; add a "full build" target (#193)
* Makeify more; add a "full build" target
This change uses make for more of our tree. Namely, the AWS provider
and LumiJS compilers each now use make to build and/or install them.
Not only does this bring about some consistency to how we build and
test things, but also made it easy to add a full build target:
$ make all
This target will build, test, and install the core Go tools, the LumiJS
compiler, and the AWS provider, in that order.
Each can be made in isolation, however, which ensures that the inner
loop for those is fast and so that, when it comes to finishing
pulumi/lumi#147, we can easily split them out and make from the top.
2017-06-02 23:26:34 +02:00
|
|
|
PROJECT_PKGS=$(shell go list ./cmd/... ./pkg/... | grep -v /vendor/)
|
2017-10-14 00:45:50 +02:00
|
|
|
TESTPARALLELISM=10
|
2016-11-15 20:30:34 +01:00
|
|
|
|
2017-06-22 23:57:09 +02:00
|
|
|
ECHO=echo -e
|
2017-06-21 23:46:03 +02:00
|
|
|
GOMETALINTERBIN=gometalinter
|
Tidy up more lint
This change fixes a few things:
* Most importantly, we need to place a leading "." in the paths
to Gometalinter, otherwise some sub-linters just silently skip
the directory altogether. errcheck is one such linter, which
is a very important one!
* Use an explicit Gometalinter.json file to configure the various
settings. This flips on a few additional linters that aren't
on by default (line line length checking). Sadly, a few that
I'd like to enable take waaaay too much time, so in the future
we may consider a nightly job (this includes code similarity,
unused parameters, unused functions, and others that generally
require global analysis).
* Now that we're running more, however, linting takes a while!
The core Lumi project now takes 26 seconds to lint on my laptop.
That's not terrible, but it's long enough that we don't want to
do the silly "run them twice" thing our Makefiles were previously
doing. Instead, we shall deploy some $$($${PIPESTATUS[1]}-1))-fu
to rely on the fact that grep returns 1 on "zero lines".
* Finally, fix the many issues that this turned up.
I think(?) we are done, except, of course, for needing to drive
down some of the cyclomatic complexity issues (which I'm possibly
going to punt on; see pulumi/lumi#259 for more details).
2017-06-22 21:09:46 +02:00
|
|
|
GOMETALINTER=${GOMETALINTERBIN} --config=Gometalinter.json
|
2017-10-16 22:50:00 +02:00
|
|
|
VERSION=$(shell git describe --tags 2>/dev/null)
|
2017-06-21 23:46:03 +02:00
|
|
|
|
2017-09-28 20:53:08 +02:00
|
|
|
.PHONY: all
|
2017-08-30 03:24:12 +02:00
|
|
|
all: banner_all core sdk/nodejs integrationtest
|
2017-06-16 18:50:56 +02:00
|
|
|
|
|
|
|
.PHONY: nightly
|
2017-09-28 20:53:08 +02:00
|
|
|
nightly: all gocover
|
2017-08-06 17:52:32 +02:00
|
|
|
|
|
|
|
.PHONY: core
|
2017-11-01 00:49:15 +01:00
|
|
|
core: test install lint
|
2017-05-24 20:58:58 +02:00
|
|
|
|
Makeify more; add a "full build" target (#193)
* Makeify more; add a "full build" target
This change uses make for more of our tree. Namely, the AWS provider
and LumiJS compilers each now use make to build and/or install them.
Not only does this bring about some consistency to how we build and
test things, but also made it easy to add a full build target:
$ make all
This target will build, test, and install the core Go tools, the LumiJS
compiler, and the AWS provider, in that order.
Each can be made in isolation, however, which ensures that the inner
loop for those is fast and so that, when it comes to finishing
pulumi/lumi#147, we can easily split them out and make from the top.
2017-06-02 23:26:34 +02:00
|
|
|
.PHONY: banner
|
2017-05-24 20:58:58 +02:00
|
|
|
banner:
|
2017-08-02 18:25:22 +02:00
|
|
|
@$(ECHO) "\033[1;37m=====================\033[0m"
|
|
|
|
@$(ECHO) "\033[1;37mPulumi Fabric (Quick)\033[0m"
|
|
|
|
@$(ECHO) "\033[1;37m=====================\033[0m"
|
2017-06-22 23:57:09 +02:00
|
|
|
@$(ECHO) "\033[0;33mRunning quick build; to run full tests, run 'make all'\033[0m"
|
|
|
|
@$(ECHO) "\033[0;33mRemember to do this before checkin, otherwise your CI will fail\033[0m"
|
2017-06-02 19:30:57 +02:00
|
|
|
|
Makeify more; add a "full build" target (#193)
* Makeify more; add a "full build" target
This change uses make for more of our tree. Namely, the AWS provider
and LumiJS compilers each now use make to build and/or install them.
Not only does this bring about some consistency to how we build and
test things, but also made it easy to add a full build target:
$ make all
This target will build, test, and install the core Go tools, the LumiJS
compiler, and the AWS provider, in that order.
Each can be made in isolation, however, which ensures that the inner
loop for those is fast and so that, when it comes to finishing
pulumi/lumi#147, we can easily split them out and make from the top.
2017-06-02 23:26:34 +02:00
|
|
|
.PHONY: banner_all
|
|
|
|
banner_all:
|
2017-08-02 18:25:22 +02:00
|
|
|
@$(ECHO) "\033[1;37m====================\033[0m"
|
|
|
|
@$(ECHO) "\033[1;37mPulumi Fabric (Full)\033[0m"
|
|
|
|
@$(ECHO) "\033[1;37m====================\033[0m"
|
2017-01-28 00:42:55 +01:00
|
|
|
|
Makeify more; add a "full build" target (#193)
* Makeify more; add a "full build" target
This change uses make for more of our tree. Namely, the AWS provider
and LumiJS compilers each now use make to build and/or install them.
Not only does this bring about some consistency to how we build and
test things, but also made it easy to add a full build target:
$ make all
This target will build, test, and install the core Go tools, the LumiJS
compiler, and the AWS provider, in that order.
Each can be made in isolation, however, which ensures that the inner
loop for those is fast and so that, when it comes to finishing
pulumi/lumi#147, we can easily split them out and make from the top.
2017-06-02 23:26:34 +02:00
|
|
|
.PHONY: install
|
2017-01-28 00:42:55 +01:00
|
|
|
install:
|
2017-06-22 23:57:09 +02:00
|
|
|
@$(ECHO) "\033[0;32mINSTALL:\033[0m"
|
2017-10-16 22:50:00 +02:00
|
|
|
go install -ldflags "-X main.version=${VERSION}" ${PROJECT}
|
|
|
|
go install -ldflags "-X main.version=${VERSION}" ${PROJECT}/cmd/lumidl
|
2017-01-28 00:42:55 +01:00
|
|
|
|
2017-10-05 23:08:35 +02:00
|
|
|
.PHONY: format
|
|
|
|
format:
|
|
|
|
find . -iname "*.go" -not -path "./vendor/*" | xargs gofmt -s -w
|
|
|
|
|
2017-11-01 00:39:23 +01:00
|
|
|
.PHONY: lint_full
|
|
|
|
lint_full:
|
|
|
|
@$(ECHO) "\033[0;32mLINT (full):\033[0m"
|
2017-09-22 04:18:21 +02:00
|
|
|
$(GOMETALINTER) main.go | sort ; exit "$${PIPESTATUS[0]}"
|
Tidy up more lint
This change fixes a few things:
* Most importantly, we need to place a leading "." in the paths
to Gometalinter, otherwise some sub-linters just silently skip
the directory altogether. errcheck is one such linter, which
is a very important one!
* Use an explicit Gometalinter.json file to configure the various
settings. This flips on a few additional linters that aren't
on by default (line line length checking). Sadly, a few that
I'd like to enable take waaaay too much time, so in the future
we may consider a nightly job (this includes code similarity,
unused parameters, unused functions, and others that generally
require global analysis).
* Now that we're running more, however, linting takes a while!
The core Lumi project now takes 26 seconds to lint on my laptop.
That's not terrible, but it's long enough that we don't want to
do the silly "run them twice" thing our Makefiles were previously
doing. Instead, we shall deploy some $$($${PIPESTATUS[1]}-1))-fu
to rely on the fact that grep returns 1 on "zero lines".
* Finally, fix the many issues that this turned up.
I think(?) we are done, except, of course, for needing to drive
down some of the cyclomatic complexity issues (which I'm possibly
going to punt on; see pulumi/lumi#259 for more details).
2017-06-22 21:09:46 +02:00
|
|
|
$(GOMETALINTER) ./pkg/... | sort ; exit "$${PIPESTATUS[0]}"
|
2017-09-22 04:18:21 +02:00
|
|
|
$(GOMETALINTER) ./cmd/... | sort ; exit "$${PIPESTATUS[0]}"
|
2017-06-21 22:24:35 +02:00
|
|
|
|
|
|
|
# In quiet mode, suppress some messages.
|
2017-09-22 04:18:21 +02:00
|
|
|
# - "or be unexported": TODO[pulumi/pulumi#191]: will fix when we write all of our API docs
|
2017-11-01 00:39:23 +01:00
|
|
|
LINT_SUPPRESS="or be unexported"
|
2017-06-14 01:47:55 +02:00
|
|
|
|
2017-11-01 00:39:23 +01:00
|
|
|
.PHONY: lint
|
|
|
|
lint:
|
|
|
|
@$(ECHO) "\033[0;32mLINT:\033[0m"
|
2017-09-22 04:18:21 +02:00
|
|
|
$(GOMETALINTER) main.go | grep -vE ${LINT_SUPPRESS} | sort ; exit $$(($${PIPESTATUS[1]}-1))
|
Tidy up more lint
This change fixes a few things:
* Most importantly, we need to place a leading "." in the paths
to Gometalinter, otherwise some sub-linters just silently skip
the directory altogether. errcheck is one such linter, which
is a very important one!
* Use an explicit Gometalinter.json file to configure the various
settings. This flips on a few additional linters that aren't
on by default (line line length checking). Sadly, a few that
I'd like to enable take waaaay too much time, so in the future
we may consider a nightly job (this includes code similarity,
unused parameters, unused functions, and others that generally
require global analysis).
* Now that we're running more, however, linting takes a while!
The core Lumi project now takes 26 seconds to lint on my laptop.
That's not terrible, but it's long enough that we don't want to
do the silly "run them twice" thing our Makefiles were previously
doing. Instead, we shall deploy some $$($${PIPESTATUS[1]}-1))-fu
to rely on the fact that grep returns 1 on "zero lines".
* Finally, fix the many issues that this turned up.
I think(?) we are done, except, of course, for needing to drive
down some of the cyclomatic complexity issues (which I'm possibly
going to punt on; see pulumi/lumi#259 for more details).
2017-06-22 21:09:46 +02:00
|
|
|
$(GOMETALINTER) ./pkg/... | grep -vE ${LINT_SUPPRESS} | sort ; exit $$(($${PIPESTATUS[1]}-1))
|
2017-09-22 04:18:21 +02:00
|
|
|
$(GOMETALINTER) ./cmd/... | grep -vE ${LINT_SUPPRESS} | sort ; exit $$(($${PIPESTATUS[1]}-1))
|
2017-11-01 00:39:23 +01:00
|
|
|
@$(ECHO) "\033[0;33mlint was run quietly; to run with noisy errors, run 'make lint_full'\033[0m"
|
2017-01-28 00:42:55 +01:00
|
|
|
|
Makeify more; add a "full build" target (#193)
* Makeify more; add a "full build" target
This change uses make for more of our tree. Namely, the AWS provider
and LumiJS compilers each now use make to build and/or install them.
Not only does this bring about some consistency to how we build and
test things, but also made it easy to add a full build target:
$ make all
This target will build, test, and install the core Go tools, the LumiJS
compiler, and the AWS provider, in that order.
Each can be made in isolation, however, which ensures that the inner
loop for those is fast and so that, when it comes to finishing
pulumi/lumi#147, we can easily split them out and make from the top.
2017-06-02 23:26:34 +02:00
|
|
|
.PHONY: test
|
2017-01-28 00:42:55 +01:00
|
|
|
test:
|
2017-06-22 23:57:09 +02:00
|
|
|
@$(ECHO) "\033[0;32mTEST:\033[0m"
|
2017-10-28 00:36:28 +02:00
|
|
|
go test -timeout 2m -cover -parallel ${TESTPARALLELISM} ${PROJECT_PKGS}
|
2017-08-06 17:52:32 +02:00
|
|
|
|
|
|
|
.PHONY: integrationtest
|
|
|
|
integrationtest:
|
|
|
|
@$(ECHO) "\033[0;32mINTEGRATION TEST:\033[0m"
|
2017-09-18 22:06:59 +02:00
|
|
|
@if [ -z "`which pulumi-langhost-nodejs`" ]; then $(ECHO) Please add "`pwd`/sdk/nodejs/bin" to your path before running integration tests. && exit 1; fi
|
2017-11-01 00:42:16 +01:00
|
|
|
go test -cover -parallel ${TESTPARALLELISM} ./examples ./tests
|
2017-06-01 23:01:26 +02:00
|
|
|
|
2017-08-28 18:17:52 +02:00
|
|
|
sdk/nodejs:
|
|
|
|
@cd ./sdk/nodejs && $(MAKE)
|
|
|
|
.PHONY: sdk/nodejs
|
Makeify more; add a "full build" target (#193)
* Makeify more; add a "full build" target
This change uses make for more of our tree. Namely, the AWS provider
and LumiJS compilers each now use make to build and/or install them.
Not only does this bring about some consistency to how we build and
test things, but also made it easy to add a full build target:
$ make all
This target will build, test, and install the core Go tools, the LumiJS
compiler, and the AWS provider, in that order.
Each can be made in isolation, however, which ensures that the inner
loop for those is fast and so that, when it comes to finishing
pulumi/lumi#147, we can easily split them out and make from the top.
2017-06-02 23:26:34 +02:00
|
|
|
|
2017-07-20 20:06:24 +02:00
|
|
|
publish:
|
2017-07-21 18:37:14 +02:00
|
|
|
@$(ECHO) "\033[0;32mPublishing current release:\033[0m"
|
|
|
|
./scripts/publish.sh
|
2017-07-20 20:06:24 +02:00
|
|
|
.PHONY: publish
|
2016-11-15 20:30:34 +01:00
|
|
|
|
2017-06-24 00:11:20 +02:00
|
|
|
.PHONY: gocover
|
|
|
|
gocover:
|
|
|
|
@$(ECHO) "\033[0;32mGO CODE COVERAGE:\033[0m"
|
2017-07-21 18:37:14 +02:00
|
|
|
./scripts/gocover.sh
|
2017-06-24 00:11:20 +02:00
|
|
|
|
2017-09-28 20:53:08 +02:00
|
|
|
# The travis_* targets are entrypoints for CI.
|
|
|
|
.PHONY: travis_cron
|
|
|
|
travis_cron: nightly
|
|
|
|
|
|
|
|
.PHONY: travis_push
|
|
|
|
travis_push: all publish
|
|
|
|
|
|
|
|
.PHONY: travis_pull_request
|
|
|
|
travis_pull_request: all
|
|
|
|
|
|
|
|
.PHONY: travis_api
|
|
|
|
travis_api: all
|