Multi environement cuba platform project

Hi, we are creating our first solution with cuba: great platform.

We noticed that in the project edit section we can specify just only one environement at a time… the question is: if we have 1 TEST ENV, 1 BETA TEST ENV and 1 PROD ENV, how we can manage the three connections rapidly and not rewrite every time the env settings?

I see this post Multiple environment deployment - CUBA.Platform but we are thinking about something more integrated in the cuba studio.

thank you very much
Angelo

Hi Angelo,

I would recommend the following approach:

  • Developers work with a database which is specified in Studio’s Project Properties. Usually it is a locally installed database.
  • For deployment to different environments, you define buildWar tasks with different parameters (e.g. different context.xml files - see Custom context.xml path field). In Studio, you can define just one such task named buildWar, but after that, you can go directly to build.gradle and copy this task with a different name, e.g. buildTestWar, and change its parameters.
  • Run your builds for different environments, e.g.:
    ./gradlew buildTestWar
  • And copy resulting WARs to your server:
    scp build/distributions/war/app.war user@host:~/dir
1 Like

Thank you very much Konstantin!!!