谷歌云平台云构建重建云功能未更新内容 [英] google cloud platform cloud build rebuild cloud function not updated the content

本文介绍了谷歌云平台云构建重建云功能未更新内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将文件放在Github上,并与Google Cloud Repository连接.以下是.yaml文件,当我更新index.js文件时,Cloud Build会重建Cloud Function,但是为什么内容没有更新?手动设置Cloud Function可以正常工作

I put the file on Github and connected with Google Cloud Repository. Below is the .yaml file, when I update my index.js file, the Cloud Build rebuilds the Cloud Function, but why the content didn't get updated? Manually setup for Cloud Function works

steps:
- name: 'gcr.io/cloud-builders/yarn'
  args: ['install']
  dir: 'functions/autodeploy'
- name: 'gcr.io/cloud-builders/gcloud'
  args: ['functions', 'deploy', 'function-1', '--trigger-http', '--runtime', 'nodejs10', '--entry-point', 'firstci']
  dir: 'functions/autodeploy'

下面是从index.js导出的函数,现在Cloud Function应该输出"finally test",但是在重建之后,它仍然输出"test 3rd time"

Below is the function exported from index.js, now Cloud Function should output "test finally", but after rebuild, it still output "test 3rd time"

exports.firstci = (req, res) => {
  let message = req.query.message || req.body.message || 'setup pineline, test finally cloud build!';
  res.status(200).send(message);
};

推荐答案

Nodejs 10 Runtime仍处于beta中.尝试将beta如下所示放入您的cloudbuild.yaml文件中,并删除2个目录行,因为这不是必需的.

Nodejs 10 Runtime is still in beta. Try to put beta as following in your cloudbuild.yaml file and remove the 2 dir lines because it's not necessary.

cloudbuild.yaml

cloudbuild.yaml

steps:
  - name: 'gcr.io/cloud-builders/yarn'
    args: ['install']
  - name: 'gcr.io/cloud-builders/gcloud'
    args: ['beta','functions', 'deploy', 'function-1', '--trigger-http', '-- runtime', 'nodejs10', '--entry-point', 'firstci']

这篇关于谷歌云平台云构建重建云功能未更新内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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