Skip to content

Commit

Permalink
Merge pull request #23 from eapearson/master
Browse files Browse the repository at this point in the history
Build and deployment improvements
  • Loading branch information
briehl committed Jan 15, 2016
2 parents 9c21b3e + ddd615c commit 56cf245
Show file tree
Hide file tree
Showing 31 changed files with 554 additions and 268 deletions.
19 changes: 10 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ node_js:
- "0.12"
# NB this should be 4.2, which is the LTS for node; they are working on it.
- "4.1"
cache:
directories:
- bower_components
- node_modules
#cache:
# directories:
# - bower_components
# - node_modules
branches:
only:
- master
Expand All @@ -18,9 +18,10 @@ branches:
# - develop
# - staging
# - master
before_install:
- npm install -g bower
- npm install -g grunt-cli
#before_install:
# - npm install -g bower
# - npm install -g grunt-cli
install:
- make
script: grunt test-travis
- make init
- make build config=ci
script: make test-travis
31 changes: 31 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,39 @@ module.exports = function (grunt) {
dev: {
name: 'dev'
}
},
clean: {
build: {
src: [
'build/build'
]
},
dist: {
src: [
'build/dist'
]
},
test: {
src: [
'build/build-test-coverage'
]
},
temp: {
src: [
'build/temp'
]
},
deps: {
src: [
'node_modules', 'bower_components'
]
}
}
});

grunt.registerTask('clean-all', [
'clean:build', 'clean:dist', 'clean:test', 'clean:deps', 'clean:temp'
]);

// Does a single, local, unit test run.
grunt.registerTask('test', [
Expand Down
File renamed without changes.
48 changes: 22 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ DISTLIB = $(TOPDIR)/build
DOCSLIB = $(TOPDIR)/docs
DEPLOY_CFG = deploy-$(TARGET).cfg
KB_TOP = /kb
GRUNT = ./node_modules/.bin/grunt
KARMA = ./node_modules/.bin/karma

# Standard 'all' target = just do the standard build
all: init build
Expand All @@ -41,18 +43,17 @@ run: init build start preview
init:
npm install
cd tools/server; npm install
grunt init
$(GRUNT) init

# Perform the build.
# The actual build step is done by grunt. This also sets up the
# configuration in the build target. That configuration mainly
# deals with filling out templated URL targets based on deployment
# location (prod vs. next vs. CI vs. local)
#@ grunt build-dist --target $(TARGET)
# --deploy-config $(TARGET)
# @ node tools/process_config.js $(DEPLOY_CFG)
# Perform the build. Build scnearios are supported through the config option
# which is passed in like "make build config=ci"
build:
cd mutations; node build build
cd mutations; node build $(config)

# The deploy step will copy the files according to the instructions in the deploy
# config. See mutations/deploy.js for details.
#deploy:
# cd mutations; node build deploy; node deploy

# Set up a development environment.
# Installs tools into kbase-ui/dev. These tools are ignored by git,
Expand All @@ -63,7 +64,7 @@ devinit:


start:
cd tools/server; node server start $(target) &
cd tools/server; node server start $(target) &

stop:
cd tools/server; node server stop
Expand All @@ -72,29 +73,24 @@ stop:
preview:
cd tools/server; node server preview

dist:
cd mutations; node build deploy

# The deploy step will copy the files according to the instructions in the deploy
# config. See mutations/deploy.js for details.
deploy:
cd mutations; node build deploy; node deploy

# Tests are managed by grunt, but this also mimics the workflow.
#init build
test:
karma start test/karma.conf.js
$(KARMA) start test/karma.conf.js

test-travis:
$(GRUNT) test-travis

# Cleans up build artifacts without removing required libraries
# that get installed through Bower or NPM.
# Clean slate
clean:
@ grunt clean-dist
$(GRUNT) clean-all

clean-temp:
$(GRUNT) clean:temp

# Cleans out all required libraries and packages.
reqs-clean: clean
@ rm -rf node_modules/
@ rm -rf bower_components/
# If you need more clean refinement, please see Gruntfile.js, in which you will
# find clean tasks for each major build artifact.

# Eventually, if docs need to be built, the process will go here.
docs: init
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ For more complete instructions (which in turn have links to technical guides), p

- [Prerequisites](docs/prerequisites.md)
- [Installation](docs/installation.md)
- [Deployment](docs/deployment.md)
- [Deployment](docs/quick-deploy.md)

## Development

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@
"postal": "1.0.7"
},
"devDependencies": {},
"license": "SEE LICENSE IN LICENSE.md"
"license": "SEE LICENSE IN LICENSE"
}
7 changes: 6 additions & 1 deletion config/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Configuration

