adobe / aio-cli-plugin-runtime

Adobe I/O Runtime plugin for the Adobe I/O CLI
https://www.adobe.io
Apache License 2.0
15 stars 31 forks source link

AIO-CLI cannot deploy APIs under the same <base path> #154

Closed ekremney closed 4 years ago

ekremney commented 4 years ago

manifest.yml:

packages:
  __APP_PACKAGE__:
    version: 1.0.0
    license:  Adobe-2006
    actions:
      getDogs:
        function: dist/getVehicles
        runtime: nodejs:10
        # action def.
      getCat:
        function: dist/getPets
        runtime: nodejs:10
        # action def.
    apis:
      animal-service:      # api name
        animal-service:    # base path
          dogs:
            getDogs:
              method: get
              response: http
          cats:
            getCat:
              method: get
              response: http

After aio app:deploy, only/animal-service/dogs gets deployed. Here's the output:

> Build actions
ℹ dist/actions/getDogs.zip
ℹ dist/actions/getCat.zip
✔ Build actions
no web-src, skipping web-src build
> Deploy actions
ℹ Info: Deploying package [actions-playground-1.5.4]...
ℹ Info: package [actions-playground-1.5.4] has been successfully deployed.
ℹ Info: Deploying action [actions-playground-1.5.4/getDogs]...
ℹ Info: action [actions-playground-1.5.4/getDogs] has been successfully deployed.
ℹ Info: Deploying action [actions-playground-1.5.4/getCat]...
ℹ Info: action [actions-playground-1.5.4/getCat] has been successfully deployed.
ℹ Info: Deploying api [animal-service]...
ℹ Info: api [animal-service] has been successfully deployed.
ℹ Success: Deployment completed successfully.
✔ Deploy actions
no web-src, skipping web-src deploy
Your deployed actions:
  -> https://<namespace>.adobeioruntime.net/api/v1/web/actions-playground-1.5.4/getDogs 
  -> https://<namespace>.adobeioruntime.net/api/v1/web/actions-playground-1.5.4/getCat 
Well done, your app is now online

Cause of the problem seems to be relevant code piece iterating over apis only. It should be also iterating over basePaths. Please see:

https://github.com/adobe/aio-cli-plugin-runtime/blob/master/src/runtime-helpers.js#L654

sarahxxu commented 4 years ago

we suspect the gap where we take the first item only may also exist with rules/triggers/etc. o

solaris007 commented 4 years ago

PR available: https://github.com/adobe/aio-cli-plugin-runtime/pull/156

meryllblanchet commented 4 years ago

Fixed with #156