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

WIP: Continuous Deployment! #206

Open
wants to merge 58 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
c46a5d7
Try and get CD going to gae
peternewman Jun 17, 2018
17d945b
Deploy on all branches for now
peternewman Jun 17, 2018
e40e15b
Add the missing file
peternewman Jun 17, 2018
538a2f9
Get the right filename
peternewman Jun 17, 2018
926d8cb
Extract our decrypted tar
peternewman Jun 17, 2018
2000b69
Keep gcloud happy
peternewman Jun 17, 2018
c9e7ae7
More attempts to make gcloud happy
peternewman Jun 17, 2018
bd74554
Merge branch 'master' into dpl
peternewman Jun 20, 2018
9978ff4
Only run deploy ones, and prepare the JS before deploy
peternewman Jun 20, 2018
a32e590
Merge branch 'dpl' of https://github.com/peternewman/rdm-app into dpl
peternewman Jun 20, 2018
38b8880
Run grunt bower too
peternewman Jun 20, 2018
98bd646
Store the index.yaml in git for easier deployment
peternewman Jun 21, 2018
ecae565
Attempt to get indexes uploaded during CD
peternewman Jun 21, 2018
f59b876
Skip uploading index.yaml again, as it didn't push indexes
peternewman Jun 21, 2018
872d48b
Also push index.yaml to GAE
peternewman Jun 25, 2018
054c476
Merge branch 'master' into dpl
peternewman Jun 25, 2018
def1d8f
Duplicate some config to try and make a valid .travis.yml
peternewman Jun 25, 2018
31077dd
Add more indexes
peternewman Jun 25, 2018
2f66602
Merge branch 'master' of https://github.com/openlightingproject/rdm-a…
peternewman Jun 26, 2018
4fcf61e
Make the sending email address generic
peternewman Jun 26, 2018
d5bf09d
Merge branch 'master' into dpl
peternewman Jun 27, 2018
58c4388
Merge branch 'master' into dpl
peternewman Jul 16, 2018
6901f7d
More codespellignore
peternewman Jul 16, 2018
bae213a
Merge branch 'master' of https://github.com/openlightingproject/rdm-a…
peternewman Jul 16, 2018
6660f8d
Merge branch 'dpl' of https://github.com/peternewman/rdm-app into dpl
peternewman Jul 16, 2018
8148e62
Ensure grunt/npm stuff is available for deploy task
peternewman Jul 16, 2018
12f1494
Merge branch 'master' into dpl
peternewman Jul 21, 2018
e466474
Merge branch 'master' into dpl
peternewman Jul 23, 2018
b7d8c69
Send more appropriate emails from dev systems
peternewman Jul 28, 2018
65c3485
Merge branch 'master' into dpl
peternewman Jul 30, 2018
38e23fd
Merge branch 'master' into dpl
peternewman Jul 30, 2018
ea0c59a
Only decrypt credentials on deploy task
peternewman Aug 6, 2018
9f6305d
Merge branch 'master' into dpl
peternewman Aug 6, 2018
c0c2215
Add another codespellignore
peternewman Aug 6, 2018
86242f5
Merge branch 'master' into dpl
peternewman Aug 6, 2018
e25cfd4
Merge branch 'master' into dpl
peternewman Aug 8, 2018
72909fd
Merge branch 'master' into dpl
peternewman Sep 18, 2018
927e444
Merge branch 'master' into dpl
peternewman Sep 23, 2018
a0702c1
Merge branch 'master' into dpl
peternewman Oct 3, 2018
74618d7
Merge branch 'master' into dpl
peternewman Nov 17, 2018
838ed2c
Merge branch 'master' into dpl
peternewman Feb 25, 2019
1a5388a
Merge branch 'master' into dpl
peternewman Mar 18, 2019
1ef8051
Deploy app and index YAML files at the same time.
peternewman Aug 24, 2019
62c8d05
Merge branch 'master' into dpl
peternewman Aug 24, 2019
227d2e1
Switch to dpl v2 for multiple configs at once
peternewman Aug 24, 2019
fef4ece
Switch to the standard edge version of dpl v2 and update a few bits t…
peternewman Aug 30, 2019
e0e1341
Merge branch 'master' into dpl
peternewman Sep 21, 2019
d77b768
Merge branch 'master' into dpl
peternewman Sep 22, 2019
1b37b77
Merge branch 'master' of https://github.com/openlightingproject/rdm-a…
peternewman Dec 19, 2019
8066c87
Merge branch 'dpl' of https://github.com/peternewman/rdm-app into dpl
peternewman Dec 19, 2019
d10e59e
Merge branch 'master' into dpl
peternewman Dec 24, 2019
50b39ff
Merge branch 'master' of https://github.com/openlightingproject/rdm-a…
peternewman Dec 24, 2019
8b6ab85
Merge branch 'dpl' of https://github.com/peternewman/rdm-app into dpl
peternewman Dec 24, 2019
86cc96e
Merge branch 'master' into dpl
peternewman Dec 28, 2019
eb8ccb0
Merge branch 'master' of https://github.com/openlightingproject/rdm-a…
peternewman Feb 21, 2020
d66c003
Merge branch 'dpl' of https://github.com/peternewman/rdm-app into dpl
peternewman Feb 21, 2020
0d8e6b4
Fix a broken merge
peternewman Feb 21, 2020
70b9f48
Merge branch 'master' into dpl
peternewman Oct 1, 2021
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
1 change: 1 addition & 0 deletions .codespellignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@
(0x5655, "Shenzhen CAS VU Technologies Co., Ltd."),
(function($){var escapeable=/["\\\x00-\x1f\x7f-\x9f]/g,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};$.toJSON=typeof JSON==='object'&&JSON.stringify?JSON.stringify:function(o){if(o===null){return'null';}
return'{'+pairs.join(',')+'}';}};$.evalJSON=typeof JSON==='object'&&JSON.parse?JSON.parse:function(src){return eval('('+src+')');};$.secureEvalJSON=typeof JSON==='object'&&JSON.parse?JSON.parse:function(src){var filtered=src.replace(/\\["\\\/bfnrtu]/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,'');if(/^[\],:{}\s]*$/.test(filtered)){return eval('('+src+')');}else{throw new SyntaxError('Error parsing JSON, source is not valid.');}};$.quoteString=function(string){if(string.match(escapeable)){return'"'+string.replace(escapeable,function(a){var c=meta[a];if(typeof c==='string'){return c;}
- provider: gae
--passin \
'link': 'http://www.ljusdesign.se/produkt/styrning/adhoc-dmx-splitter-din/',
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
*rdm*.json
*.bak
*.old
*.pyc
*.save
*.swp
api_key.py
credentials.tar.gz
node_modules
index.yaml
.idea
static/libs
static/js/rdm.js
Expand Down
3 changes: 3 additions & 0 deletions .travis-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,7 @@ elif [[ $TASK = 'pychecker-wip' ]]; then
PYTHONPATH=./:$PYTHONPATH
export PYTHONPATH
pychecker --quiet --limit 500 --blacklist $PYCHECKER_BLACKLIST $(find ./ -name "*.py" | xargs)
elif [[ $TASK = 'deploy' ]]; then
grunt --verbose bower
grunt --verbose compress
fi
22 changes: 20 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ cache:
- $HOME/.npm
- $HOME/.cache/pip

before_install:
- if [[ "$TASK" == "deploy" ]]; then openssl aes-256-cbc -K $encrypted_7eede60d6b12_key -iv $encrypted_7eede60d6b12_iv -in credentials.tar.gz.enc -out credentials.tar.gz -d && tar -xzf credentials.tar.gz; fi

install:
- if [ "$TASK" = "nosetests" -o "$TASK" = "flake8" -o "$TASK" = "flake8-wip" ]; then pip install json-spec; fi
- if [ "$TASK" = "karma" -o "$TASK" = "lint" -o "$TASK" = "closure-compiler" ]; then npm install -g grunt-cli; fi
- if [ "$TASK" = "karma" -o "$TASK" = "lint" -o "$TASK" = "closure-compiler" ]; then npm install; fi
- if [ "$TASK" = "karma" -o "$TASK" = "lint" -o "$TASK" = "closure-compiler" -o "$TASK" = "deploy" ]; then npm install -g grunt-cli; fi
- if [ "$TASK" = "karma" -o "$TASK" = "lint" -o "$TASK" = "closure-compiler" -o "$TASK" = "deploy" ]; then npm install; fi
- if [ "$TASK" = "flake8" -o "$TASK" = "flake8-wip" ]; then pip install flake8; fi
# If this causes SSL errors, then Sourceforge is probably in disaster recovery mode and needing Javascript. Could switch to a specific mirror, e.g. kent.dl.sourceforge.net
- if [ "$TASK" = "pychecker" -o "$TASK" = "pychecker-wip" ]; then pip install http://sourceforge.net/projects/pychecker/files/pychecker/0.8.19/pychecker-0.8.19.tar.gz/download; fi
Expand Down Expand Up @@ -82,6 +85,21 @@ matrix:
arch: arm64
python: "2.7"
env: TASK='pychecker-wip'
- stage: deploy
os: linux
dist: trusty
env: TASK='deploy'
deploy:
- provider: gae
edge: true
keyfile: peter-ola-rdm-app-51be81f8c2c3.json
project: peter-ola-rdm-app
config:
- app.yaml
- index.yaml
on:
all_branches: true

allow_failures:
- os: linux
dist: trusty
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ respective file in the `data/` directory.

### Deploying to App Engine

Before deploying to App Engine run:
Before deploying to App Engine run (grunt bower if you hadn't already, and):
```bash
grunt compress
```
Expand Down
4 changes: 2 additions & 2 deletions app.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
application: "olp-rdm-staging"
#application: "olp-rdm-staging"
#application: "rdmprotocol-hrd"
version: 1
#version: 1
runtime: python27
api_version: 1
threadsafe: no
Expand Down
12 changes: 9 additions & 3 deletions common.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import logging
import memcache_keys
import textwrap
from google.appengine.api import app_identity
from google.appengine.api import mail
from google.appengine.api import memcache
from google.appengine.ext import webapp
Expand Down Expand Up @@ -136,15 +137,20 @@ def MaybeSendEmail(new_responder_count):
query = UploadedResponderInfo.all()
query.filter('processed = ', False)
if query.count() == new_responder_count:
is_live_site = (app_identity.get_application_id() == "rdmprotocol-hrd")
message = mail.EmailMessage(
sender='RDM Site <[email protected]>',
sender=('%sRDM Site <support@%s.appspotmail.com>' %
(("" if is_live_site else (
app_identity.get_application_id() + " ")),
app_identity.get_application_id())),
subject='Pending Moderation Requests',
to='<[email protected]>',
)
message.body = textwrap.dedent("""\
There are new responders in the moderation queue.
Please visit http://rdm.openlighting.org/admin/moderate_responder_data
""")
Please visit http://%s/admin/moderate_responder_data
""" % ("rdm.openlighting.org" if is_live_site else (
app_identity.get_application_id() + ".appspot.com")))
message.send()


Expand Down
Binary file added credentials.tar.gz.enc
Binary file not shown.
49 changes: 49 additions & 0 deletions index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
indexes:

# AUTOGENERATED

# This index.yaml is automatically updated whenever the dev_appserver
# detects that a new type of query is run. If you want to manage the
# index.yaml file manually, remove the above marker line (the line
# saying "# AUTOGENERATED"). If you want to manage some indexes
# manually, move them above the marker line. The index.yaml file is
# automatically uploaded to the admin console when you next deploy
# your application using appcfg.py.

- kind: Pid
properties:
- name: draft
- name: manufacturer
- name: pid_id

- kind: Pid
properties:
- name: manufacturer
- name: name

- kind: Product
properties:
- name: class
- name: image_url
direction: desc

- kind: Product
properties:
- name: class
- name: manufacturer
- name: name

- kind: ProductTag
properties:
- name: product_type
- name: label

- kind: Responder
properties:
- name: manufacturer
- name: device_model_id

- kind: Responder
properties:
- name: manufacturer
- name: model_description