Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temporary PR for testing test-bench deployment #300

Open
wants to merge 254 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
254 commits
Select commit Hold shift + click to select a range
3288b05
Added SidePane to house the screenshot window in.
Oct 15, 2015
ea26949
Django models for tests & screenshots
Oct 19, 2015
c7da37c
Screenshots and tests APIs with django test
Oct 20, 2015
8a4c698
Merge branch 'master' into feature/test-bench
Oct 22, 2015
b44157b
Connect test-screenshot UI to real API.
Oct 22, 2015
b480fa5
Added test file support.
Oct 23, 2015
db6c63f
Backend and tests for Monkey Test Manager API
Oct 30, 2015
a53e134
Added React to the project
Nov 3, 2015
095cfe4
React.JS interface
Nov 4, 2015
51524a3
Added Matthew's Style Improvements & sub-navigation
Nov 12, 2015
73c1a57
Rewrote screenshot manager using React.JS.
Nov 13, 2015
3ffbcfc
Changes to support tests.
Nov 19, 2015
379f496
Added travis file for django tests
Nov 19, 2015
3bf0cc7
Screenshots from emulator
Nov 20, 2015
c1f5432
Filetype validation & UI updates
Nov 24, 2015
fdbc598
Merge branch 'master' into feature/test-bench
Nov 25, 2015
1197009
Download pebble-test and setup pip repo
Nov 30, 2015
d85e34a
Added functions for archiving and downloading test files
Dec 2, 2015
aba3968
Merge branch 'master' into feature/test-bench
Dec 2, 2015
eaf412d
Completed basic support for starting runner.py from CloudPebble
Dec 3, 2015
8b6fd28
Screenshot manager code cleanup
Dec 3, 2015
a4a3636
Add support for test result notification from qemu-controllers
Dec 8, 2015
27fc978
Added screenshot uncorrection
Dec 8, 2015
21f91d9
Fixed test failures/warnings, added screenshot uncorrection test, add…
Dec 8, 2015
37736a6
Merge branch 'master' into feature/test-bench
Dec 21, 2015
e448c08
Added merged schema migration
Dec 21, 2015
a8967f5
Typo fix
Dec 21, 2015
ea2b123
Roll back SDK version
Dec 21, 2015
2c807ba
Various cleanup and small fixes.
Dec 23, 2015
a940223
Navigate to test after startig one.
Dec 24, 2015
e001079
WIP live test logs
Dec 24, 2015
6a41c39
Correctly show the status of live test logs.
Jan 6, 2016
5a8a9b8
Removed test.date_started fields and celery test task
Jan 9, 2016
59b25bf
Merge branch 'master' into feature/test-bench
Jan 12, 2016
97e9d68
Added autocomplete support for CloudPebble's MonkeyScript
Jan 14, 2016
e6ae211
Major refactor & Support for PBW in test bundles
Jan 14, 2016
57f179d
Back to SDK 3.8.1
Jan 15, 2016
3587759
Merge branch 'master' into feature/test-bench
Jan 15, 2016
22d9ed4
MonkeyScript autocomplete tweaks
Jan 15, 2016
3cc13e9
Mostly implemented cloudpebble=>orchestrator support
Jan 15, 2016
15f6a12
Basic working orchestrator support
Jan 20, 2016
48bd118
Store and show test test kind (cloudpebble vs orchestrator)
Jan 20, 2016
e3cd6c1
Added MonkeyEditor => TestManager navigation button
Jan 20, 2016
c7bbee2
Show annotated/interactive log output in CloudPebble TA for batch tests
Jan 27, 2016
db3f599
Comments and code adjustments
Jan 27, 2016
55db94d
Upgrade to Django 1.9.1
Jan 28, 2016
009d320
Updated bootstrap/procfile/post_compile configuration
Jan 28, 2016
b1a0e8c
Renamed 'auth' app to 'site_auth' to fix app name conflict.
Jan 28, 2016
f24a2ef
Use 'celery worker -A cloudpebble' in Procfile
Jan 28, 2016
ee4480f
Fixied some errors and updated some requirements.
Jan 28, 2016
c38c98f
Added django-pipeline support
Feb 2, 2016
4613a5d
Added staticfiles to .gitignore
Feb 3, 2016
b9c6c8f
Merge branch 'master' into feature/django-1.9
Feb 4, 2016
3ac0aaf
Upgrade to Django 1.9.2 & migrate --fake-initial in post_compile
Feb 4, 2016
257f121
Update initial migration with latest changes
Feb 4, 2016
056afe4
Support CSS compression with sourcemaps
Feb 4, 2016
93dc170
Updated DEBUG=False logging to use console.
Feb 4, 2016
a85a7df
Neatened stuff.
Feb 4, 2016
9c02541
Use absolute BASE_DIR and STATIC_ROOT, and uglify-js
Feb 5, 2016
16574fd
Try replacing dj_static with whitenoise
Feb 5, 2016
1724057
Try enabling gzip compression
Feb 5, 2016
ed9bcfe
Set up S3 on first access instead of at module import time.
Feb 9, 2016
69e799e
Merge branch 'feature/django-1.9' into feature/test-bench-pipeline
Feb 9, 2016
c304cf5
Corrected BucketHolder logic.
Feb 9, 2016
86a8538
Merge branch 'feature/django-1.9' into feature/test-bench-pipeline
Feb 9, 2016
a68531b
Ported test-bench migrations to Django-1.9
Feb 9, 2016
c1cb722
Compile .jsx and convert jsx files to use ES5 only.
Feb 9, 2016
e63a02c
Fixed file renaming for tests.
Feb 10, 2016
8ebef1e
Don't tell YCM to create/delete test files.
Feb 10, 2016
68f35bb
Fixed test log display regressions
Feb 11, 2016
c92c91b
Refresh all the right things when a live-test completes.
Feb 16, 2016
660bee6
Remove non-public monkeyscript commands.
Feb 16, 2016
4dcfd30
Support monkey autocompletion for screenshot names.
Feb 16, 2016
febb4da
Use actual test name in injected monkey script metadata + small refactor
Feb 16, 2016
ac1b581
SDK=release/3.9.2
Feb 16, 2016
4e98243
Build/install app before running test.
Feb 17, 2016
6d2ae0a
Cleaned save_screenshots and renamed it to sync_screenshots
Feb 18, 2016
acab8fb
Fixed screenshot panel bugs
Feb 18, 2016
7b10cd7
Support screenshot updates in test notification callbacks.
Feb 18, 2016
b861d8c
Added Run Test On Platform buttons & changes required to make them work.
Feb 19, 2016
4587d9b
Added full support for TA screenshot updates
Feb 19, 2016
a330edf
Correct monkeyscript line comment
Feb 20, 2016
f10b1e3
Accept a 'done' message in test log subscriptions.
Feb 20, 2016
44ccb89
Testmanager improvements:
Feb 22, 2016
19fc411
Added a function to add framing to monkeyfiles in uploaded test bundles
Feb 22, 2016
dfb16ca
Added orchestrator proxy
Feb 23, 2016
1a700c1
Added tests for test framing, + light refactoring
Feb 29, 2016
d412bf9
Made all tests pass
Feb 29, 2016
004ee43
Added a notification callback mechanism for the orchestrator proxy.
Mar 2, 2016
9a6560f
Use user's email address in job name.
Mar 2, 2016
5f9a66c
Reset QEMU before each test and uninstall the user's app afterwards.
Mar 3, 2016
c919ef3
Only show test screenshots for platforms which an app is actually bui…
Mar 3, 2016
9386554
Updated monkeyscipt-framing test
Mar 3, 2016
23a1a52
Fixed 'show test in testmanager' button and gave it an icon.
Mar 3, 2016
e87c655
Added 'view test source' buttons, adjusted some test-manager layouts.
Mar 3, 2016
c8d6e08
Show all platforms in screenshot manager when a project has never bee…
Mar 3, 2016
e5fef7e
Track updated django-pipeline
Mar 3, 2016
35e731e
Fixed monkeyscript autocomplete and changed "View Source" to "Edit"
Mar 3, 2016
58df5bb
Fixed artefact URL typos.
Mar 4, 2016
415cd7e
Handle getPebble errors correctly in screenshot-manager take-screensh…
Mar 4, 2016
c319ff1
Update tet_get_test_info to allow log files.
Mar 4, 2016
506771a
Error handling improvements:
Mar 4, 2016
18fb6ab
Disable the screenshot manager "take screenshot" buttons while Pebble…
Mar 4, 2016
c964f77
Disabled the "Batch Run" button while a test is being posted
Mar 4, 2016
f7aef02
Newly added jobs in test-manager now flash green.
Mar 5, 2016
6657937
Added status column for jobs
Mar 8, 2016
f9e5765
Don't install before QEMU test and handle various error cases better.
Mar 8, 2016
4c588f7
Parse monkeyscript screenshot names more strictly
Mar 8, 2016
9f7ce64
Introduce test bundle checker override setting to make tests pass again.
Mar 8, 2016
2b8db7d
Sort platforms alphabetically in screenshot manager view.
Mar 8, 2016
a234a14
Correctly handle errors in CloudPebble.Ajax, and use it in more places.
Mar 8, 2016
d8d3aff
Replace test "Run/Update" buttons with new modal-dialog interface
Mar 9, 2016
60c9e25
Small code cleanup
Mar 9, 2016
35b361d
Add support for multiple platforms to TA-on-Orchestrator
Mar 9, 2016
91500b2
Added Last-Modified support to the api/monkey.py APIs, and fixed some…
Mar 10, 2016
9ccfae3
Made testmanage hyperlinks blue and removed redundant links
Mar 11, 2016
5b2fa48
Improved AJAX error handling.
Mar 11, 2016
a65aa68
Don't blueify testmanager .btn links
Mar 11, 2016
d6bffe5
typo fix
Mar 11, 2016
9d3875e
Correct cache settings for "last-modified"-enabled monkey API calls.
Mar 11, 2016
2c9db30
Cleanup, and reverted get_test_run deletion
Mar 11, 2016
9958c07
default QEMU_LAUNCH_TIMEOUT=20
Mar 11, 2016
c8ce2d7
typo fix
Mar 11, 2016
23d89d9
QEMU test prompt to defaults to a built platform and shows an errors …
Mar 12, 2016
e1ca70c
Merge branch 'master' into feature/test-bench-pipeline
Mar 17, 2016
5f7ae21
Merge branch 'feature/modern-promises' into feature/test-bench-pipeline
Mar 18, 2016
cad3e35
Merge branch 'feature/modern-promises' into feature/test-bench-pipeline
Mar 18, 2016
2b71aad
Fixed various omissions from Promises update.
Mar 22, 2016
29403f8
Merge branch 'feature/modern-promises' into feature/test-bench-pipeline
Mar 22, 2016
01f51b1
More New Promises logic fixes
Mar 23, 2016
4ecbe09
Merge branch 'feature/modern-promises' into feature/test-bench-pipeline
Mar 23, 2016
53370cb
Merge branch 'feature/modern-promises' into feature/test-bench-pipeline
Mar 23, 2016
7a5e80d
Merge branch 'feature/modern-promises' into feature/test-bench-pipeline
Mar 24, 2016
1c0e703
Always render test logs across the screen & error handling improvements.
Mar 24, 2016
1fda42e
Factored BatchRunButton out of TestManager component
Mar 24, 2016
e22b6d4
Set BucketHolder self.configured *after* actually configuring
Mar 25, 2016
8fa0765
s3.py Formatting fixes
Mar 25, 2016
8d85996
Merge branch 'feature/django-1.9' into feature/test-bench-pipeline
Mar 25, 2016
b4130b4
"Run Live Test" modal formatting improvements
Mar 25, 2016
89fed6a
Moved test Run/Download buttons into Dashboard
Mar 25, 2016
5f2ffbe
Fixed issues with django-pipeline speed in Development mode.
Apr 1, 2016
3385c8f
Merge branch 'task/update-python' into feature/test-bench
Apr 1, 2016
fb6c469
Merge branch 'feature/api-improvements' into feature/test-bench
Apr 1, 2016
90cf450
Merge branch 'bugfix/export-bucket' into feature/test-bench
Apr 1, 2016
ba584c8
Convert monkey.py to use json_view
Apr 2, 2016
2efc043
Correctted monkey json_views and other small fixes
Apr 3, 2016
205756c
removed do factory_reset from test bundle
Apr 3, 2016
96cb15d
Merge branch 'feature/api-improvements' into feature/test-bench
Apr 3, 2016
2d445aa
Updated bundle-framing test
Apr 3, 2016
4bdd62a
Merge branch 'master' into feature/test-bench
Apr 4, 2016
378ae1a
Rewrote the monkeyscript parser.
Apr 5, 2016
ece69cf
Removed staticfiles_storage toggle
Apr 7, 2016
8d43772
Fixed issues with django-pipeline speed in Development mode.
Apr 1, 2016
0bdff18
Merge branch 'feature/django-1.9' into feature/test-bench
Apr 7, 2016
a15d5e9
Merge branch 'master' into feature/django-1.9
Apr 7, 2016
b61147a
Merge branch 'feature/django-1.9' into feature/test-bench
Apr 7, 2016
e7db207
Merge branch 'task/update-python' into feature/django-1.9
Apr 7, 2016
36dd23c
Merge branch 'feature/django-1.9' into feature/test-bench
Apr 7, 2016
4fdfff2
Merge branch 'feature/file-model-refactor' into feature/test-bench
Apr 11, 2016
5c1ce23
Merge branch 'feature/file-model-refactor' into feature/test-bench
Apr 11, 2016
6fead72
Changed test_show_screenshot to get its screenshot directly via the DB
Apr 11, 2016
8c35c0a
Merge branch 'feature/file-model-refactor' into feature/test-bench
Apr 12, 2016
2696380
Tests: made FakeS3, reliance on AWS_ENABLED.
Apr 12, 2016
3fd9eef
Moved fakes and test helpers out of tests folders
Apr 12, 2016
8717c8e
Merge branch 'feature/travis' into feature/test-bench
Apr 12, 2016
15d177f
Fixed Source API tests
Apr 13, 2016
9d82ff3
Merge branch 'feature/api-improvements' into feature/test-bench
Apr 13, 2016
ebf07ba
Fixed test download button regression.
Apr 13, 2016
54c9977
Use json_views in orchestrator_proxy
Apr 13, 2016
7131321
Update orchestrator test request data.
Apr 14, 2016
988dbd9
Screenshot manager improvements
Apr 14, 2016
a81b819
Compile react with babel instead of pyreact
Apr 14, 2016
9e1c6f6
Converted all jsx code back to es6/7
Apr 15, 2016
645faa7
Full format fix of all ES6 code.
Apr 15, 2016
fb4b975
Bumped packages and updated project for compataility
Apr 15, 2016
fb08b16
Merge branch 'feature/django-1.9' into feature/test-bench
Apr 15, 2016
5806985
Set up package.json and babel for production use.
Apr 15, 2016
5f8c982
Don't use django-pipeline's FileSystem/AppDirectories finders
Apr 19, 2016
d59c128
Merge branch 'feature/django-1.9' into feature/test-bench
Apr 19, 2016
10c56bd
Added test bench user whitelist
Apr 19, 2016
726dc1b
Merge branch 'feature/improved-logging' into feature/test-bench
Apr 19, 2016
3be02da
Finders/storages changes
Apr 19, 2016
dc0fe01
Merge branch 'feature/django-1.9' into feature/test-bench
Apr 19, 2016
8806ff4
Built an uglifyjs compressor with a sourcemap-compatible concatenatio…
Apr 20, 2016
0356660
Included es6 tag in project.html
Apr 20, 2016
47213ca
Rename es6 to jsx
Apr 20, 2016
419bafb
Don't require testbench privilages for test completion notify
Apr 20, 2016
3b8d983
Merge branch 'master' into feature/test-bench
Apr 20, 2016
3dcd678
Merge branch 'feature/set-active-pane-options-param' into feature/tes…
Apr 20, 2016
b535570
Refactored route mechanism to eventually support polling
Apr 21, 2016
bc796da
Convert all clientside test-bench code to ES6
Apr 21, 2016
294f2da
Added polling to the test manager.
Apr 21, 2016
14c2a7e
Correctly show django-pipeline compile errors inline in IDE.
Apr 21, 2016
b7c1de1
Disable screenshot form save button if nothing is changed.
Apr 21, 2016
081df7c
Added a generic PollTask function
Apr 22, 2016
afcbfd1
Moved heavy-duty serverside test logic into celery tasks.
Apr 22, 2016
714ee8f
Fixed monkey API tests
Apr 25, 2016
cc60e32
Merge branch 'feature/api-improvements' into feature/test-bench
Apr 25, 2016
e460996
Removed all reference to STRICT TEST BUNDLES
Apr 25, 2016
785085e
Monkeyscript: allow comments after multiple spaces
Apr 25, 2016
f88321c
Support pbltest.io with a certificate
Apr 27, 2016
53fdea4
Fixed various logic issues and typos.
Apr 27, 2016
db1d1c5
Merge branch 'task/update-python' into feature/django-1.9
Apr 28, 2016
6abc637
Merge branch 'task/update-python' into feature/test-bench
Apr 28, 2016
239bfc6
gitignore pem files.
Apr 28, 2016
5da41fb
Correctly start emulator when testing & other fixes
Apr 29, 2016
e5aa4de
live TA: soft-uninstall app and don't reset emu
Apr 29, 2016
d8ac18a
Made it possible to subscribe to live test runs after page reloads.
Apr 30, 2016
7024851
Replaced Pillow with PyPNG.
May 2, 2016
cd19dcd
Test manager interface adjustments.
May 2, 2016
3e4c0c9
Fixed screenshot correction when no correction is needed
May 3, 2016
f63ec46
Merge branch 'feature/improved-logging' into feature/test-bench
May 3, 2016
c59f562
Send appropriate requests when switching to Test Manager, and reduce …
May 3, 2016
050fa20
Test Manager code cleanup and improved fetching logic.
May 3, 2016
09786f5
Merge branch 'task/update-python' into feature/django-1.9
May 3, 2016
3858951
Merge branch 'feature/django-1.9' into feature/test-bench
May 3, 2016
1eb4c89
Simplied and fixed right sidepane for screenshot manager.
May 4, 2016
726cfee
Formatting fixup.
May 4, 2016
6f875c0
Merge branch 'feature/api-improvements' into feature/test-bench
May 4, 2016
6e2d099
Merge branch 'feature/travis' into feature/test-bench
May 10, 2016
1e33def
Merge branch 'feature/s3_bucketholder' into feature/django-1.9
May 10, 2016
7a194dd
Merge branch 'feature/django-1.9' into feature/test-bench
May 10, 2016
6b05f12
Merge branch 'feature/travis' into feature/django-1.9
May 10, 2016
37a14b1
Merge branch 'feature/django-1.9' into feature/test-bench
May 10, 2016
e9191cc
Removed duplicate requirement
May 10, 2016
45a6d1f
Merge branch 'feature/django-1.9' into feature/test-bench
May 11, 2016
978d66f
Merge branch 'feature/travis' into feature/django-1.9
May 11, 2016
a165901
Merge branch 'feature/django-1.9' into feature/test-bench
May 11, 2016
ca8c307
Merge branch 'feature/improved-logging' into feature/test-bench
May 19, 2016
d5185df
Merge branch 'feature/improved-logging' into feature/django-1.9
May 19, 2016
d6d0ac7
Merge branch 'feature/django-1.9' into feature/test-bench
May 19, 2016
cdd8b99
Merge branch 'feature/file-model-refactor' into feature/test-bench
Jun 7, 2016
2aae3e4
Merge branch 'feature/set-active-pane-options-param' into feature/tes…
Jun 7, 2016
83c19ac
Merge branch 'master' into feature/test-bench
Jun 10, 2016
e93a4be
Merge branch 'master' into feature/django-1.9
Jun 10, 2016
2c06d97
Rebuilt initial migration
Jun 10, 2016
17810ba
Backported improvements from test-bench
Jun 10, 2016
07ac8c1
Merge branch 'feature/django-1.9' into feature/test-bench
Jun 10, 2016
3fcf2e7
Update test-bench migration
Jun 10, 2016
2d6bc84
Merge branch 'master' into feature/django-1.9
Jul 6, 2016
73c5e26
Merge branch 'feature/django-1.9' into feature/test-bench
Jul 6, 2016
6e77bcb
Interface/test fixes
Jul 7, 2016
d69ac58
Merge branch 'master' into feature/django-1.9
Aug 3, 2016
2f7b06b
Merge branch 'feature/django-1.9' into feature/test-bench
Aug 3, 2016
df1339e
Update migrations.
Aug 5, 2016
73b6abc
Merge branch 'feature/django-1.9' into feature/test-bench
Aug 5, 2016
50ea215
TestSession/Run model fixes.
Aug 5, 2016
732e0ef
Merge branch 'master' into feature/django-1.9
Sep 7, 2016
b5371a7
Update initial migrations.
Sep 7, 2016
5a10213
Merge branch 'feature/django-1.9' into feature/test-bench
Sep 7, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*.pyc
*.mo
*.bak
*.pem
user_data/
dev.db
.DS_Store
Expand All @@ -12,3 +13,4 @@ src/
.env/
.idea/
bower_components
staticfiles
20 changes: 17 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM python:2.7.11
MAINTAINER Katharine Berry <[email protected]>

