- Open a free trial account on Platform.sh
- Create an empty project
- Install the Platform.sh CLI
- Generate a repo from the template starting point at https://github.com/platformsh-examples/django
- Clone the repo locally
platform project:list
platform project:set-remote PROJECT_ID
- Create a GitHub API token
- Setup the integration using the token
- View the failed build in console.
cat steps/routes.yaml .platform
cat steps/services.yaml .platform
cat steps/app.yaml .platform.app.yaml
git add . && git commit -m "Platformify Django"
git push origin main
- View the production build
- View reused build/build+deploy steps
platform ssh
python manage.py generate_fake_data
- Create a branch on GitHub to view data inheritance called
test
git checkout -b bumppy
- s/
type: python:3.9
/type: python: 3.10
git add . && git commit -m "Upgrade to Python 3.10"
git push origin bumpy
- Open a pull request to activate
- Merge
git merge bumppy
git checkout main
git checkout -b sanitize
platform ssh -e main 'echo $PLATFORM_ENVIRONMENT_TYPE'
platform ssh -e test 'echo $PLATFORM_ENVIRONMENT_TYPE'
platform ssh
echo $PLATFORM_RELATIONSHIPS
echo $PLATFORM_RELATIONSHIPS | base64 --decode | jq
DB_USER=$(echo $PLATFORM_RELATIONSHIPS | base64 --decode | jq -r '.database[0].username')
- Exit the session
cp steps/sanitize.sh .
chmod +x sanitize.sh
git add . && git commit -m "Sanitize non-production environments"
git push origin sanitize
- Open a pull request to activate
- View the now sanitized data
- Merge