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
On Tuesday, October 19, 2021 at 12:58:47 AM UTC-4 Nikhil Tibrewal wrote:
>
> 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
>
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-appengine/3e336f5d-a568-4ae6-aafc-71d3bb3da167n%40googlegroups.com.