如何在使用"gcloud app deploy"时指定github pw;用于节点项目 [英] how to specify github pw when using "gcloud app deploy" for a node project

查看:99
本文介绍了如何在使用"gcloud app deploy"时指定github pw;用于节点项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的节点应用程序占优势,因此它分为多个npm程序包.这些软件包托管在github上的私人仓库中.

My node app is on the big side, so it is split into a number of npm packages. These packages are hosted in private repos on github.

在本地PC上,我克隆了仓库,npm init,提示输入密码,npm运行,一切都很好.

Locally on my pc, I clone the repo, npm init, get prompted for password, npm run and all is good.

现在,我正尝试部署到Google Cloud App Engine(Google Cloud中的新手). 教程说要添加一个名为app.yaml的内容

Now I'm trying to deploy to google cloud app engine (newbie in google cloud). Tutorial says to add a file called app.yaml with content

env: flex
runtime: nodejs

然后输入"gcloud app deploy".第一个报告的错误是

Then I enter "gcloud app deploy". The first reported error is

npm ERR! /usr/bin/git ls-remote -h -t https://github.com/johngrabner/moch_time.git

如何为gcloud提供密码,以便它可以拉出私有软件包?

How do I provide my password for gcloud so it can pull private packages?

或者,"gcloud应用程序部署"还不够成熟吗?

Or, is "gcloud app deploy" just not mature enough?

或者,在github中使用和存储私有npm软件包是一种构造项目的奇怪方法吗?

Or, is using and storing private npm packages in github a strange way of structuring my project?

推荐答案

在部署应用程序时,gcloud命令未提供包含密码的选项.如果您想指定凭据来访问您的私有GitHub存储库,则可以遵循以下

The gcloud command does not provide an option to include a password when deploying an app. If you want to specify your credentials to access your private GitHub repositories, you can follow this link.

在开始上一教程中指示的步骤之前,您应该为GitHub身份验证生成一个新的SSH.这样做的步骤是

Before starting with the steps indicated in the previous tutorial, you should generate a new SSH for GitHub authentication. The steps to do so are here.

或者,您也可以使用源存储库将GitHub存储库连接到GCP存储库(遵循

Alternatively, you can connect your GitHub repo to a GCP repository using Source Repositories (follow this link to learn how to do it). This also allows to store your credentials for further use.

这篇关于如何在使用"gcloud app deploy"时指定github pw;用于节点项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