Skip to content

Latest commit

 

History

History
168 lines (98 loc) · 3.41 KB

DEPLOYMENT.md

File metadata and controls

168 lines (98 loc) · 3.41 KB

Deployment

Introduction

STEMCstudio is currently deployed on Heroku.

STEMCstudio is the marketing name. All engineering names are lower case.

Heroku Application Settings

Heroku Account: [email protected]

Heroku domain: stemcstudio.herokuapp.com

Heroku Git URL: https://git.heroku.com/stemstudio.git

Buildpack: heroku/nodejs

Heroku Custom Domains:

stemcstudio.com => stemcstudio.herokuapp.com www.stemcstudio.com => stemcstudio.herokuapp.com

Heroku Config Variables

GITHUB_APPLICATION_CLIENT_ID (See below)

GITHUB_APPLICATION_CLIENT_SECRET (See below)

NODE_ENV => production

Application Constants

GITHUB_KEY

This is defined in views/github_callback.jade

"com.stemcstudio.github"

GITHUB_APPLICATION_CLIENT_ID_COOKIE_NAME

This is defined in app/ts/app.ts

TODO: Need to DRY this!

"stemcstudio-github-application-client-id"

Development

The file config.development.json defines the GitHub Client ID and Client Secret. The file config.example.json is not actually used because of the Heroku Config Variables.

Developer (OAuth) applications

These are set up in the [email protected] GitHub account.

There are two (2) Developer applications, one for development, the other for production.

development

Name: STEMCstudio Local

Homepage URL: http://localhost:8080

Description: Educational Computational Mathematics, Physics, Modeling and Geometry

Authorization callback URL: http://localhost:8080/github_callback

Copy the Client ID and Client Secret into the file config.development.json

production

Name: STEMCstudio

Homepage URL: https://www.stemcstudio.com

Description: Educational Computational Mathematics, Physics, Modeling and Geometry

Authorization callback URL: https://www.stemcstudio.com/github_callback

Copy the Client ID and Client Secret into the appropriate Heroku Config Variables.

Git remote(s)

The command

git remote -v

should show repositories for GitHub origin and heroku.

Ensure the heroku repository using

git remote add heroku [email protected]:stemcstudio.git

Pushing to Heroku (Git Deploy)

git push -f heroku master

The application is now deployed. Ensure that at least one instance of the app is running:

heroku ps:scale web=1

Now visit the app at the URL generated by its app name. As a handy shortcut, you can open the website as follows:

heroku open
heroku logs --tail

Unfortunately, the following does not seem to work anymore:

heroku local web

Press Control+C to stop streaming logs.

Domains

The stemcstudio.com domain is being managed using dnsimple.com.

The account is david.geo.holmes

The Services are configured as follows

Type Domain Name DNS Target TXT stemcstudio.com ALIAS for stemcstudio.herokuapp.com ALIAS stemcstudio.com stemcstudio.herokuapp.com CNAME www.stemcstudio.com stemcstudio.herokuapp.com

SSL Support

Once an SSL certificate has been installed on Heroku and the application has an SSL Endpoint, the dnsimple DNS records should be updated.

web.go

This server is an experimental replacement of the NodeJS server.

Build the web.go source into a binary in the root folder.

go build

Set the required environment variables.

export GITHUB_APPLICATION_CLIENT_ID=b146ae9c79fa94161b98
export GITHUB_APPLICATION_CLIENT_SECRET=...

Run the server.

./stemcstudio