Results 1 to 8 of 8

Thread: Is it possible to add additional environment objects in app.json ?

  1. #1
    Sencha User
    Join Date
    Sep 2016
    Posts
    22
    Answers
    1

    Default Is it possible to add additional environment objects in app.json ?

    Hi,

    In app.json i currently see the following extract relating to custom values for different environments.

    Code:
        /**
         * override objects for setting build environment specific
         * settings.
         */
        "production": {
        },
    
    
        "testing": {
        },
    
    
        "development": {
        },
    We are interested in adding server specific values that can be accessed via Ext.manifest.url etc.

    I am wondering if it is possible to add extra environments here like 'uat-1', 'uat-2' etc.

    I have tried adding these but the new environments are not being detected when i trigger a build via the command line.

    Thanks for any help on this matter.

  2. #2
    Sencha Premium Member EPV's Avatar
    Join Date
    Dec 2010
    Location
    Sweden
    Posts
    361
    Answers
    37

    Default

    I use build profiles for custom builds:

    https://docs.sencha.com/cmd/guides/m...build_profiles

    Good luck / E

  3. #3
    Sencha User
    Join Date
    Jul 2019
    Posts
    11
    Answers
    1

    Default

    How do you set different developer props to use in EXT App ? Me and other developer are developing same APP with different APP configurations
    exmaple: me using DevConfiguration1.js,
    he is using DevConfiguration2.js for development
    for production we are using ProdConfiguration.js
    I'm not sure how to do this propertly .. read all the docs .. and not sure if I understand how to do it

  4. #4
    Sencha User
    Join Date
    Jun 2017
    Location
    Pune, Maharashtra, India
    Posts
    4

    Default

    Hello Guys,

    I'm new to ext js 6.6. We created extjs 6.6 application, but it takes too much time to load on production server. So, Please help me to how to create production deployement war. how to copmress all Js files in a single file.


    Thank you,

  5. #5
    Sencha User
    Join Date
    Jul 2019
    Posts
    11
    Answers
    1

    Default

    Quote Originally Posted by shubhangi457 View Post
    Hello Guys,

    I'm new to ext js 6.6. We created extjs 6.6 application, but it takes too much time to load on production server. So, Please help me to how to create production deployement war. how to copmress all Js files in a single file.


    Thank you,
    we use cmd line:
    sencha app build




    Regards

    Armando

  6. #6
    Sencha User
    Join Date
    Jun 2017
    Location
    Pune, Maharashtra, India
    Posts
    4

    Default

    Thank you armandoota,
    I'm also using the sencha app build, but when I deploy the build on tomcat then it loads development environment file.

    I want to load all the files in Production Environment folder.

    Thank you,

  7. #7
    Sencha User
    Join Date
    Sep 2007
    Location
    Phoenix AZ
    Posts
    121
    Answers
    5

    Default

    You have to use the production URL. It is in the build folder.

    The build folder will either be in the application folder or the work space folder depending on if you are using a work space or not.

    So if your app is called TestApp then the url would be http://example.com/workspace/build/p...App/index.html for a work space
    or
    for a stand alone application it would be http://example.com/TestApp/build/pro...App/index.html

    you can also build in testing mode so it is in a production like build but the files are not minimized for debugging. Then you would replace production with testing in the URL.

    Also the production folder can be moved as it has all the resources need to execute the application. So you can move TestApp under production to the root of your web server or where ever....

    -Mark

  8. #8
    Sencha User
    Join Date
    Jul 2019
    Posts
    11
    Answers
    1

    Default

    After playing around with different ideas of how to solve this i came up with this:

    in app.json

    you add builds object:



    Code:
    "
    builds": {
    /** used as default by build   **/
       "_" : {
        },
        /** your developer and/or environemt options **/
    "developer1" : {
    "api": "https://developer1:5090"
    },
        "developer2" : {
    "api": "https://developer2:5090"
    }
    },
    then add to your enviroments
    Code:
    "production" : {
      "api": "http://production"
    },
    "development" : {
      "api": "http://development"
    },
    "development" : {
      "api": "http://testing"
    },
    so now you can do the CMD magic:

    sencha app watch //will use default build env option .. " _ " and there fore will not change api property
    sencha app watch developer1 //will use developer1 env option and will use "api": "https://developer1:5090"

    sencha app build testing // will use default build env option .. " _ " and there fore will not change api property
    sencha app build developer2 testing //will use developer1 env option and will use "api": "https://developer2:5090"

    simple as that .. .

    the only thing to notice is. YOU NEEED DEFAULT EMPTY build env object becase sencha takes the first one in the builds object by default (beats me why would anyone implement it like that)

    regards

    Armando

Similar Threads

  1. Models for JSON Objects of JSON Object
    By Davide Zeri in forum Sencha Touch 2.x: Q&A
    Replies: 3
    Last Post: 7 Nov 2014, 7:25 AM
  2. Replies: 1
    Last Post: 9 May 2012, 4:44 PM
  3. Adding additional data to JSON ARRAY
    By adbox in forum Ext 2.x: Help & Discussion
    Replies: 7
    Last Post: 11 Feb 2009, 1:57 PM
  4. Accessing additional JSON data
    By matjones in forum Ext 2.x: Help & Discussion
    Replies: 5
    Last Post: 5 Dec 2008, 1:36 PM
  5. json data - always array of json objects?
    By shortestpath in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 20 Nov 2007, 4:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •