在Azure DevOps版本中使用Ask部署时出错

问题描述

场景

我正在尝试运行ask deploy来从Azure DevOps中的ubuntu-20.04发布代理部署Alexa Skill。我正在使用AWS Shell脚本任务,根据说明

在Bash中运行Shell脚本,设置AWS凭证和区域 使用标准环境将信息放入外壳环境 密钥AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,AWS_SESSION_TOKEN和 AWS_REGION。

我在DevOps中将凭据设置为服务连接,因此它确实可以安全地访问这些值。因此,既然此任务公开了我的访问密钥,秘密和区域,我只需添加一个脚本即可导出(我认为)成功执行所需的最后两个env变量:

export ASK_REFRESH_TOKEN="$(ASK_REFRESH_TOKEN)"
export ASK_vendOR_ID="$(ASK_vendOR_ID)"

为了确保它能正常工作,我在脚本中添加ask smapi get-vendor-list并获得了预期的输出,其中显示了我的供应商ID,名称和角色。太酷了-它一定可以正常工作。

问题

现在ask deploy出现以下错误

CliError:在ask-resources.json中找不到技能包src

而且我似乎无法绕开它。

我已经尝试过...

  1. 下载构建工件并在本地运行ask deploy。那行得通,所以我知道构建或技能包的构成没有问题。
  2. 更新刷新令牌
  3. 验证是否从正确的目录中调用了命令
  4. 验证目录是否包含正确的文件

问题

我该如何解决错误并成功地从发布代理ask deploy来>

参考

我正在使用ASK-CLI v2.16.0

如果有用的话,这里是我的ask-resources.json。错误提到了此文件

{
  "askcliResourcesversion": "2020-03-31","profiles": {
    "default": {
      "skillMetadata": {
        "src": "./skill-package"
      },"code": {
        "default": {
          "src": "./lambda"
        }
      },"skillInfrastructure": {
        "userConfig": {
          "runtime": "nodejs12.x","handler": "index.handler","templatePath": "./infrastructure/cfn-deployer/skill-stack.yaml","awsRegion": "us-east-1"
        },"type": "@ask-cli/cfn-deployer"
      }
    }
  }
}

发布职位定义:

enter image description here

发布日志:

