This repository has been archived by the owner on Jan 7, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
circle.yml
45 lines (39 loc) · 2.38 KB
/
circle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
dependencies:
cache_directories:
- ci_cache
- node_modules
pre:
# Download and cache the API Umbrella package installer.
- mkdir -p ci_cache
- find ci_cache -maxdepth 1 -name 'api-umbrella*.deb' -not -name 'api-umbrella_0.8.0-1_amd64.deb' -exec rm -f {} \;
- if [[ ! -e ci_cache/api-umbrella_0.8.0-1_amd64.deb ]]; then wget -P ci_cache https://developer.nrel.gov/downloads/api-umbrella/ubuntu/12.04/api-umbrella_0.8.0-1_amd64.deb; fi
# Install API Umbrella package
- sudo dpkg -i ci_cache/api-umbrella_0.8.0-1_amd64.deb
# Install the unbound package that's not included with API Umbrella, but
# needed to run tests. But prevent it from automatically starting up after
# install at the system level with the RUNLEVEL=1 variable.
- sudo apt-get update
- sudo env RUNLEVEL=1 apt-get install unbound
# Use the mongo-orchestration library for providing a testable replicaset,
# so we can see how the stack reacts to replicaset re-elections, etc.
- sudo pip install mongo-orchestration==0.3.1
# Ensure the temp directory is world-writable, since our tests don't run as
# the api-umbrella this is normally configured to be writable by.
- sudo chmod -R 777 /opt/api-umbrella/embedded/apps/web/shared/tmp
# FIXME: Temporary workaround for failing integration web tests in the API
# Umbrella v0.8.0 packages. Remove after next package upgrade. See:
# https://github.com/NREL/api-umbrella-web/commit/4773da852068713a15d1668d55c6f7e0e681c6f6
- sudo curl -o /opt/api-umbrella/embedded/apps/web/current/config/environments/test.rb "https://raw.githubusercontent.com/NREL/api-umbrella-web/4773da852068713a15d1668d55c6f7e0e681c6f6/config/environments/test.rb"
# If the tests fail, it seems like sometimes the server processes don't
# exist cleanly, and then stick around on the CI server causing issues for
# subsequent tests. We should try to figure out how we can ensure we always
# cleanup on test failures, but in the mean-time, we'll just try to cleanup
# any processes potentially hanging around before running the tests again
# (not deal, I know).
- killall --user $USER --wait grunt || true
- killall --user $USER --wait supervisord || true
override:
- env PATH=/opt/api-umbrella/embedded/bin:$PATH npm install
test:
override:
- env PATH=/opt/api-umbrella/embedded/bin:$PATH ./node_modules/.bin/grunt