Skip to content

robinzachmann/djangocon-platformsh-workshop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

First steps

  1. Open a free trial account on Platform.sh
  2. Create an empty project
  3. Install the Platform.sh CLI

Setup

  1. Generate a repo from the template starting point at https://github.com/platformsh-examples/django
  2. Clone the repo locally
  3. platform project:list
  4. platform project:set-remote PROJECT_ID
  5. Create a GitHub API token
  6. Setup the integration using the token
  7. View the failed build in console.

Platformify

  1. cat steps/routes.yaml .platform
  2. cat steps/services.yaml .platform
  3. cat steps/app.yaml .platform.app.yaml
  4. git add . && git commit -m "Platformify Django"
  5. git push origin main
  6. View the production build
  7. View reused build/build+deploy steps
  8. platform ssh
  9. python manage.py generate_fake_data

Upgrade to 3.10

  1. Create a branch on GitHub to view data inheritance called test
  2. git checkout -b bumppy
  3. s/type: python:3.9/type: python: 3.10
  4. git add . && git commit -m "Upgrade to Python 3.10"
  5. git push origin bumpy
  6. Open a pull request to activate
  7. Merge
  8. git merge bumppy

Sanitizing data

  1. git checkout main
  2. git checkout -b sanitize
  3. platform ssh -e main 'echo $PLATFORM_ENVIRONMENT_TYPE'
  4. platform ssh -e test 'echo $PLATFORM_ENVIRONMENT_TYPE'
  5. platform ssh
  6. echo $PLATFORM_RELATIONSHIPS
  7. echo $PLATFORM_RELATIONSHIPS | base64 --decode | jq
  8. DB_USER=$(echo $PLATFORM_RELATIONSHIPS | base64 --decode | jq -r '.database[0].username')
  9. Exit the session
  10. cp steps/sanitize.sh .
  11. chmod +x sanitize.sh
  12. git add . && git commit -m "Sanitize non-production environments"
  13. git push origin sanitize
  14. Open a pull request to activate
  15. View the now sanitized data
  16. Merge

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages