diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..47732e71 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,30 @@ +# stats available at +# https://travis-ci.org/strukturag/spreed-speakfreely/ +language: go + +go: + - 1.1 + - 1.2 + - tip + +env: + - GEM_HOME=/var/lib/gems/1.8 + +before_install: + - sudo apt-get update + +install: + - sudo apt-get -y install nodejs npm rubygems python-babel + - sudo gem install sass + - sudo gem install compass + # 'npm config set ca ""' required only for node 0.6 + # which is installed on Travis CI + # see https://github.com/npm/npm/issues/4379#issuecomment-31590254 + - sudo npm config set ca "" + - sudo npm install -g po2json + +script: + - make get + - make styles + - make javascript + - make binary diff --git a/Makefile b/Makefile index d9ca1c93..870a5f3a 100644 --- a/Makefile +++ b/Makefile @@ -38,6 +38,15 @@ DIST := $(CURDIR)/dist_$(BUILD_ARCH) DIST_SRC := $(DIST)/src DIST_BIN := $(DIST)/bin +NODEJS_BIN := $(shell which nodejs) +ifeq ("$(NODEJS_BIN)", "") + NODEJS_BIN := $(shell which node) +endif +NODEJS_BIN_EXISTS := $(shell [ -x "$(NODEJS_BIN)" ] && echo 1 || echo 0) +ifneq ($(NODEJS_BIN_EXISTS), 1) + $(error "Can't find node.js runtime, please install / check your PATH") +endif + build: get binary styles javascript gopath: @@ -65,7 +74,7 @@ styles: javascript: mkdir -p $(OUTPUT_JS) - nodejs $(CURDIR)/build/r.js -o $(CURDIR)/build/build.js dir=$(OUTPUT_JS) baseUrl=$(CURDIR)/static/js mainConfigFile=$(CURDIR)/static/js/main.js + $(NODEJS_BIN) $(CURDIR)/build/r.js -o $(CURDIR)/build/build.js dir=$(OUTPUT_JS) baseUrl=$(CURDIR)/static/js mainConfigFile=$(CURDIR)/static/js/main.js release: GOPATH = "$(DIST):$(CURDIR)" release: LDFLAGS = -X main.version $(VERSION) -X main.defaultConfig $(CONFIG_PATH)/$(CONFIG_FILE) diff --git a/README.md b/README.md index 79c99cab..343d4a0d 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ The latest version of Spreed Speak Freely can be found on GitHub: - [Go](http://golang.org) >= 1.1.0 - [NodeJS](http://nodejs.org/) - - [Sass](http://sass-lang.com/) + - [Sass](http://sass-lang.com/) >= 3.2.0 - [Compass](http://compass-style.org/) - [Babel](http://babel.pocoo.org/) - [po2json](https://github.com/mikeedwards/po2json) @@ -19,6 +19,8 @@ The latest version of Spreed Speak Freely can be found on GitHub: ## Building + [![Build Status](https://travis-ci.org/strukturag/spreed-speakfreely.png?branch=master)](https://travis-ci.org/strukturag/spreed-speakfreely) + Go, Sass and NodeJS need to be in your $PATH. ```bash @@ -97,4 +99,4 @@ The latest version of Spreed Speak Freely can be found on GitHub: ## License -`Spreed Speak Freely` uses the AGPL license, see our `LICENSE` file. \ No newline at end of file +`Spreed Speak Freely` uses the AGPL license, see our `LICENSE` file.