This directory contains files necessary to configure
This directory contains files necessary to configure kbase ui builds:

- ```builds``` - one file per named configuration set.
- ```deploy``` - classic KBase deploy configuration: service urls, target dirs, per KBase deploy environment.
- ```ui``` - ui build configurations
- ```bowerInstall``` - master file for importing bower packages into kbase module space.
4 changes: 2 additions & 2 deletions config/build.yml → config/builds/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ targets:
deploy: ci
build:
dist: false
temp: ../mutantfiles
temp: ../temp
bower:
offline: false
debug: true
debug: false
server:
port: 8080
13 changes: 13 additions & 0 deletions config/builds/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Global Build Config
---
targets:
ui: prod
deploy: ci
build:
dist: true
temp: temp
bower:
offline: false
debug: false
server:
port: 8080
13 changes: 13 additions & 0 deletions config/builds/dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Global Build Config
---
targets:
ui: prod
deploy: ci
build:
dist: false
temp: temp
bower:
offline: false
debug: false
server:
port: 8080
13 changes: 13 additions & 0 deletions config/builds/next.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Global Build Config
---
targets:
ui: prod
deploy: next
build:
dist: true
temp: temp
bower:
offline: false
debug: false
server:
port: 8080
2 changes: 1 addition & 1 deletion config/deploy.yml → config/builds/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ targets:
deploy: prod
build:
dist: true
temp: ../mutantfiles
temp: temp
bower:
offline: false
debug: false
Expand Down
3 changes: 2 additions & 1 deletion config/deploy/deploy-ci.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ ujs_url=https://ci.kbase.us/services/userandjobstate
ws_url=https://ci.kbase.us/services/ws
narrative_url=https://narrative-ci.kbase.us
catalog_url=https://ci.kbase.us/services/catalog
taxon_url=https://ci.kbase.us/services/data/taxon
taxon_api_url=https://ci.kbase.us/services/data/taxon
assembly_api_url=https://ci.kbase.us/services/data/assembly
3 changes: 2 additions & 1 deletion config/deploy/deploy-next.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ ujs_url=https://next.kbase.us/services/userandjobstate
ws_url=https://next.kbase.us/services/ws
narrative_url=https://narrative-next.kbase.us
catalog_url=https://next.kbase.us/services/catalog
taxon_url=https://next.kbase.us/services/data/taxon
taxon_api_url=https://next.kbase.us/services/data/taxon
assembly_api_url=https://next.kbase.us/services/data/assembly
3 changes: 2 additions & 1 deletion config/deploy/deploy-prod.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ ujs_url=https://kbase.us/services/userandjobstate
ws_url=https://kbase.us/services/ws
narrative_url=https://narrative.kbase.us
catalog_url=https://kbase.us/services/catalog
taxon_url=https://kbase.us/services/data/taxon
taxon_api_url=https://kbase.us/services/data/taxon
assembly_api_url=https://kbase.us/services/data/assembly
8 changes: 7 additions & 1 deletion config/deploy/templates/service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,10 @@ services:
name: Narrative User Interface
catalog:
url: <%= catalog_url %>
name: Catalog
name: Catalog
taxon_api:
url: <%= taxon_api_url %>
name: Taxon API
assembly_api:
url: <%= assembly_api_url %>
name: Assembly API
21 changes: 0 additions & 21 deletions deploy.cfg

This file was deleted.

5 changes: 4 additions & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
cp -pr dist/client/* /kb/deployment/services/kbase-ui
DEPLOY_DEST=/kb/deployment/services/kbase-ui
rm -rf $DEPLOY_DEST
mkdir -p $DEPLOY_DEST
cp -pr build/dist/client/* $DEPLOY_DEST
3 changes: 3 additions & 0 deletions docs/configuration.md.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Configuration


8 changes: 8 additions & 0 deletions docs/notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Notes

Various notes:

## Vagrant


config.vm.network "private_network", type: "dhcp"
Loading

0 comments on commit 56cf245

Please sign in to comment.