ENV NPM_CONFIG_LOGLEVEL=info NODE_VERSION=4.2.3 DJANGO_VERSION=1.6
ENV NPM_CONFIG_LOGLEVEL=info NODE_VERSION=4.2.3 DJANGO_VERSION=1.9.7

# Node stuff.

Expand Down Expand Up @@ -41,6 +41,17 @@ EXPOSE 8000
# CloudPebble stuff
RUN npm install -g bower && echo '{"allow_root": true}' > ~/.bowerrc

ADD package.json /tmp/package.json
RUN cd /tmp && npm install
RUN mkdir -p /opt/npm && cp -a /tmp/node_modules /opt/npm/
ENV NODE_MODULES_PATH /opt/npm/node_modules

ADD package.json /tmp/package.json
RUN cd /tmp && npm install
RUN mkdir -p /opt/npm && cp -a /tmp/node_modules /opt/npm/
ENV NODE_MODULES_PATH /opt/npm/node_modules


# Grab the toolchain
RUN curl -o /tmp/arm-cs-tools.tar https://cloudpebble-vagrant.s3.amazonaws.com/arm-cs-tools-stripped.tar && \
tar -xf /tmp/arm-cs-tools.tar -C / && rm /tmp/arm-cs-tools.tar
Expand All @@ -55,8 +66,8 @@ RUN mkdir /sdk2 && \
curl -L "https://s3.amazonaws.com/assets.getpebble.com/sdk3/sdk-core/sdk-core-${SDK_TWO_VERSION}.tar.bz2" | \
tar --strip-components=1 -xj -C /sdk2

