Announcement Announcement Module
Collapse
No announcement yet.
Deploy To Cloud Foundary As Prod Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Deploy To Cloud Foundary As Prod

    It looks like the war of a grails app that gets deployed to cloud foundry from STS has the environment set to development. How do I get it set to production?

  • #2
    Right click on your project and go to "properties >> Grails >> Run on server". You should be able to change the grails environment for the run on server functionality there.

    Kris

    Comment


    • #3
      I assume that's a global change. Normally I want the environment to be dev. When you do grails war, the environment is set to prod. But deploying to CF, the war is made automatically, but the environment is dev instead of prod. Any way to make a change just for deployment vs. globally?

      Comment


      • #4
        When you change that property on the "Run on server" properties page, this will only apply for deploying to TcServer or cloudfoundry.

        I.e. it is the environment used for the war command used by the run on server functionality.

        I don't think it will affect the env for running it with "run-app".

        Hopefully this is how you wanted it :-)

        Kris

        Comment


        • #5
          Perfect! Thanks!

          Comment


          • #6
            Your comments do make me question whether we have chosen the wrong default "dev" for the "run on server" environment.

            Maybe "prod" would be a more logical default.

            My thinking at the time was that I thought it most logical if doing "run as >> run-app" or "run as >> run on server" behave as much as possible in the same way (unless user explicitly overrides the deployment env).

            Maybe that isn't a good way of thinking however. Perhaps as a user you would really expect the env for the war command to be prod anyway. So you would expect the behavior to be different?

            Kris

            Comment


            • #7
              Yes, I think prod should be the default. I didn't really even know there where 2 different things. (I've been using NetBeans and just recently stated using STS.)

              Anyway, since "run on server" creates a war, I was expecting to behave like grails war, which sets the environment to prod.

              Comment


              • #8
                Thank you for this! Took me several steps to get here I blogged about it and added a reference to this forum, hopefully people will get to find this solution quicker.

                I don't know if this is the default already, I'm still using an old version (2.8), but I agree that "prod" should be the default.

                Comment


                • #9
                  Dev is still the default. We should probably change that for the next release. The reason why I haven't done so yet is that whenever you change something like this, there is always a bit of a risk that you are going to be breaking people who implicitly depend on the way it currently works, even if that way may seem 'illogical'.

                  But at least three different users agree it is the logical default and I haven't heard anyone who thinks it should be dev. We'll try it out and see what happens (and users who need it to be 'dev' should be able to switch it back so the risk is not that great).

                  Raised a issue here to do the work:
                  https://issuetracker.springsource.com/browse/STS-2564

                  Thanks for your input.

                  Kris

                  Comment

                  Working...
                  X