Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 437 lines (303 sloc) 16.442 kb
63c1a0f @raydavis CalCentral-Rails start
raydavis authored
1 #CalCentral
2
72971cd @christianv CLC-4527 - Upgrade JSCS to 1.8
christianv authored
3 [![Dependency Status](https://img.shields.io/gemnasium/ets-berkeley-edu/calcentral.svg)](https://gemnasium.com/ets-berkeley-edu/calcentral) [![devDependency Status](https://david-dm.org/ets-berkeley-edu/calcentral/dev-status.svg)](https://david-dm.org/ets-berkeley-edu/calcentral#info=devDependencies) [![Code Climate](https://img.shields.io/codeclimate/github/ets-berkeley-edu/calcentral.svg)](https://codeclimate.com/github/ets-berkeley-edu/calcentral)
3c0805f @christianv NOJIRA - Use SVG for badges in README
christianv authored
4 * Master Build: [![Build Status](https://api.travis-ci.org/ets-berkeley-edu/calcentral.svg?branch=master)](https://travis-ci.org/ets-berkeley-edu/calcentral)
5 * QA Build: [![Build Status](https://api.travis-ci.org/ets-berkeley-edu/calcentral.svg?branch=qa)](https://travis-ci.org/ets-berkeley-edu/calcentral)
63c1a0f @raydavis CalCentral-Rails start
raydavis authored
6
7 ## Dependencies
8
9 * [Bundler](http://gembundler.com/rails3.html)
10 * [Git](https://help.github.com/articles/set-up-git)
11 * [JDBC Oracle driver](http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-112010-090769.html)
c8c7071 @ctweney Document our dependency on Java 7
ctweney authored
12 * [Java 7 SDK](http://www.oracle.com/technetwork/java/javase/downloads/index.html)
be81681 @yuhunglin [NOJIRA] Readme updates for installation instructions, running jasmin…
yuhunglin authored
13 * [JRuby 1.7.x](http://jruby.org/)
d88c77e @christianv CLC-4735 - Update README
christianv authored
14 * [Node.js >=0.10.30](http://nodejs.org/)
63c1a0f @raydavis CalCentral-Rails start
raydavis authored
15 * [PostgreSQL](http://www.postgresql.org/)
be81681 @yuhunglin [NOJIRA] Readme updates for installation instructions, running jasmin…
yuhunglin authored
16 * [Rails 3.2.x](http://rubyonrails.org/download)
63c1a0f @raydavis CalCentral-Rails start
raydavis authored
17 * [Rubygems](http://rubyforge.org/frs/?group_id=126)
18 * [Rvm](https://rvm.io/rvm/install/) - Ruby version managers
1d14556 @christianv CLC-3201 - Fix README
christianv authored
19 * [xvfb](http://xquartz.macosforge.org/landing/) - xvfb headless browser, included for Macs with XQuartz
63c1a0f @raydavis CalCentral-Rails start
raydavis authored
20
21 ## Installation
22
2bb26dc @richcreationsrc [NOJIRA] - update resume
richcreationsrc authored
23 1. Install Java 7 JDK:
8b04c07 @christianv NOJIRA - Update README
christianv authored
24 http://www.oracle.com/technetwork/java/javase/downloads/index.html
25
1d14556 @christianv CLC-3201 - Fix README
christianv authored
26 1. Install postgres:
be81681 @yuhunglin [NOJIRA] Readme updates for installation instructions, running jasmin…
yuhunglin authored
27
2bb26dc @richcreationsrc [NOJIRA] - update resume
richcreationsrc authored
28 **Note**: To install postgres, you must first install homebrew.
29
30 Install homebrew with the following command:
31 ```bash
02c81da @paulkerschen NOJIRA Fixes and updates for README
paulkerschen authored
32 ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2bb26dc @richcreationsrc [NOJIRA] - update resume
richcreationsrc authored
33 ```
34 Run the following command in terminal after installation:
35 ```bash
36 brew --version
37 ```
38
39 Then run the following:
1d14556 @christianv CLC-3201 - Fix README
christianv authored
40 ```bash
41 brew update
42 brew install postgresql
43 initdb /usr/local/var/postgres
44 ```
695168a @ctweney NOJIRA Update doc with postgres and X fixes for Mtn Lion
ctweney authored
45
1d14556 @christianv CLC-3201 - Fix README
christianv authored
46 1. __For Mountain Lion & Mavericks users ONLY:__ [Fix Postgres paths](http://nextmarvel.net/blog/2011/09/brew-install-postgresql-on-os-x-lion/).
63c1a0f @raydavis CalCentral-Rails start
raydavis authored
47
1d14556 @christianv CLC-3201 - Fix README
christianv authored
48 1. __For Mountain Lion & Mavericks users ONLY:__ If you can connect to Postgres via psql, but not via JDBC (you see "Connection refused" errors in the CalCentral app log), then edit `/usr/local/var/postgres/pg_hba.conf` and make sure you have these lines:
49
50 ```
51 host all all 127.0.0.1/32 md5
52 host all all samehost md5
53 ```
54
55 1. __For Mountain Lion & Mavericks users ONLY:__ [Install XQuartz](http://xquartz.macosforge.org/landing/) and make sure that /opt/X11/bin is on your `PATH`.
56
57 1. Start postgres, add users and create the necessary databases. (If your PostgreSQL server is managed externally, you'll probably need to create a schema that matches the database username. See [CLC-893](https://jira.media.berkeley.edu/jira/browse/CLC-893) for details.):
58
59 ```bash
60 pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
61 psql postgres
62 create database calcentral_development;
f594622 @NolanChan Modified Postgres instructions in response to errors I experienced
NolanChan authored
63 create user calcentral_development with password 'secret' createdb;
1d14556 @christianv CLC-3201 - Fix README
christianv authored
64 grant all privileges on database calcentral_development to calcentral_development;
f594622 @NolanChan Modified Postgres instructions in response to errors I experienced
NolanChan authored
65 alter database calcentral_development owner to calcentral_development;
1d14556 @christianv CLC-3201 - Fix README
christianv authored
66 create database calcentral;
f594622 @NolanChan Modified Postgres instructions in response to errors I experienced
NolanChan authored
67 create user calcentral with password 'secret' createdb;
1d14556 @christianv CLC-3201 - Fix README
christianv authored
68 grant all privileges on database calcentral to calcentral;
f594622 @NolanChan Modified Postgres instructions in response to errors I experienced
NolanChan authored
69 alter database calcentral owner to calcentral;
1d14556 @christianv CLC-3201 - Fix README
christianv authored
70 create database calcentral_test;
f594622 @NolanChan Modified Postgres instructions in response to errors I experienced
NolanChan authored
71 create user calcentral_test with password 'secret' createdb;
1d14556 @christianv CLC-3201 - Fix README
christianv authored
72 grant all privileges on database calcentral_test to calcentral_test;
f594622 @NolanChan Modified Postgres instructions in response to errors I experienced
NolanChan authored
73 alter database calcentral_test owner to calcentral_test;
1d14556 @christianv CLC-3201 - Fix README
christianv authored
74 ```
63c1a0f @raydavis CalCentral-Rails start
raydavis authored
75
2bb26dc @richcreationsrc [NOJIRA] - update resume
richcreationsrc authored
76 **Note**: At this point, exit out of postgres. To do this, type "\q" and then press ENTER.
77
98acd7f @ctweney NOJIRA fix numbering
ctweney authored
78 1. Fork this repository, then:
63c1a0f @raydavis CalCentral-Rails start
raydavis authored
79
1d14556 @christianv CLC-3201 - Fix README
christianv authored
80 ```bash
81 git clone git@github.com:[your GitHub Account]/calcentral.git
82 # e.g. git clone git@github.com:christianv/calcentral.git
83 ```
63c1a0f @raydavis CalCentral-Rails start
raydavis authored
84
1d14556 @christianv CLC-3201 - Fix README
christianv authored
85 1. Go inside the `calcentral` repository:
86
87 ```bash
88 cd calcentral
89 # Answer "yes" if it asks you to trust a new .rvmrc file.
90 ```
91
92 1. Install JRuby:
93
94 ```bash
95 rvm get head
76acaf9 @ctweney CLC-5116 Update JRuby in some more places
ctweney authored
96 rvm install jruby-1.7.19
1d14556 @christianv CLC-3201 - Fix README
christianv authored
97 cd ..
98 cd calcentral
99 # Answer "yes" again if it asks you to trust a new .rvmrc file.
8b04c07 @christianv NOJIRA - Update README
christianv authored
100 rvm list
101 # Make sure that everything looks fine
102 # If it mentions "broken", you'll need to reinstall
1d14556 @christianv CLC-3201 - Fix README
christianv authored
103 ```
63c1a0f @raydavis CalCentral-Rails start
raydavis authored
104
a478c86 @raydavis NOJIRA Modify recommended JRUBY_OPTS for developers
raydavis authored
105 1. Make JRuby faster for local development by running this or put in your .bashrc:
56036c0 @ctweney NOJIRA Doc formatting tweak
ctweney authored
106
1d14556 @christianv CLC-3201 - Fix README
christianv authored
107 ``` bash
a478c86 @raydavis NOJIRA Modify recommended JRUBY_OPTS for developers
raydavis authored
108 export JRUBY_OPTS="--dev"
1d14556 @christianv CLC-3201 - Fix README
christianv authored
109 ```
441d3e9 @ctweney NOJIRA Document our xvfb requirement
ctweney authored
110
1d14556 @christianv CLC-3201 - Fix README
christianv authored
111 1. Download and install xvfb. On a Mac, you get xvfb by [installing XQuartz](http://xquartz.macosforge.org/landing/).
112
113 1. Download the appropriate gems with [Bundler](http://gembundler.com/rails3.html):
114
115 ```bash
116 bundle install
117 ```
63c1a0f @raydavis CalCentral-Rails start
raydavis authored
118
98acd7f @ctweney NOJIRA fix numbering
ctweney authored
119 1. Set up a local settings directory:
1d14556 @christianv CLC-3201 - Fix README
christianv authored
120
121 ```bash
122 mkdir ~/.calcentral_config
123 ```
124
125 Default settings are loaded from your source code in `config/settings.yml` and `config/settings/ENVIRONMENT_NAME.yml`. For example, the configuration used when running tests with `RAILS_ENV=test` is determined by the combination of `config/settings/test.yml` and `config/settings.yml`.
126 Because we don't store passwords and other sensitive data in source code, any RAILS_ENV other than `test` requires overriding some default settings.
e5bd298 @richcreationsrc [NOJIRA] - Updated README Step 10
richcreationsrc authored
127 Do this by creating `ENVIRONMENT.local.yml` files in your `~/.calcentral_config` directory. For example, your `~/.calcentral_config/development.local.yml` file may include access tokens and URLs for a locally running Canvas server.
1d14556 @christianv CLC-3201 - Fix README
christianv authored
128 You can also create Ruby configuration files like "settings.local.rb" and "development.local.rb" to amend the standard `config/environments/*.rb` files.
63c1a0f @raydavis CalCentral-Rails start
raydavis authored
129
98acd7f @ctweney NOJIRA fix numbering
ctweney authored
130 1. Install JDBC driver (for Oracle connection)
76c9afe @ctweney CLC-2908 Back to 1.4.2 of activerecord-oracle adapter; update doc for…
ctweney authored
131 * Download [ojdbc6.jar](http://svn.media.berkeley.edu/nexus/content/repositories/myberkeley/com/oracle/ojdbc6/11.2.0.3/ojdbc6-11.2.0.3.jar)
2bb26dc @richcreationsrc [NOJIRA] - update resume
richcreationsrc authored
132 * Note: You do not have to open the file.
8b04c07 @christianv NOJIRA - Update README
christianv authored
133 * Rename the file to `ojdbc6.jar`
134 * Copy `ojdbc6.jar` to `calcentral/lib`
63c1a0f @raydavis CalCentral-Rails start
raydavis authored
135
1d14556 @christianv CLC-3201 - Fix README
christianv authored
136 1. Initialize PostgreSQL database tables:
63c1a0f @raydavis CalCentral-Rails start
raydavis authored
137
1d14556 @christianv CLC-3201 - Fix README
christianv authored
138 ```bash
139 rake db:schema:load db:seed
140 ```
581b471 @ctweney CLC-2921 Rake task to make superusers
ctweney authored
141
1d14556 @christianv CLC-3201 - Fix README
christianv authored
142 1. Make yourself powerful:
143
144 ```bash
145 rake superuser:create UID=[your numeric CalNet UID]
146 # e.g. rake superuser:create UID=61889
147 ```
148
d88c77e @christianv CLC-4735 - Update README
christianv authored
149 1. Install the frond-end tools
150
151 ```bash
152 npm install
153 npm install -g gulp
154 ```
155
156 1. Start the front-end build & watch for changes
157
158 ```bash
159 gulp build
160 ```
161
1d14556 @christianv CLC-3201 - Fix README
christianv authored
162 1. Start the server:
163
164 ```bash
165 rails s
166 ```
5509e61 @ctweney CLC-2055 Use TorqueBox instead of Trinidad.
ctweney authored
167
98acd7f @ctweney NOJIRA fix numbering
ctweney authored
168 1. Access your development server at [localhost:3000](http://localhost:3000/).
03bee58 @shacker NOJIRA: Add localhost note to readme
shacker authored
169 Do not use 127.0.0.1:3000, as you will not be able to grant access to bApps.
170
8b04c07 @christianv NOJIRA - Update README
christianv authored
171 **Note**: Usually you won't have to do any of the following steps when you're developing on CalCentral.
172
1cd2b51 @christianv CLC-2513 - Front-end: implement polling for new data
christianv authored
173 ## Enable live updates
174
175 In order to have live updates you'll need to perform the following steps:
176
1d14556 @christianv CLC-3201 - Fix README
christianv authored
177 1. Install and run [memcached](http://memcached.org/).
19bb93f @ctweney Fix whitespace in readme
ctweney authored
178
1d14556 @christianv CLC-3201 - Fix README
christianv authored
179 1. Add the following lines to development.local.yml:
180
181 ```yml
182 cache:
183 store: "memcached"
184 ```
9bc95a3 @ctweney Try to get live update doc formatting right
ctweney authored
185
96bcf52 @ctweney CLC-3197 Update readme
ctweney authored
186 1. Start the server with TorqueBox (see below).
1cd2b51 @christianv CLC-2513 - Front-end: implement polling for new data
christianv authored
187
32f8fd6 @ctweney CLC-2657 Document spork usage
ctweney authored
188 ## Back-end Testing
189
1d14556 @christianv CLC-3201 - Fix README
christianv authored
190 Back-end (rspec) tests live in `spec/*`.
32f8fd6 @ctweney CLC-2657 Document spork usage
ctweney authored
191
192 To run the tests from the command line:
1d14556 @christianv CLC-3201 - Fix README
christianv authored
193
194 ```bash
32f8fd6 @ctweney CLC-2657 Document spork usage
ctweney authored
195 rspec
196 ```
197
198 To run the tests faster, use spork, which is a little server that keeps the Rails app initialized while you change code
199 and run multiple tests against it. Command line:
1d14556 @christianv CLC-3201 - Fix README
christianv authored
200
201 ```bash
202 spork
203 # (...wait a minute for startup...)
32f8fd6 @ctweney CLC-2657 Document spork usage
ctweney authored
204 rspec --drb spec/lib/my_spec.rb
205 ```
206
207 You can even run Spork right inside [IntelliJ RubyMine or IDEA](http://www.jetbrains.com/ruby/webhelp/using-drb-server.html).
208
4602041 @christianv CLC-3008 - Build is failing due to Jasmine timeout error
christianv authored
209 ## Front-end Linting
63c1a0f @raydavis CalCentral-Rails start
raydavis authored
210
c3a9bb2 @christianv CLC-3472: Add jscs - JavaScript Style Checker
christianv authored
211 Front-end linting can be done by running the following commands:
be81681 @yuhunglin [NOJIRA] Readme updates for installation instructions, running jasmin…
yuhunglin authored
212
1d14556 @christianv CLC-3201 - Fix README
christianv authored
213 ```bash
a914334 @raydavis NOJIRA Explain how to install jshint and jscs
raydavis authored
214 rm -rf node_modules
215 npm install -g jshint
216 npm install -g jscs
d88c77e @christianv CLC-4735 - Update README
christianv authored
217 gulp build
4602041 @christianv CLC-3008 - Build is failing due to Jasmine timeout error
christianv authored
218 jshint .
c3a9bb2 @christianv CLC-3472: Add jscs - JavaScript Style Checker
christianv authored
219 jscs .
4602041 @christianv CLC-3008 - Build is failing due to Jasmine timeout error
christianv authored
220 ```
221
222 This will check for any potential JavaScript issues and whether you formatted the code correctly.
63c1a0f @raydavis CalCentral-Rails start
raydavis authored
223
8e02b26 @shacker NOJIRA: Update readme to cover role-aware testing
shacker authored
224 ## Role-Aware Testing
225
1d14556 @christianv CLC-3201 - Fix README
christianv authored
226 Some features of CalCentral are only accessible to users with particular roles, such as `student`.
8e02b26 @shacker NOJIRA: Update readme to cover role-aware testing
shacker authored
227 These features may be invisible when logged in as yourself. In particular:
228
1d14556 @christianv CLC-3201 - Fix README
christianv authored
229 - My Academics will only appear in the navigation if logged in as a student. However, the "Oski Bear" test student does not fake data loaded on dev and QA. To test My Academics, log in as user `test-212385` or `test-212381` (ask a developer for the passwords to these if you need them). Once logged in as a test student, append `/academics` to the URL to access My Academics.
8e02b26 @shacker NOJIRA: Update readme to cover role-aware testing
shacker authored
230
63c1a0f @raydavis CalCentral-Rails start
raydavis authored
231 ## Debugging
232
233 ### Emulating production mode locally
234
1d14556 @christianv CLC-3201 - Fix README
christianv authored
235 1. Make sure you have a separate production database:
236
237 ```bash
238 psql postgres
239 create database calcentral_production;
240 grant all privileges on database calcentral_production to calcentral_development;
241 ```
438c37d @shacker CLC-1483 Update readme for emulating production locally
shacker authored
242
98acd7f @ctweney NOJIRA fix numbering
ctweney authored
243 1. In calcentral_config/production.local.yml, you'll need the following entries:
1d14556 @christianv CLC-3201 - Fix README
christianv authored
244
245 ```yml
246 secret_token: "Some random 30-char string"
247 postgres: [credentials for your separate production db (copy/modify from development.local.yml)]
248 campusdb: [copy from main config/settings.yml, modify if needed]
249 google_proxy: and canvas_proxy: [copy from development.local.yml]
250 application:
251 serve_static_assets: true
252 ```
63c1a0f @raydavis CalCentral-Rails start
raydavis authored
253
98acd7f @ctweney NOJIRA fix numbering
ctweney authored
254 1. Populate the production db by invoking your production settings:
1d14556 @christianv CLC-3201 - Fix README
christianv authored
255
256 ```bash
257 RAILS_ENV="production" rake db:schema:load db:seed
258 ```
63c1a0f @raydavis CalCentral-Rails start
raydavis authored
259
d88c77e @christianv CLC-4735 - Update README
christianv authored
260 1. Precompile the front-end assets
438c37d @shacker CLC-1483 Update readme for emulating production locally
shacker authored
261
1d14556 @christianv CLC-3201 - Fix README
christianv authored
262 ```bash
d88c77e @christianv CLC-4735 - Update README
christianv authored
263 gulp build --env production
1d14556 @christianv CLC-3201 - Fix README
christianv authored
264 ```
265
266 1. Start the server in production mode:
267
268 ```bash
269 rails s -e production
270 ```
63c1a0f @raydavis CalCentral-Rails start
raydavis authored
271
98acd7f @ctweney NOJIRA fix numbering
ctweney authored
272 1. If you're not able to connect to Google or Canvas, export the data in the oauth2 from your development db and import them into the same table in your production db.
438c37d @shacker CLC-1483 Update readme for emulating production locally
shacker authored
273
d88c77e @christianv CLC-4735 - Update README
christianv authored
274 1. After testing, remove the static assets:
1d14556 @christianv CLC-3201 - Fix README
christianv authored
275
276 ```bash
d88c77e @christianv CLC-4735 - Update README
christianv authored
277 gulp build-clean
1d14556 @christianv CLC-3201 - Fix README
christianv authored
278 ```
63c1a0f @raydavis CalCentral-Rails start
raydavis authored
279
d25741e @christianv NOJIRA - Update documentation
christianv authored
280 ### Start the server with TorqueBox
281
282 In production we use [TorqueBox](http://torquebox.org/) as this provides us with messaging, scheduling, caching, and daemons.
283
1d14556 @christianv CLC-3201 - Fix README
christianv authored
284 1. Deploy into TorqueBox (only needs to happen once in a while):
d25741e @christianv NOJIRA - Update documentation
christianv authored
285
1d14556 @christianv CLC-3201 - Fix README
christianv authored
286 ```bash
287 bundle exec torquebox deploy .
288 ```
289
290 1. Start the server:
291
292 ```bash
293 bundle exec torquebox run -p=3000
294 ```
d25741e @christianv NOJIRA - Update documentation
christianv authored
295
63c1a0f @raydavis CalCentral-Rails start
raydavis authored
296 ### Test connection
297
1d14556 @christianv CLC-3201 - Fix README
christianv authored
298 Make sure you are on the Berkeley network or connected through [preconfigured VPN](https://kb.berkeley.edu/page.php?id=23065) for the Oracle connection.
299 If you use VPN, use group `1-Campus_VPN`.
63c1a0f @raydavis CalCentral-Rails start
raydavis authored
300
d25741e @christianv NOJIRA - Update documentation
christianv authored
301 ### Enable basic authentication
302
303 Basic authentication will enable you to log in without using CAS.
304 This is necessary when your application can't be CAS authenticated or when you're testing mobile browsers.
1d14556 @christianv CLC-3201 - Fix README
christianv authored
305 **Note**: only enable this in fake mode or in development.
d25741e @christianv NOJIRA - Update documentation
christianv authored
306
1d14556 @christianv CLC-3201 - Fix README
christianv authored
307 1. Add the following setting to your `environment.yml` file (e.g. `development.yml`):
308
309 ```bash
310 developer_auth:
02c81da @paulkerschen NOJIRA Fixes and updates for README
paulkerschen authored
311 enabled: true
1d14556 @christianv CLC-3201 - Fix README
christianv authored
312 password: topsecret!
313 ```
d25741e @christianv NOJIRA - Update documentation
christianv authored
314
98acd7f @ctweney NOJIRA fix numbering
ctweney authored
315 1. (re)start the server for the changes to take effect.
d25741e @christianv NOJIRA - Update documentation
christianv authored
316
98acd7f @ctweney NOJIRA fix numbering
ctweney authored
317 1. Click on the footer (Berkeley logo) when you load the page.
d25741e @christianv NOJIRA - Update documentation
christianv authored
318
1d14556 @christianv CLC-3201 - Fix README
christianv authored
319 1. You should be seeing the [Basic Auth screen](http://cl.ly/SA6C). As the login you should use a UID (e.g. `61889` for oski) and then the password from the settings file.
6d0ec59 @shacker nojira: Document "Act As" in readme
shacker authored
320
321 ### "Act As" another user
322
323 To help another user debug an issue, you can "become" them on CalCentral. To assume the identity of another user, you must:
324
325 - Currently be logged in as a designated superuser
326 - Be accessing a machine/server which the other user has previously logged into (e.g. from localhost, you can't act as a random student, since that student has probably never logged in at your terminal)
1d14556 @christianv CLC-3201 - Fix README
christianv authored
327 - Have enabled `act_as` in `settings.yml` (`features:`)
6d0ec59 @shacker nojira: Document "Act As" in readme
shacker authored
328
329 Access the URL:
330
331 ```
332 https://[hostname]/act_as?uid=123456
333 ```
334
335 where 123456 is the UID of the user to emulate.
336
1d14556 @christianv CLC-3201 - Fix README
christianv authored
337 **Note**: The Act As feature will only reveal data from data sources we control, e.g. Canvas. Google data will be completely suppressed, __EXCEPT__ for test users. The following user uids have been configured as test users.
81da438 @yuhunglin [CLC-1398] Readme update for clarification on Google access exception…
yuhunglin authored
338 * 11002820 - "Tammi Chang"
339 * 61889 - "Oski Bear"
1d14556 @christianv CLC-3201 - Fix README
christianv authored
340 * All IDs listed on the [Universal Calnet Test IDs](https://wikihub.berkeley.edu/display/calnet/Universal+Test+IDs) page
6d0ec59 @shacker nojira: Document "Act As" in readme
shacker authored
341
1d14556 @christianv CLC-3201 - Fix README
christianv authored
342 To become yourself again, access:
429e30a @shacker nojira: Add stop_act_as to readme
shacker authored
343
344 ```
345 https://[hostname]/stop_act_as
346 ```
6d0ec59 @shacker nojira: Document "Act As" in readme
shacker authored
347
3228f08 @raydavis CLC-2088 Document command-line control of logging
raydavis authored
348 ### Logging
349
350 Logging behavior and destination can be controlled from the command line or shell scripts via env variables:
351
352 * `LOGGER_STDOUT=false` - Only log to the default files
353 * `LOGGER_STDOUT=true` - Log to standard output as well as the default files
354 * `LOGGER_STDOUT=only` - Only log to standard output
355 * `LOGGER_LEVEL=DEBUG` - Set logging level; acceptable values are 'FATAL', 'ERROR', 'WARN', 'INFO', and 'DEBUG'
356
63c1a0f @raydavis CalCentral-Rails start
raydavis authored
357 ### Tips
358
359 1. On Mac OS X, to get RubyMine to pick up the necessary environment variables, open a new shell, set the environment variables, and:
360
1d14556 @christianv CLC-3201 - Fix README
christianv authored
361 ```bash
362 /Applications/RubyMine.app/Contents/MacOS/rubymine &
363 ```
63c1a0f @raydavis CalCentral-Rails start
raydavis authored
364
1d14556 @christianv CLC-3201 - Fix README
christianv authored
365 1. If you want to explore the Oracle database on Mac OS X, use [SQL Developer](http://www.oracle.com/technetwork/developer-tools/sql-developer/overview/index.html).
341c14d @christianv [NOJIRA] Update readme with sourcemap support
christianv authored
366
63c1a0f @raydavis CalCentral-Rails start
raydavis authored
367 ### Styleguide
368
1d14556 @christianv CLC-3201 - Fix README
christianv authored
369 See [docs/styleguide.md](docs/styleguide.md).
63c1a0f @raydavis CalCentral-Rails start
raydavis authored
370
69fe48f @ctweney CLC-823 Document how to timeshift data feeds
ctweney authored
371 ## Recording fake data feeds and timeshifting them
63c1a0f @raydavis CalCentral-Rails start
raydavis authored
372
1d14556 @christianv CLC-3201 - Fix README
christianv authored
373 Make sure your testext.local.yml file has real connections to real external services that are fakeable (Canvas, Google, etc). Now do:
63c1a0f @raydavis CalCentral-Rails start
raydavis authored
374
375 ```bash
69fe48f @ctweney CLC-823 Document how to timeshift data feeds
ctweney authored
376 rake vcr:record
377 rake vcr:prettify
63c1a0f @raydavis CalCentral-Rails start
raydavis authored
378 ```
fe43631 @yuhunglin [CLC-506] Gemfile updates, rspec config fixes, database settings upda…
yuhunglin authored
379
1d14556 @christianv CLC-3201 - Fix README
christianv authored
380 * `vcr:record` can also take a `SPEC=".../my_favorite_spec.rb"` to help limit the recordings.
381 * `vcr:prettify` can also take a `REGEX_FILTER="my_raw_recording.json"` to target a specific raw file.
a9ef20b @yuhunglin [NOJIRA] Rake vcr enhancements
yuhunglin authored
382
1d14556 @christianv CLC-3201 - Fix README
christianv authored
383 You can now find the prettified files in `fixtures/pretty_vcr_recordings`. You can edit these files to put in tokens that will be substituted on server startup. See `config/initializers/timeshift.rb` for the dictionary of substitutions. Edit the `debug_json` property of each response, and `timeshift.rb` will automatically convert `debug_json` to the format actually used by VCR.
69fe48f @ctweney CLC-823 Document how to timeshift data feeds
ctweney authored
384
fe43631 @yuhunglin [CLC-506] Gemfile updates, rspec config fixes, database settings upda…
yuhunglin authored
385 ## Rake tasks:
386
1d14556 @christianv CLC-3201 - Fix README
christianv authored
387 To view other rake task for the project: `rake -T`
fe43631 @yuhunglin [CLC-506] Gemfile updates, rspec config fixes, database settings upda…
yuhunglin authored
388
1d14556 @christianv CLC-3201 - Fix README
christianv authored
389 * `rake spec:xml` - Runs rake spec, but pipes the output to xml using the `rspec_junit_formatter` gem, for JUnit compatible test result reports
390 * `rake vcr:record` - Refresh vcr recordings and reformats the fixtures with formatted JSON output. Will also parse the reponse body's string into json output for legibility.
391 * `rake vcr:list` - List the available recordings captured in the fixtures.
46f7cde @shacker nojira: Describe usage of feature toggle in the readme
shacker authored
392
167c6b6 @yuhunglin [CLC-1539] Readme documentation for memcached statistics rake tasks
yuhunglin authored
393 ## Memcached tasks:
394
395 A few rake tasks to help monitor statistics and more:
396
1d14556 @christianv CLC-3201 - Fix README
christianv authored
397 * `rake memcached:clear_stats` - Reset memcached stats from all cluster nodes.
398 * `rake memcached:empty` - Invalidate all memcached keys from all cluster nodes.
399 * `rake memcached:get_stats` - Fetch memcached stats from all cluster nodes.
167c6b6 @yuhunglin [CLC-1539] Readme documentation for memcached statistics rake tasks
yuhunglin authored
400
1d14556 @christianv CLC-3201 - Fix README
christianv authored
401
402 * Generally, if you `rake memcached:empty` (__WARNING:__ do not run on the production cluster unless you know what you're doing), you should follow with an `rake memcached:clear_stats`.
403 * All three task take the optional param of `hosts`. So, if say you weren't running these tasks on the cluster layers themselves, or only wanted to tinker with a certain subset of clusters: `rake memcached:get_stats hosts="localhost:11212,localhost:11213,localhost:11214"`
167c6b6 @yuhunglin [CLC-1539] Readme documentation for memcached statistics rake tasks
yuhunglin authored
404
46f7cde @shacker nojira: Describe usage of feature toggle in the readme
shacker authored
405 ## Using the feature toggle:
406
1d14556 @christianv CLC-3201 - Fix README
christianv authored
407 To selectively enable/disable a feature, add a property to the `features` section of settings.yml, e.g.:
46f7cde @shacker nojira: Describe usage of feature toggle in the readme
shacker authored
408
1d14556 @christianv CLC-3201 - Fix README
christianv authored
409 ```yml
46f7cde @shacker nojira: Describe usage of feature toggle in the readme
shacker authored
410 features:
411 wizbang: false
412 neato: true
413 ```
414
0d9d98c @christianv CLC-3332 - Replace ngShow with ngIf whenever possible
christianv authored
415 After server restart, these properties will appear in each users' status feed. You can now use `data-ng-if` in Angular to wrap the feature:
46f7cde @shacker nojira: Describe usage of feature toggle in the readme
shacker authored
416
417 ```html
0d9d98c @christianv CLC-3332 - Replace ngShow with ngIf whenever possible
christianv authored
418 <div data-ng-if="user.profile.features.neato">
46f7cde @shacker nojira: Describe usage of feature toggle in the readme
shacker authored
419 Some neato feature...
420 </div>
421 ```
1d14556 @christianv CLC-3201 - Fix README
christianv authored
422
0198ef9 @ctweney CLC-1643 Add seed data for developer machines, plus procedure for upd…
ctweney authored
423 ## Keeping developer seed data updated
424
1d14556 @christianv CLC-3201 - Fix README
christianv authored
425 `seeds.rb` is intended for use only on developer machines, so they have a semi-realistic copy of production lists of
426 superusers, links, etc. `./db/developer-seed-data.sql` has the data used by `rake db:seed`. Occasionally we'll want to
0198ef9 @ctweney CLC-1643 Add seed data for developer machines, plus procedure for upd…
ctweney authored
427 update it from production. To do that, log into a prod node and do:
1d14556 @christianv CLC-3201 - Fix README
christianv authored
428
429 ```bash
d39f99c @ctweney CLC-3692 Improve dev dump procedure
ctweney authored
430 pg_dump calcentral -O -x --inserts --clean -f developer-seed-data.sql -t link_categories \
0198ef9 @ctweney CLC-1643 Add seed data for developer machines, plus procedure for upd…
ctweney authored
431 -t link_categories_link_sections -t link_sections -t link_sections_links -t links \
746f5c3 @raydavis NOJIRA Missing a new DB table in the "developer seed data" section
raydavis authored
432 -t links_user_roles -t user_auths -t user_roles -t fin_aid_years -t summer_sub_terms \
0198ef9 @ctweney CLC-1643 Add seed data for developer machines, plus procedure for upd…
ctweney authored
433 -h postgres-hostname -p postgres-port-number -U calcentral
434 ```
435
d39f99c @ctweney CLC-3692 Improve dev dump procedure
ctweney authored
436 Copy the file into your source tree and get it merged into master.
Something went wrong with that request. Please try again.