0

设想

我正在尝试运行以从Azure DevOps 中ask deploy的发布代理部署 Alexa Skill 。ubuntu-20.04我正在使用 AWS Shell Script 任务,根据描述

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

我在 DevOps as a Service Connection 中设置了凭据,因此它确实可以安全地访问这些值。所以现在这个任务公开了我的访问密钥、秘密和区域,我只是添加了一个脚本来导出(我认为)成功执行所需的最后两个环境变量:

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"
      }
    }
  }
}

发布作业定义:

在此处输入图像描述

发布日志:

####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.
4

0 回答 0