Incremental upload skipping JSON file

61 views
Skip to first unread message

Nikhil Tibrewal

unread,
Oct 19, 2021, 12:58:47 AM10/19/21
to Google App Engine

Hi,

I have an AppEngine project deployed through CloudBuild. For some reason, one of the files in the directory (a .json file) isn't getting uploaded in incremental upload.

Setup:
I'm using cloudbuild to deploy my app. Relevant steps are:

# List files in the directory for convenience purposes.
- name: 'gcr.io/cloud-builders/gcloud'
entrypoint: 'bash'
args: ['-c', 'ls -al /workspace']

# Upload source files to GCS staging bucket, build images and upload to GCR, promote new version.
- name: 'gcr.io/cloud-builders/gcloud'
args: ['app', 'deploy', 'app_${_ENV}.yaml', '--verbosity=debug', '--promote']

  1. I can see the file in the "ls -al" step
  2. My setup has 2 triggers: one deploys to staging env, and one deploys to production. Both triggers are connected to my github repo. All pushes to staging branch trigger the staging deploy step, and that has the file in incremental uploads. However, merges of that code into production branch don't end up including that file in the deploy to production trigger.
  3. I even tried to push a commit with just a single change to the JSON file. Staging trigger included it in incremental uploads, production did not (even though production was triggered by merging the same staging PR into production branch)
  4. The json file is even listed in the included files filter to ensure changes to that file trigger the builds. It is not listed in excluded files filter.
What could be happening here that's skipping the file in one trigger, but not the other? They're being pushed exactly the same code, so why is one build not recognizing the difference?

Thanks so much in advance.
Nikhil

Nikhil Tibrewal

unread,
Oct 19, 2021, 8:17:16 PM10/19/21
to Google App Engine
I figured out the issue. The 2 cloudbuild triggers both use the same "staging.project_id.appspot.com" bucket. So when the staging service is deployed, newly updated files are uploaded. But when the production service is deployed, the file hasn't changed compared to what's currently in the staging bucket, so the upload is skipped.

So a few questions:
1) Can i specify a different staging bucket to use when deploying appengine apps?
2) Is there a step I can add to the cloudbuild that "touches" all files and hence uploads all of them? (this is not ideal though because it increases build time unnecessarily)
3) If i can't specify a staging bucket, do I have to use 2 buckets, one per service?

Best,
Nikhil

NoCommandLine

unread,
Oct 20, 2021, 3:15:10 PM10/20/21
to Google App Engine
>>> Can i specify a different staging bucket to use when deploying appengine apps?<<<

I think so (haven't tried it myself & so can't confirm it works). The documentation has a flag --bucket which it describes as .....The Google Cloud Storage bucket used to stage files associated with the deployment. If this argument is not specified, the application's default code bucket is used


..... NoCommandLine ......
 https://nocommandline.com

A GUI for Google App Engine
Reply all
Reply to author
Forward
0 new messages