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

#159396311 Configure heroku deployment #1

Merged
merged 1 commit into from
Aug 1, 2018

Conversation

solnsubuga
Copy link
Contributor

@solnsubuga solnsubuga commented Jul 30, 2018

What does this PR do?

This PR sets up deployment on heroku.

Description of Task to be completed?

  • Configure application for deployment to staging area
  • Enable automatic deployment of develop branch to staging when CI passes.

How should this be manually tested?

  • Visit the deployed application here or follow steps below to deploy to your own app:
  • Create application on Heroku add postgres dyno
  • Set config variable DB to be heroku
  • Set your python buildpack to be https://github.com/solnsubuga/heroku-buildpack-python
  • Add heroku/nodejs buildpack as well.
  • Deploy this branch ft-heroku-deployment-159396311 to your app.

What are the relevant pivotal tracker stories?

#159396311

Screenshots (if appropriate)

screen shot 2018-07-30 at 21 19 25

@lym
Copy link
Contributor

lym commented Jul 31, 2018

@solnsubuga The assets (JavaScript/CSS/Images) don't appear to be working on the deployed instance.

@solnsubuga solnsubuga temporarily deployed to wger-bs-staging July 31, 2018 08:40 Inactive
@solnsubuga solnsubuga temporarily deployed to wger-bs-staging July 31, 2018 09:20 Inactive
@solnsubuga solnsubuga force-pushed the ft-heroku-deployment-159396311 branch from 1e6e813 to 02dcb84 Compare July 31, 2018 09:54
@solnsubuga solnsubuga temporarily deployed to wger-bs-staging July 31, 2018 10:21 Inactive
@solnsubuga solnsubuga temporarily deployed to wger-bs-staging July 31, 2018 10:26 Inactive
@solnsubuga solnsubuga force-pushed the ft-heroku-deployment-159396311 branch from 02dcb84 to 06e83a7 Compare July 31, 2018 10:42
@solnsubuga
Copy link
Contributor Author

@lym static files are removed after deploying. Am looking for a fix.

@solnsubuga solnsubuga temporarily deployed to wger-bs-staging July 31, 2018 11:02 Inactive
@solnsubuga solnsubuga temporarily deployed to wger-bs-staging July 31, 2018 11:52 Inactive
@solnsubuga solnsubuga force-pushed the ft-heroku-deployment-159396311 branch from 06e83a7 to 792615b Compare July 31, 2018 12:36
@solnsubuga solnsubuga temporarily deployed to wger-bs-staging July 31, 2018 12:48 Inactive
@solnsubuga
Copy link
Contributor Author

@lym I have fixed the assets issue. Here is the deployed instance: https://wger-bs-staging.herokuapp.com/en/software/features

@lym
Copy link
Contributor

lym commented Aug 1, 2018

@solnsubuga The link to the story, in your PR description is broken. Please rectify this.

.travis.yml Outdated
@@ -15,16 +15,15 @@ sudo: false
# Python versions to test
python:
- "2.7"
- "3.4"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you disable testing against Python3.4?

.travis.yml Outdated
- TEST_MOBILE=True DB=postgresql TRAVIS_NODE_VERSION="4"
- TEST_MOBILE=True DB=sqlite TRAVIS_NODE_VERSION="4"
- TEST_MOBILE=False DB=postgresql TRAVIS_NODE_VERSION="4"
- TEST_MOBILE=False DB=sqlite TRAVIS_NODE_VERSION="4"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you getting rid of these?


# Javascript linting
- gulp lint

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to add these checks back.

requirements.txt Outdated
python-decouple==3.1
dj-database-url==0.5.0
psycopg2-binary==2.7.5
whitenoise
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please lock whitenoise to a specific version.

settings.py Outdated
TEMPLATES[0]['OPTIONS']['debug'] = True

ADMINS = (
('Your name', 'your_email@example.com'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add yourself as an admin here.

settings.py Outdated
}

# Make this unique, and don't share it with anybody.
SECRET_KEY = 'yu==q%107qo(dm#m%x75(wo$6!l!uo!gskog6**kvssg^%(8_h'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should store and retrieve this from and environment variable.

@@ -28,7 +28,8 @@
from wger.utils.pdf import styleSheet
from wger.utils.pdf import render_footer

from reportlab.lib.pagesizes import A4, cm
from reportlab.lib.pagesizes import A4
from reportlab.lib.units import cm
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are changes to this file relevant to your task?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That change was necessary in order to run the application. It was bug, variable cm was being imported from the wrong package.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it.

@solnsubuga solnsubuga temporarily deployed to wger-bs-staging August 1, 2018 10:42 Inactive
@solnsubuga solnsubuga force-pushed the ft-heroku-deployment-159396311 branch from 792615b to c717f74 Compare August 1, 2018 10:54
@solnsubuga solnsubuga temporarily deployed to wger-bs-staging August 1, 2018 11:08 Inactive
@solnsubuga solnsubuga temporarily deployed to wger-bs-staging August 1, 2018 11:27 Inactive
@solnsubuga solnsubuga temporarily deployed to wger-bs-staging August 1, 2018 11:37 Inactive
@solnsubuga solnsubuga temporarily deployed to wger-bs-staging August 1, 2018 11:42 Inactive
@solnsubuga solnsubuga temporarily deployed to wger-bs-staging August 1, 2018 11:51 Inactive
@solnsubuga solnsubuga temporarily deployed to wger-bs-staging August 1, 2018 12:05 Inactive
@solnsubuga solnsubuga temporarily deployed to wger-bs-staging August 1, 2018 12:05 Inactive
@solnsubuga solnsubuga force-pushed the ft-heroku-deployment-159396311 branch from 7e400ac to d794927 Compare August 1, 2018 12:14
@solnsubuga solnsubuga temporarily deployed to wger-bs-staging August 1, 2018 12:19 Inactive
@@ -28,7 +28,8 @@
from wger.utils.pdf import styleSheet
from wger.utils.pdf import render_footer

from reportlab.lib.pagesizes import A4, cm
from reportlab.lib.pagesizes import A4
from reportlab.lib.units import cm
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it.

@@ -28,6 +28,9 @@
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
SITE_ROOT = os.path.realpath(os.path.dirname(__file__))

SECRET_KEY = os.environ.get(
"SECRET_KEY", 'M34Ivcwrw34343Jr1hp7YzS29nVCiWqT4MgpxHSfiXNzPI5oSP8uLYXOIZ')
Copy link
Contributor

@lym lym Aug 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't add a default. Let's force everyone to retrieve it from the environment. This way, all devs will have to set it by themselves and then we also have to update things like TravisCI and Heroku to include this environment variable.

This is the standard practice for things as sensitive as this.

@solnsubuga solnsubuga force-pushed the ft-heroku-deployment-159396311 branch from 2c4fb64 to 8909bfb Compare August 1, 2018 15:09
@solnsubuga solnsubuga temporarily deployed to wger-bs-staging August 1, 2018 15:10 Inactive
@lym
Copy link
Contributor

lym commented Aug 1, 2018

LGTM

@lym lym merged commit 1b85660 into develop Aug 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants