@@ -23,8 +23,8 @@ Installation
2323Download and unpack most recent Google App Engine SDK for Python from
2424https://code.google.com/appengine/downloads.html, e.g.::
2525
26- $ wget https://googleappengine.googlecode .com/files/ google_appengine_1.5.1 .zip
27- $ unzip google_appengine_1.5.1 .zip
26+ $ wget https://storage.googleapis .com/appengine-sdks/featured/ google_appengine_1.9.90 .zip
27+ $ unzip google_appengine_1.9.90 .zip
2828
2929On the Mac, it is a disk image with an application, which you should
3030drag to your Applications folder. Open the program and install the
@@ -46,14 +46,6 @@ We use submodules to include external libraries in sympy_gamma::
4646This is sufficient to clone appropriate repositories in correct versions
4747into sympy_gamma (see git documentation on submodules for information).
4848
49- Generate a configuration file for App Engine (needed to run the development
50- web server)::
51-
52- $ python deploy.py --generate-only --generate-test 1000
53-
54- (the number does not matter unless you are deploying, see below). **DO not **
55- commit the generated ``app.yaml `` file.
56-
5749Development server
5850------------------
5951
@@ -85,58 +77,51 @@ necessary unless you are deploying to the official server)::
8577
8678 $ git tag -a version-42
8779
88- Second, you need to generate an ``app.yaml `` (App Engine configuration) file
89- using ``deploy.py ``::
9080
91- $ python deploy.py --generate-only --generate-production
81+ Then install the Google Cloud SDK for your OS from here:
82+ https://cloud.google.com/sdk/install
9283
93- The script will determine the version from the tag; it can also be manually
94- specified (``--generate-production VERSION_NUMBER ``). You will also want to
95- change the application name if you are not deploying to the test
96- application. **DO not ** commit the generated ``app.yaml `` file.
84+ This will let you use the "gcloud" CLI. After this configure the CLI to access
85+ the google cloud console for the project::
9786
98- Second, you need to go to the ``Versions `` section of the
99- sympy_gamma dashboard at appspot.com and delete the oldest version, as we
100- can only upload ten versions at a time.
87+ $ gcloud init
10188
102- Assuming that sympy_gamma works properly (also across different mainstream web
103- browsers), you can upload your changes to Google App Engine::
10489
105- $ ../appcfg.py update .
90+ Assuming that sympy_gamma works properly (also across different mainstream web
91+ browsers), you can upload your changes to Google App Engine, replacing the
92+ <TAGGED_VERSION> with actual version we tagged with::
10693
107- Or, in Mac OS X, just open the GoogleAppEngineLauncher program, add the
108- project if you haven't already, and click "Deploy" in the toolbar. And then
109- it should just work (follow the log that comes up to see.
94+ $ gcloud app deploy --project sympy-gamma-hrd --no-promote --version <TAGGED_VERSION>
11095
11196This requires admin privileges to https://sympy-gamma-hrd.appspot.com. If you
11297don't have access to this App Engine application, but want to test it, see
11398the instructions in the `Testing on the App Engine `_ section below.
11499
115- The deploy script can generate the configuration and deploy in one step if
116- given the App Engine SDK location::
117-
118- $ SDK_LOCATION=/path/to/sdk python deploy.py --generate-production
119-
120- Finally, go to https://NN.sympy-gamma-hrd.appspot.com, where ``NN `` is the
100+ Finally, go to https://NN-dot-sympy-gamma-hrd.appspot.com, where ``NN `` is the
121101version you just uploaded, and make sure that it works. If it does, go to
122102the ``Versions `` section of the sympy_gamma dashboard, and set this as the
123103new default version. If there are any issues, you can roll back to the
124104previous version from this same screen.
125105
126- Generating a Deployment Key
127- ---------------------------
106+ Creating Deployment Credentials
107+ -------------------------------
108+
109+ Travis-CI deploys the application using service account credentials. To create a
110+ service account for deployment with suitable permissions, follow these steps:
128111
129- Travis-CI deploys the application using OAuth credentials. These are stored
130- encrypted in the ``env `` section of ``.travis.yml ``, and are generated using
131- the Travis command-line tools::
112+ https://cloud.google.com/solutions/continuous-delivery-with-travis-ci#creating_credentials
132113
133- travis encrypt 'OAUTH_REFRESH_TOKEN=TOKEN' -r sympy/sympy_gamma
114+ These are stored encrypted in the ``client-secret.json.enc `` file in the repository, and are generated
115+ using the Travis command-line tools (client-secret.json is the credentials file for the service account
116+ created int the step above) ::
134117
135- The token is found in the JSON file ``$HOME/.appcfg_oauth2_tokens `` under
136- the key ``"refresh_token" ``. This file is created after manually deploying
137- (or running any other command) using OAuth authorization::
138118
139- $ ../appcfg.py update --oauth2 .
119+ travis encrypt-file client-secret.json --add
120+
121+ This also adds the encrypted keys in travis environment variables, which you can
122+ check from here: https://travis-ci.org/github/aktech/sympy_gamma/settings in the
123+ "Environment Variables" section.
124+
140125
141126Testing on the App Engine
142127-------------------------
@@ -147,23 +132,19 @@ Currently, there is no testing server set up as there is for SymPy
147132Live. However, you can set up your own testing server (it's free, though it
148133requires a cell phone to set up).
149134
150- Either way, to test, you will need to edit the `` app.yaml `` file. You should
151- edit the first line, `` application ``, to the name of the testing application
152- (like `` sympy-gamma-tests ``), and the second line to the version number you
153- want to use.
135+ Either way, to test, you will need to edit the Project ID in the deploy command
136+ mentioned above with your Project ID and the version you want to deploy to::
137+
138+ gcloud app deploy --project <your-project-name> --no-promote --version <TAGGED_VERSION>
154139
155- You should not actually commit ``app.yaml ``, as it is generated by the
156- deploy script. If you later want to commit an actual change to the
157- generated ``app.yaml `` (e.g., to modify some metadata), you should edit and
158- commit changes to ``app.yaml.template ``.
159140
160141If you have a test app online, remember to update it every time you update a
161142pull request, so that others can easily review your work, without even having
162143to use ``dev_appserver.py ``.
163144
164- Pull requests are automatically deployed by Travis to
165- `https://N-dot-sympy-gamma-tests.appspot.com/ `, where `N ` is the pull request
166- number. Note that the pull request has to from a branch on this repository, as
145+ Branch builds are automatically deployed by Travis to
146+ `https://N-dot-sympy-gamma-tests.appspot.com/ `, where `N ` is the branch name.
147+ Note that the pull request has to from a branch on this repository, as
167148forks do not have access to the key to deploy to the app engine.
168149
169150Development notes
@@ -202,7 +183,6 @@ In projects that don't use submodules, pulling changes boils down to::
202183in the simplest case. SymPy Gamma, however, requires additional effort::
203184
204185 $ git submodule update
205- $ python deploy.py --generate-only --generate-test 1000
206186
207187The former command assures that if there were any changes to submodules
208188of the super-project, then those submodules will get updated to new
0 commit comments