Skip to content

Instantly share code, notes, and snippets.

@raprasad
Last active May 25, 2018 16:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raprasad/dca532f9294c76e004ae76f5585b4a40 to your computer and use it in GitHub Desktop.
Save raprasad/dca532f9294c76e004ae76f5585b4a40 to your computer and use it in GitHub Desktop.
slow test

one suggestion to get used to the process:

Don't change anything yet

branch from master

  1. add this to settings/base.py:

    TEST_ENV_VARIABLE = os.environ.get('TEST_ENV_VARIABLE', '(nothing set)')
  2. update the homepage to display the variable

    • file: content_pages/views.py
      • add from django.conf import settings
      • to the dict sent to the template: 'TEST_ENV_VARIABLE': settings.TEST_ENV_VARIABLE
    • file: homepage.html
      • add something to the bottom like {% if TEST_ENV_VARIABLE %}<p>TEST_ENV_VARIABLE: {{ TEST_ENV_VARIABLE }}</p>{% endif %}
  3. Test this locally.

    • e.g. in the command line where you're running the server, try echo TEST_ENV_VARIABLE=trying-it-out
    • restart the server and see if trying-it-out appears on the homepage
  4. If it works, check it into master

try the kubernetes secret keys

After a new dockerhub image is built*, follow these deploy instructions:

  1. connect via the cloud shell

  2. cd raven-metadata-service

    • update the deploy/metadata-deploy.yml file as needed via the google shell
  3. Turn the service on/off to see if it's working:

  4. Once you get TEST_ENV_VARIABLE via a secret, then you can move onto reading making a new settings file and reading the creds file via a secret...

  5. turn the service on/off via: https://github.com/TwoRavens/raven-metadata-service/blob/master/deploy/readme.md

  6. try adding enviroment variables to kubernetes for TEST_ENV_VARIABLE and see if they work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment