Octopus Deploy octo-pack 包含一个文件夹
Octopus Deploy octo-pack is including a folder
我正在使用 Octopus Deploy 将 angular 应用程序部署到 Azure。为此,我使用了 grunt-octo
,它将部署打包到 nuget 包中并将其发送到 Octopus Deploy。
此过程的打包部分是从 dist 文件夹中获取文件。这是 G运行t 脚本的 octo-pack
部分:
'octo-pack': {
prod: {
options: {
dst: './bin'
},
src: ['dist/**/*']
}
}
但是,这包括部署中的 dist
文件夹,因此我的文件位于 Azure 中的 dist 文件夹中。
我一直无法找到一种方法来获取文件夹中的文件。
Octopus Deploy 允许您 运行 Powershell 脚本作为流程的一部分,但我认为这不是一个好的解决方案。
有人有什么想法吗?
我在八达通论坛找到了这个答案:
http://help.octopusdeploy.com/discussions/problems/47569-grunt-octopack
文章的关键部分是这样的:
The grunt-octo modules currently does not support the dynamic file list feature provided by grunt
这会使 CDW(当前工作目录)部分无法正常工作。
我已经提交了这个 Pull Request 以添加一些额外的参数来解决这个问题:
https://github.com/OctopusDeploy/grunt-octo/pull/2
这为选项添加了 2 个新参数,您可以在其中指定是否要删除父文件夹并指定要删除的文件夹的名称:
options: {
dst: './bin',
removeParent: true,
parentDir: 'dist'
}
更新:
自从我提交了 Pull Request 之后,包已经更新以支持工作目录。这现在将使用以下代码工作:
'octo-pack': {
prod: {
options: {
dst: './bin'
},
src: ['**/*'],
cwd: 'dist'
}
},
我正在使用 Octopus Deploy 将 angular 应用程序部署到 Azure。为此,我使用了 grunt-octo
,它将部署打包到 nuget 包中并将其发送到 Octopus Deploy。
此过程的打包部分是从 dist 文件夹中获取文件。这是 G运行t 脚本的 octo-pack
部分:
'octo-pack': {
prod: {
options: {
dst: './bin'
},
src: ['dist/**/*']
}
}
但是,这包括部署中的 dist
文件夹,因此我的文件位于 Azure 中的 dist 文件夹中。
我一直无法找到一种方法来获取文件夹中的文件。
Octopus Deploy 允许您 运行 Powershell 脚本作为流程的一部分,但我认为这不是一个好的解决方案。
有人有什么想法吗?
我在八达通论坛找到了这个答案: http://help.octopusdeploy.com/discussions/problems/47569-grunt-octopack
文章的关键部分是这样的:
The grunt-octo modules currently does not support the dynamic file list feature provided by grunt
这会使 CDW(当前工作目录)部分无法正常工作。
我已经提交了这个 Pull Request 以添加一些额外的参数来解决这个问题: https://github.com/OctopusDeploy/grunt-octo/pull/2
这为选项添加了 2 个新参数,您可以在其中指定是否要删除父文件夹并指定要删除的文件夹的名称:
options: {
dst: './bin',
removeParent: true,
parentDir: 'dist'
}
更新:
自从我提交了 Pull Request 之后,包已经更新以支持工作目录。这现在将使用以下代码工作:
'octo-pack': {
prod: {
options: {
dst: './bin'
},
src: ['**/*'],
cwd: 'dist'
}
},