可以使用以下步骤来在Bitbucket Pipelines中运行迁移:
python manage.py migrate
deploy.sh
,则可以添加以下代码:pipelines:
default:
- step:
name: Deploy to Production
deployment: production
script:
- ./deploy.sh
这将在部署到生产环境时运行deploy.sh
脚本,其中包含运行迁移的命令。
- DATABASE_URL=postgres://user:password@host:port/dbname
这将确保迁移命令能够连接到正确的数据库。
通过以上步骤,你就可以在Bitbucket Pipelines中运行迁移了。