Is there a URL for the latest version of a google cloud app engine deploy? - google-app-engine

I've recently done a UI update for my website, the backend is all identical. I want to access the latest deploy (with the no-promote flag) from 'beta.my-website.com' but still access the 'normal' site from 'my-website.com'. Ideally this would dynamically serve the latest version, but if not could I set it statically to the URL with project ID? I have bought my domain from 123reg. Is there a way to direct to the latest version regardless of it's traffic serving status?
TL;DR Can you set up a 'beta' site at beta.mywebsite.com while still being able to access the live version on www.mywebsite.com on google cloud?
Any help would be greatly appreciated.
Thanks!

I don't think that can be done like that.
You could deploy to a different appengine project by putting a different project id and then have beta.mywebsite.com route to that project instead. The nice thing about this option is everything else would be isolated (i.e. no chance of your beta changes causing bad data in your production database, or tasks in your queues)
Another option would be to deploy to a different service within your project and use your dispatch.yaml to route beta.mywebsite.com to it https://cloud.google.com/appengine/docs/standard/python3/reference/dispatch-yaml
A third option would be to put beta as your version-id, and have your DNS redirect beta.mywebsite.com to beta-dot-your_project_id.appspot.com. However, when the user goes to beta.mywebsite.com they would ultimately see beta-dot-your_project_id.appspot.com in the URL bar. Also, when you're ready to go live, you would want to redeploy and promote that new version id and not promote the beta version-id.

Related

Force upload with several google appengine applications sharing files

I have two Google App Enginge application id:s, let's say App1 and App2. App1 is version for beta testers, App2 is public version of the same application. Idea is to deploy application first with application id 'App1', beta test it, and then deploy the same application with application id 'App2'.
I have problems with this sequence:
I do changes for beta testing and deploy it to App1 -> All changed
files deployed OK
Beta testing is done using App1 -> Beta testers are happy
I deploy the same application (just change application id in
Eclipse's 'Deploy to App Engine' dialog) to App2, because I want it
public. Now the problem is that no files are deployed. Is the reason
that there are already the same files deployed to app engine? But
they are in App1, so App2 does not work.
Any suggestions how to do force upload for all files? Or any other way around this problem?
BR, Seppo
Try also altering the version to something not previously used when deploying to the second Application ID. Alternatively it may help to delete the version you're about to deploy to (although you cannot delete the default version). Such changes might flush some cache in Eclipse of assumptions about what was previously deployed.
The uploader seems to transfer only what is newer than the destination. That suggests another potential cause of your problem. Your symptoms might occur if the local computer's clock is somewhat behind the one in AppEngine. It is not very likely, but possible.

GAE: Can I copy an entire app to another identifier?

I recall seeing an option on the google app engine admin page that would allow me to duplicate/copy a deployment to a different appid. Was I imagining this? I do have a copy of all the files needed for deployment but I do not currently have access to a computer with admin privileges in order to install the GAE SDK.
Not relevant to this question, but FYI I need to do this simply because there is a major bug that's preventing me from logging in to a particular part of the admin interface and google tech support has failed to resolve the issue, so I'm just trying a workaround.
Copy old settings to new app via the admin console admin>application settings>Duplicate Application Settings. (you'll choose new appid here too)
Then upload a version of your code to the new appId (so you'll need gae sdk or use online sdk devtable).
Then go to datastore admin in the old app, select all the entities and choose "copy to another app" You'll need datastore admin to be enabled on the old app (and new app I think).

Google App Engine not updating deployed files

I'm getting some strange issues with google app engine serving old versions of files. I have included some logging in one of my servlets and deployed to google app engine several times over the last 24 hours. However, instead of seeing the logging i added, I'm seeing logs from a previous version of the file every time the servlet runs.
I've tried changing versions and redeploying but this doesnt seem to fix the problem.
I'm using Eclipse Juno with the app engine plugin if that makes a difference.
Any ideas what I can try or what I might be doing wrong?
I had a similar problem recently, and that I fixed by logging into appengine.google.com>MyAppIdentifier>(Main)>Versions and selecting the current version as the default.
This should not only serve your latest version, but also use the latest version for log viewing and other administrative tasks.
In the logs, make sure that you're checking the correct version:
Otherwise redeploy to a brand new version and check that version explicitly directly from the version url that can be found under the Versions section.
Make sure that before redeploying your APP after making changes you Remove Launch and Remove All Terminated launches by pressing the double cross buttons next to the "clear console" buttons on the console window in Eclipse...I hope this solve your problem.
December 2020 Answer
Not sure if this is an account or billing specific setting, but I found that App Engine started not updating to my latest app deploy once I reached 50 Versions in my App Engine list.
After deleting a bunch of old versions (taking down to 30) on next deploy it picked up my latest changes immediately.
It could be due to caching issue. Try reloading the website by adding a query parameter . Eg <website-url>?q=1 and see if changes are reflected
Open the url -> latest-version-number-dot-website-url . Latest version number can be obtained by clicking on version menu item on the side bar as seen below
If you have app.yaml file in your source code. Try removing headers related to caching and deploy and check to confirm its a caching issue. Caching headers could be of below form
Cache-Control: public, max-age=604800, immutable
Also make sure your project compiles correctly and doesn't contain any errors. I had this problem basically because I was deploying old compiled code, while it gave me an error "you have errors in your project, are you sure you want to deploy?"
I tried all the suggestions on SO, but ultimately, I found the best fix.
Because I transferred domain names and web hosting, I neglected to change my Domain's Resource Records. After making sure my code worked properly with the application (appname.appspot.com), I created a Custom Domain found in Console menu > App Engine > Settings > Custom domains
After you add the custom domain, make sure you change your Domain setting's CNAME www alias to the prescribed value (for me it was ghs.googlehosted.com).
Since changing that CNAME value, all of my subsequent deploys updated immediately. Hope this works for you and all others. Happy coding!
The gcloud (at list in python) has problem with line 'skip_files' in app.yaml,
So you can try the old method of deploying app with app engine,
use appcfg.py instead of gcloud.
see how in https://cloud.google.com/appengine/docs/standard/python/tools/uploadinganapp

Going back to original alias after GAE migration

I have just completed a migration from a master/slave to HRD. During this migration I was forced to change my app name from myapp.appspot.com to myapp-hrd.appspot.com. I have set up an alias so my users can still use the old site url.
But I find it rather messy to have two apps where the one just forward requests to the other.
Is there any way I can migrate my new myapp-hrd back to myapp?
The only way I can think of is to erase my old myapp and then migrate from myapp-hrd to it, but it takes 3 days to delete an GAE app. And 3 days downtime is not an option. I have to keep myapp running since the url is hardcoded in a lot of android phones.
Even if you delete your old app, you won't be able to create a new app with the same identifier. Did you use the migration tool? If so, the new application should now be serving both the new and old app URLs. Otherwise, I recommend you report a production issue so that someone from Google links the apps manually.

What is the difference between version.myappid.appspot.com and version.latest.myappid.appspot.com?

The Google App Engine documentation says that the URL to access a specific version of an app deployed is .latest..appspot.com. The GAE admin webpage however links to ..appspot.com in the Versions tab and omits the 'latest'.
Any idea what that 'latest' is for? Is it actually not needed? Is omitting it not taking you the latest code deployed for that specific version?
References:
https://developers.google.com/appengine/docs/java/config/appconfig
The *.latest.app.appspot.com convention was originally the only way to access a specific version of your app. This was changed to simply accessing them directly as subdomains a while ago; latest was kept as a special case so as not to break old URLs.

Resources