Prakash
Prakash

Reputation: 659

version number in Google App Engine

Hi I developed a simple Google App Engine in eclipse and I deployed it in to the Google App Engine. I came across the concept called version, the value mention in between the version tag in the appengine-web.xml will be used to store the project in the Google App Engine (if I use already existing version it will update),

<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
    <application>gradlesampleweb</application>
    <version>2</version>
    <threadsafe>true</threadsafe>
</appengine-web-app>

version in my project

I had 2 version but now I am running 20170718t184037, I mention my version number as 2 in appengine-web.xml but the version in the App Engine is different.

my question is (1) what should I need to do (in code) show that my version number to be shown by the Google App Engine(if I mention new number as 500, this should my version number in the console page)? and (2) Even I have active with 2nd version, when ever I mention any one of the url (1-dot-domainname.appspot.com), (2-dot-domainname.appspot.com) it is taking to the same web page 20170718t184037 2nd version, is it correct? (whenever I mention the 1st url it should not take me to the 20170718t184037 (2nd version) because my active version is [2-dot-domainname.appspot.com]) am I made mistake in my code?

Upvotes: 1

Views: 1141

Answers (1)

Brian de Alwis
Brian de Alwis

Reputation: 2964

If you deploy using the Google Cloud SDK (gcloud app deploy) or from within Eclipse using the Cloud Tools for Eclipse (which uses the Cloud SDK under the hood), then the version in the appengine-web.xml is ignored:

$ gcloud app deploy —help
[…]
--version=VERSION, -v VERSION
        The version of the app that will be created or replaced by this
        deployment. If you do not specify a version, one will be generated for
        you.
[…]

CT4E prompts for the version in the deploy dialog.

(1) what should I need to do (in code) show that my version number to be shown by the Google App Engine(if I mention new number as 500, this should my version number in the console page)?

If I understand correctly, see the ModuleService to get your current version.

(2) Even I have active with 2nd version, when ever I mention any one of the url 1-dot-domainname.appspot.com, 2-dot-domainname.appspot.com it is taking to the same web page 20170718t184037 2nd version, is it correct? (whenever I mention the 1st url it should not take me to the 20170718t184037 (2nd version) because my active version is 2-dot-domainname.appspot.com) am I made mistake in my code?

Fetching one version shouldn't redirect you to another. The Cloud Console's Versions page provides direct-access URLs for each version.

Upvotes: 1

Related Questions