简体   繁体   English

在章鱼部署期间更改文件名

[英]Change file name during Octopus Deploy

I need to provide variable for different environments. 我需要为不同的环境提供变量。 For each environment I need to change names for certain files. 对于每种环境,我需要更改某些文件的名称。 What is best way to change names of certain files on Octopus Deploy? 在Octopus Deploy上更改某些文件的名称的最佳方法是什么? Is it possible with some existing Octopus functionality or I need to run PowerShell script for that purpose? 现有的某些章鱼功能是否可能,或者为此目的我需要运行PowerShell脚本吗?

Thanks 谢谢

There's no out of the box Octopus functionality to do this so you'd need to write some powershell. 没有开箱即用的章鱼功能可以执行此操作,因此您需要编写一些powershell。 This could be a powershell deployment step, or a pre / post deploy script within your Nuget package step. 这可以是Powershell部署步骤,也可以是Nuget软件包步骤中的部署前/部署后脚本。 These doco on Powershell scripts here . 这些关于Powershell脚本的文档在这里

You can also access the environment name from your script by looking at a System Variable , or if you like set a variable yourself and scope it to the environment. 您还可以通过查看系统变量从脚本中访问环境名称,或者如果您愿意自己设置变量并将其范围限定于环境,则可以访问该环境名称。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM