google cloud platform cloud build rebuild cloud function not updated the content

孤人 提交于 2021-01-29 09:13:50

问题


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'

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);
};


回答1:


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

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']


来源:https://stackoverflow.com/questions/59882278/google-cloud-platform-cloud-build-rebuild-cloud-function-not-updated-the-content

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!