Конфигурация пакета serverless-openwhisk не включает файлы - PullRequest
0 голосов
/ 01 июля 2018

Я пытаюсь индивидуально упаковать свои действия openwhisk, используя безсерверный фреймворк. Мое действие просто распечатывает все файлы и каталоги из "./"

Моя проблема в том, что я нигде не могу найти включенные файлы "workflow.js" и "workflow.json". Они вообще включены? Каталог src также не содержит файлов, он содержит только файл с именем "service.js"

"2018-07-01T12:43:39.856352769Z stdout: .dockerignore",
"2018-07-01T12:43:39.856367445Z stdout: 5u3RVNXU",
"2018-07-01T12:43:39.856373403Z stdout: CHANGELOG.md",
"2018-07-01T12:43:39.856379151Z stdout: README.md",
"2018-07-01T12:43:39.856385821Z stdout: Vr6M5n51",
"2018-07-01T12:43:39.8566812Z   stdout: app.js",
"2018-07-01T12:43:39.856696174Z stdout: node_modules",
"2018-07-01T12:43:39.856702235Z stdout: package-lock.json",
"2018-07-01T12:43:39.856707997Z stdout: package.json",
"2018-07-01T12:43:39.856714673Z stdout: runner.js",
"2018-07-01T12:43:39.856974881Z stdout: src"

Мой serverless.yml выглядит так:

service: private-cloud

provider:
  name: openwhisk
  versionFunctions: false
  stage: ${opt:stage, 'dev'}

package:
  individually: true
  exclude:
    - ./**
  include:
    - node_modules/**
    - workflow.js
    - workflow.json

functions:
  action1:
    handler: handler1.hello
    name: action1Handler
    package:
      include:
        - handler1.js
  action2:
    handler: handler2.hello
    name: action2Handler
    package:
      include:
        - handler2.js
    events: # All events associated with this function
      - http: POST /api/${self:functions.action2.name}
  action3:
    handler: handler3.hello
    name: action3Handler
    package:
      include:
        - handler3.js
  action4:
    handler: handler4.hello
    name: action4Handler
    package:
      include:
        - handler4.js
  action5:
    handler: handler5.hello
    name: action5Handler
    package:
      include:
        - handler5.js
    events: # All events associated with this function
      - http: POST /api/${self:functions.action5.name}

# Add the serverless-openwhisk plugin
# https://github.com/serverless/plugins
plugins:
  - serverless-openwhisk

1 Ответ

0 голосов
/ 01 июля 2018

Известна открытая проблема https://github.com/apache/incubator-openwhisk-runtime-nodejs/issues/57

Чтобы найти корень src из zip, используйте переменную nodejs __dirname

Как let filePath = __dirname + «/workflow.jsonoted

...