####Task Permissions
Permissions for this task to call AWS service APIs depend on the activities in the supplied script.
2020-09-29T12:27:05.4760730Z ==============================================================================
2020-09-29T12:27:05.6858528Z Configuring credentials for task
2020-09-29T12:27:05.6863319Z ...configuring AWS credentials from service endpoint 'redacted'
2020-09-29T12:27:05.6863708Z ...endpoint defines standard access/secret key credentials
2020-09-29T12:27:05.6879415Z Configuring region for task
2020-09-29T12:27:05.6882489Z ...configured to use region us-east-1,defined in task.
2020-09-29T12:27:05.6917304Z [command]/usr/bin/bash /home/vsts/work/_temp/awsshellscript_2266.sh
2020-09-29T12:27:09.2056323Z npm WARN deprecated request@2.88.2: request has been deprecated,see https://github.com/request/request/issues/3142
2020-09-29T12:27:15.3303791Z npm WARN deprecated har-validator@5.1.5: this library is no longer supported
2020-09-29T12:27:20.4277268Z /usr/local/bin/ask -> /usr/local/lib/node_modules/ask-cli/bin/ask.js
2020-09-29T12:27:20.4466577Z 
2020-09-29T12:27:20.4475010Z > dtrace-provider@0.8.8 install /usr/local/lib/node_modules/ask-cli/node_modules/dtrace-provider
2020-09-29T12:27:20.4476929Z > node-gyp rebuild || node suppress-error.js
2020-09-29T12:27:20.4477558Z 
2020-09-29T12:27:20.8448748Z gyp WARN EACCES current user ("nobody") does not have permission to access the dev dir "/root/.cache/node-gyp/12.18.4"
2020-09-29T12:27:20.8507717Z gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/ask-cli/node_modules/dtrace-provider/.node-gyp"
2020-09-29T12:27:20.8519281Z gyp WARN install got an error,rolling back install
2020-09-29T12:27:20.8535248Z gyp WARN install got an error,rolling back install
2020-09-29T12:27:20.8551818Z gyp ERR! configure error 
2020-09-29T12:27:20.8555760Z gyp ERR! stack Error: EACCES: permission denied,mkdir '/usr/local/lib/node_modules/ask-cli/node_modules/dtrace-provider/.node-gyp'
2020-09-29T12:27:20.8559344Z gyp ERR! System Linux 5.4.0-1025-azure
2020-09-29T12:27:20.8560532Z gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
2020-09-29T12:27:20.8571334Z gyp ERR! cwd /usr/local/lib/node_modules/ask-cli/node_modules/dtrace-provider
2020-09-29T12:27:20.8572691Z gyp ERR! node -v v12.18.4
2020-09-29T12:27:20.8573700Z gyp ERR! node-gyp -v v5.1.0
2020-09-29T12:27:20.8574490Z gyp ERR! not ok 
2020-09-29T12:27:20.9460739Z 
2020-09-29T12:27:20.9462350Z > ask-cli@2.16.1 postinstall /usr/local/lib/node_modules/ask-cli
2020-09-29T12:27:20.9463103Z > node postinstall.js
2020-09-29T12:27:20.9463477Z 
2020-09-29T12:27:20.9839474Z 
2020-09-29T12:27:20.9840246Z ================================================================================
2020-09-29T12:27:20.9844532Z ASK CLI collects telemetry to better understand customer needs. You can
2020-09-29T12:27:20.9845738Z OPT OUT and disable telemetry by setting the 'share_usage' key to 'false' 
2020-09-29T12:27:20.9846574Z in '~/.ask/cli_config'.
2020-09-29T12:27:20.9846928Z 
2020-09-29T12:27:20.9847554Z Learn more: https://developer.amazon.com/docs/alexa/smapi/ask-cli-telemetry.html
2020-09-29T12:27:20.9848513Z ================================================================================ 
2020-09-29T12:27:20.9848861Z 
2020-09-29T12:27:20.9933073Z + ask-cli@2.16.1
2020-09-29T12:27:20.9933710Z added 233 packages from 243 contributors in 13.497s
2020-09-29T12:27:21.2144126Z /home/vsts/work/r1/a/BuildArtifact/drop/projectname
2020-09-29T12:27:21.2154300Z total 44
2020-09-29T12:27:21.2155074Z drwxr-xr-x 6 vsts docker  4096 Sep 29 12:27 .
2020-09-29T12:27:21.2155522Z drwxr-xr-x 3 vsts docker  4096 Sep 29 12:27 ..
2020-09-29T12:27:21.2156597Z drwxr-xr-x 2 vsts docker  4096 Sep 29 12:27 .ask
2020-09-29T12:27:21.2157145Z -rw-r--r-- 1 vsts docker    46 Sep 29 12:27 .gitignore
2020-09-29T12:27:21.2157583Z -rw-r--r-- 1 vsts docker 11358 Sep 29 12:27 LICENSE.txt
2020-09-29T12:27:21.2158041Z -rw-r--r-- 1 vsts docker   537 Sep 29 12:27 ask-resources.json
2020-09-29T12:27:21.2158482Z drwxr-xr-x 3 vsts docker  4096 Sep 29 12:27 infrastructure
2020-09-29T12:27:21.2158917Z drwxr-xr-x 3 vsts docker  4096 Sep 29 12:27 lambda
2020-09-29T12:27:21.2159407Z drwxr-xr-x 4 vsts docker  4096 Sep 29 12:27 skill-package
2020-09-29T12:27:22.9397766Z {
2020-09-29T12:27:22.9398441Z   "vendors": [
2020-09-29T12:27:22.9398789Z     {
2020-09-29T12:27:22.9399540Z       "id": "***",2020-09-29T12:27:22.9399972Z       "name": "redacted",2020-09-29T12:27:22.9400496Z       "roles": [
2020-09-29T12:27:22.9400870Z         "ROLE_DEVELOPER"
2020-09-29T12:27:22.9401186Z       ]
2020-09-29T12:27:22.9401481Z     }
2020-09-29T12:27:22.9402201Z   ]
2020-09-29T12:27:22.9402497Z }
2020-09-29T12:27:23.9621180Z [Error]: CliError: Skill package src is not found in ask-resources.json.

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...