ENV SDK_THREE_CHANNEL=beta
ENV SDK_THREE_VERSION=4.0-beta16
ENV SDK_THREE_CHANNEL=release
ENV SDK_THREE_VERSION=4.0.1

# Install SDK 3
RUN mkdir /sdk3 && \
Expand All @@ -69,6 +80,9 @@ WORKDIR /code
# Bower is awful.
RUN rm -rf bower_components && cd /tmp && python /code/manage.py bower install && mv bower_components /code/

ENV PYTHONUNBUFFERED 1

RUN python manage.py compilemessages
RUN python manage.py collectstatic --noinput

CMD ["sh", "docker_start.sh"]
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
web: newrelic-admin run-program gunicorn -c gunicorn.py cloudpebble.wsgi
celery: newrelic-admin run-program python manage.py celeryd -E -l info
celery: newrelic-admin run-program celery worker -A cloudpebble -E -l info
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ appropriate values there. Setting environment variables also works.
Note that you won't be able to set up integration with certain Pebble systems (e.g. Pebble SSO). This shouldn't usually
matter; whenever these are used, an alternative route is provided and should be invoked in its absence.

In order to run locally with `DEBUG=False` set, add the setting `STATICFILES_STORAGE = 'pipeline.storage.PipelineStorage'`
to `cloudpebble/settings_local.py`.

