我目前正在关注https://cloud.google.com/cloud-build/docs/access-private-github-repos但我被卡住了,我不确定是否理解。
事实上,我做了以下事情:
MBP-de-Emixam23:security-service emixam23$ gcloud kms keyrings create id_rsa --location=global
MBP-de-Emixam23:security-service emixam23$ gcloud kms keys create gitlab-key --location=global --keyring=id_rsa --purpose=encryption
MBP-de-Emixam23:security-service emixam23$ gcloud kms encrypt --plaintext-file=~/.ssh/id_rsa --ciphertext-file=~/.ssh/id_rsa.enc --location=global --keyring=id_rsa --key=gitlab-key
ERROR: (gcloud.kms.encrypt) Failed to read plaintext file [~/.ssh/id_rsa]: Unable to read file [~/.ssh/id_rsa]: [Errno 2] No such file or directory: '~/.ssh/id_rsa'
MBP-de-Emixam23:security-service emixam23$ cat ~/.ssh/id_rsa
-----BEGIN RSA PRIVATE KEY-----
.....
-----END RSA PRIVATE KEY-------
有人可以告诉我在哪里gcloud kms
寻找吗?我实际上需要它用于谷歌云构建触发目的
谢谢 !
编辑 1 - 为约翰的评论添加了详细信息
DEBUG: Running [gcloud.kms.encrypt] with arguments: [--ciphertext-file: "~/.ssh/id_rsa.enc", --key: "gitlab-key", --keyring: "id_rsa", --location: "global", --plaintext-file: "~/.ssh/id_rsa", --verbosity: "debug"]
DEBUG: (gcloud.kms.encrypt) Failed to read plaintext file [~/.ssh/id_rsa]: Unable to read file [~/.ssh/id_rsa]: [Errno 2] No such file or directory: '~/.ssh/id_rsa'
Traceback (most recent call last):
File "/Users/emixam23/google-cloud-sdk/lib/googlecloudsdk/calliope/cli.py", line 984, in Execute
resources = calliope_command.Run(cli=self, args=args)
File "/Users/emixam23/google-cloud-sdk/lib/googlecloudsdk/calliope/backend.py", line 798, in Run
resources = command_instance.Run(args)
File "/Users/emixam23/google-cloud-sdk/lib/surface/kms/encrypt.py", line 90, in Run
args.plaintext_file, e))
BadFileException: Failed to read plaintext file [~/.ssh/id_rsa]: Unable to read file [~/.ssh/id_rsa]: [Errno 2] No such file or directory: '~/.ssh/id_rsa'
ERROR: (gcloud.kms.encrypt) Failed to read plaintext file [~/.ssh/id_rsa]: Unable to read file [~/.ssh/id_rsa]: [Errno 2] No such file or directory: '~/.ssh/id_rsa'