Skip to content

GCP Deployment Manager is running yarn again (instead of using packaged file from Serverless) #263

Open
@Lusitaniae

Description

@Lusitaniae

I'm deploying two functions from my CI/CD pipeline

One in AWS, one in GCP

Both of them are pulling repos from our private Gitlab besides all the other public dependencies from npm.

It seems that after serverless packages and uploads the packge to Google Cloud, GCP Deployment Manager is running Yarn again and failing at the yarn step because it's unable to authenticate to our private repos?

Is that expected?

I'd expect a consistent behavior with AWS deployments but GCP stands out?

Serverless: Invoke deploy
Serverless: Invoke package
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Compiling function "gcp-function-test"...
Serverless: Uploading artifacts...
Serverless: Artifacts successfully uploaded...
Serverless: Updating deployment...
Serverless: Checking deployment update progress...
................ 
  Error --------------------------------------------------
 
  Error: Deployment failed: RESOURCE_ERROR
  
       {"ResourceType":"gcp-types/cloudfunctions-v1:projects.locations.functions","ResourceErrorCode":"400","ResourceErrorMessage":"Build failed: yarn install v1.22.4\n[1/4] Resolving packages...\n[2/4] Fetching packages...\nerror Command failed.\nExit code: 128\nCommand: git\nArguments: ls-remote --tags --heads [email protected]:my-team/my-project-1\nDirectory: /workspace\nOutput:\nHost key verification failed.\r\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.\ninfo Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.; Error ID: 98e389b6"}
      at throwErrorIfDeploymentFails (/home/user/workspace/org/app/app1/node_modules/serverless-google-cloudfunctions/shared/monitorDeployment.js:71:11)
      at /home/user/workspace/org/app/app1/node_modules/serverless-google-cloudfunctions/shared/monitorDeployment.js:42:17
      at processTicksAndRejections (internal/process/task_queues.js:97:5)
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information ---------------------------
     Operating System:          linux
     Node Version:              14.4.0
     Framework Version:         2.1.1 (standalone)
     Plugin Version:            4.0.4
     SDK Version:               2.3.2
     Components Version:        3.1.3

cat package.json 
{
  "name": "app1",
  "version": "1.0.0",
  "description": "",
  "main": "src/index.js",
  "author": "",
  "license": "ISC",
  "dependencies": {
    "app": "git+ssh://[email protected]:my-team/my-project#branch-name"
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions