gpt4 book ai didi

laravel - 持续集成 - 不要使用 bitbucket 管道将 laravel .env 文件移动到 azure

转载 作者:行者123 更新时间:2023-12-02 23:44:13 25 4
gpt4 key购买 nike

我已经使用 bitbucket 管道将所有内容设置为持续集成到 Azure,但 .env 文件和供应商 autoload_classmap 文件正在转移到生产环境,这对生产产生了严重影响。

如何限制将 .env 文件从 bitbucket 移动到 azure 的操作?

提前致谢

最佳答案

如果您想避免发送文件但将其提交到存储库中,只需在将其发送到 Azure 之前对管道文件执行 rm 操作即可。您可以为不同的分支定义不同的步骤,以便您可以仅为生产分支编写此步骤。例如,在您的 bitbucket-pipelines.yml 文件中,您可以包含以下内容:

branches:
production: #If your branch name is production, do only on production branch
- step:
name: your-step-name

script:
- your-steps #Whatever your steps are
- rm .env #This will remove the .env file
- rm vendor/composer/autoload_classmap.php #This will remove the classmap file
- send-to-azure #Then when sending your code to Azure the files won't be present

这个例子非常粗略,因为我们仍然需要知道很多变量,比如,你在生产工件吗?您的管道 yml 文件是如何组织的?如果您可以发布您的 bitbucket-pipelines.yml 文件,我可以编写一个更简洁的示例。

关于laravel - 持续集成 - 不要使用 bitbucket 管道将 laravel .env 文件移动到 azure,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55096645/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com