Contributing
------------

Expand Down
1 change: 0 additions & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"required": true
},
"BROKER_POOL_LIMIT": "1",
"BUILDPACK_URL": "https://github.com/pebble/cloudpebble-buildpack",
"COMPLETION_CERTS": "/app/completion-certs.crt",
"ENABLE_KEEN": "yes",
"FROM_EMAIL": "[email protected]",
Expand Down
3 changes: 1 addition & 2 deletions bin/post_compile
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ rm /tmp/*.tar.*

# Make sure the database is up to date.
echo "Performing database migration."
python manage.py syncdb --noinput
python manage.py migrate
python manage.py migrate --fake-initial

echo "Compiling gettext files"
python manage.py compilemessages
Expand Down
22 changes: 20 additions & 2 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ ln -s /vagrant/user_data/export /var/www/export
# Fix broken pip in 14.04
easy_install pip

# Allow pip to access pebblehq packages
sudo -u vagrant mkdir .pip
cat << 'EOF' > /home/vagrant/.pip/pip.conf
[global]
trusted-host = pypi.hq.getpebble.com
index-url = http://pypi.hq.getpebble.com/simple/
EOF

# CloudPebble python requirements.
pip install -r /vagrant/requirements.txt

Expand All @@ -40,7 +48,6 @@ easy_install requests==2.7.0

# Make sure we have a useful database and our JS dependencies.
pushd /vagrant
sudo -u vagrant python manage.py syncdb --noinput
sudo -u vagrant python manage.py migrate
sudo -u vagrant python manage.py bower install
popd
Expand Down Expand Up @@ -105,6 +112,14 @@ pushd /pypkjs
deactivate
popd


mkdir pebble-test
pushd pebble-test
git clone [email protected]:pebble/pebblesdk-test.git .
# must first have access to pebble.loghash
pip install -r requirements.txt
popd

sudo -u vagrant mkdir qemu-controller
pushd qemu-controller
git clone https://github.com/pebble/cloudpebble-qemu-controller.git .
Expand Down Expand Up @@ -169,7 +184,8 @@ console log
script
export PATH="$PATH:/home/vagrant/arm-cs-tools/bin:/home/vagrant/sdk2/bin"
export DEBUG=yes
exec /usr/bin/python manage.py celery worker --autoreload --loglevel=info --no-color
# The following line is untested after move to Django 1.9
exec celery worker --autoreload --loglevel=info --no-color
end script

EOF
Expand Down Expand Up @@ -221,6 +237,8 @@ script
export PKJS_BIN=/pypkjs/phonesim.py
export PKJS_VIRTUALENV=/pypkjs/.env
export QEMU_IMAGE_ROOT=/home/vagrant/qemu-tintin-images
export PEBBLE_TEST_BIN=/home/vagrant/pebble-test/runner.py
export PEBBLE_LOGHASH_DICT=/home/vagrant/loghash/loghash_dict.json
export DEBUG=yes
export QCON_PORT=8003
exec /usr/bin/python controller.py
Expand Down
5 changes: 5 additions & 0 deletions cloudpebble/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from __future__ import absolute_import

# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
from .celery import app as celery_app
22 changes: 22 additions & 0 deletions cloudpebble/celery.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from __future__ import absolute_import

import os

from celery import Celery

# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'cloudpebble.settings')

from django.conf import settings # noqa

app = Celery('cloudpebble')

# Using a string here means the worker will not have to
# pickle the object when using Windows.
app.config_from_object('django.conf:settings')
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)


@app.task(bind=True)
def debug_task(self):
print('Request: {0!r}'.format(self.request))
53 changes: 53 additions & 0 deletions cloudpebble/compressors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
from __future__ import unicode_literals

import codecs
import tempfile

from django.contrib.staticfiles.storage import staticfiles_storage

from pipeline.conf import settings
from pipeline.compressors import SubProcessCompressor
from pipeline.utils import source_map_re, path_depth


class ConcatenatingUglifyJSCompressor(SubProcessCompressor):
def compress_js(self, js):
command = [settings.UGLIFYJS_BINARY, settings.UGLIFYJS_ARGUMENTS]
if self.verbose:
command.append(' --verbose')
return self.execute_command(command, js)

def concatenate_files(self, paths, out_path):
args = [settings.CONCATENATOR_BINARY]
args += [staticfiles_storage.path(p) for p in paths]
args += ['-o', out_path]
args += ['-d', staticfiles_storage.base_location]
self.execute_command(args)

def compress_js_with_source_map(self, paths):
concatenated_js_file = tempfile.NamedTemporaryFile()
source_map_file = tempfile.NamedTemporaryFile()
try:
self.concatenate_files(paths, concatenated_js_file.name)
args = [settings.UGLIFYJS_BINARY]
args += [concatenated_js_file.name]
args += ["--in-source-map", concatenated_js_file.name + ".map"]
args += ["--source-map", source_map_file.name]
args += ["--source-map-root", staticfiles_storage.base_url]
args += ["--prefix", "%s" % path_depth(staticfiles_storage.base_location)]
args += settings.UGLIFYJS_ARGUMENTS
if self.verbose:
args.append('--verbose')

js = self.execute_command(args)

with codecs.open(source_map_file.name, encoding='utf-8') as f:
source_map = f.read()

# Strip out existing source map comment (it will be re-added with packaging)
js = source_map_re.sub('', js)

return js, source_map
finally:
concatenated_js_file.close()
source_map_file.close()
Loading