Discussion:
generator environment source / build
(too old to reply)
Raymond Rösch
2016-04-07 05:37:37 UTC
Permalink
Good Moring

I would like to set different environment keys in config.json file.

As far as I can understand it must be done in the settings for jobs in
"source-script" and "build-script"

Where ist the default setting for "source-script"?

Would it be possible to setup different build-scripts - one per customer
like build<custid>-script?

Thanks a lot.
Raymond
Ivan Pogorelov
2016-04-08 00:32:46 UTC
Permalink
Hi,

You can set env vars (for any/every job) in config.json like this:

{
"name" : "...",
"include" :[... ],
"export" : [....],
"default-job" : "source-hybrid",
"let": { ... },
"jobs" :
{
"<your job name>" :
{
"environment" :
{
.........
"customerID": "<GUID anything>",
........
}
}
}

Please find config_schema.json and base.json in qooxdoo SDK. Is that you
looked for?
You can define any custom job that includes another job (see base.json
carefully).

TBRDs,
Ivan
Post by Raymond Rösch
Good Moring
I would like to set different environment keys in config.json file.
As far as I can understand it must be done in the settings for jobs in
"source-script" and "build-script"
Where ist the default setting for "source-script"?
Would it be possible to setup different build-scripts - one per customer
like build<custid>-script?
Thanks a lot.
Raymond
------------------------------------------------------------------------------
_______________________________________________
qooxdoo-devel mailing list
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
thron7
2016-04-09 08:56:04 UTC
Permalink
Hi Raymond,
Post by Raymond Rösch
Good Moring
I would like to set different environment keys in config.json file.
Are you talking about *configuration* keys in general, or do you mean the
OS environment specifically?
Post by Raymond Rösch
As far as I can understand it must be done in the settings for jobs in
"source-script" and "build-script"
Some customizations can be set on the global level, in the top-level "let"
section of your config.json. These settings are applied to every job, so
you find here keys like "QOOXDOO_PATH" (which every job needs) or "LOCALES"
(which is only relevant when generating the translation tables of an
application, but doesn't hurt any other jobs).

If you want to inject config keys that affect some or all jobs and don't
hurt others, this is the simplest way, but you have to make sure that your
custom keys are actually used in some job definition. Here is the list of
pre-defined macros and what they apply to:

http://manual.qooxdoo.org/current/pages/tool/generator/generator_config_macros.html

If you just want to add another library to your builds, modify the
"jobs/libraries/library" key in your config.json.

On the other side, if you want to be most specific, you can add the jobs
you want to customize directly in the "jobs" section of your config. If
"source-script" and "build-script" are the ones you want to tailor (these
two specifically generate the .js code of your application), go ahead, add
them to your config and tweak the job settings your interested in.
Post by Raymond Rösch
Where ist the default setting for "source-script"?
As Ivan wrote, the default definition of "source-script" is in
tool/data/config/base.json. But I'm afraid it might not be as helpful as
you wish, since most jobs are built up by including other jobs. If you want
to see the fully expanded definition of the default "source-script", create
a vanilla skeleton and run 'generate.py source-script -v' (or '-w', I've
forgotton). Amongst the verbose output you will find the fully expanded
definition of the job being run.
Post by Raymond Rösch
Would it be possible to setup different build-scripts - one per customer
like build<custid>-script?
Yes, that's easily possible. You might define jobs like

"build-customer1-script" : { ... }
"build-customer2-script" : { ... }
...

and then make sure these settings are used when running the default
build-script job:

"build-script" : { "extend" : [ "build-customer1-script"] }

Of course it would be tedious to edit the configuration file when you want
to switch to another customer. Here, macros can help. Define

"build-script" : { "extend" : [ "build-${currentCustomer}-script"] }

in config.json, and on the command line invoke the generator with

generate.py -m currentCustomer:customer1 build

This allows you to switch between customer-specific builds on the command
line. Here is a blog post that discusses this technique:
http://news.qooxdoo.org/branching-in-configuration-files

HTH,
T.
Raymond Rösch
2016-04-12 06:37:18 UTC
Permalink
Hi Ivan and Thron7

this helped me to do exactly what I needed. Thank you both.

Kind regards
Raymond
Post by thron7
Hi Raymond,
On Thu, Apr 7, 2016 at 7:37 AM, Raymond Rösch
Good Moring
I would like to set different environment keys in config.json file.
Are you talking about *configuration* keys in general, or do you mean
the OS environment specifically?
As far as I can understand it must be done in the settings for
jobs in "source-script" and "build-script"
Some customizations can be set on the global level, in the top-level
"let" section of your config.json. These settings are applied to every
job, so you find here keys like "QOOXDOO_PATH" (which every job needs)
or "LOCALES" (which is only relevant when generating the translation
tables of an application, but doesn't hurt any other jobs).
If you want to inject config keys that affect some or all jobs and
don't hurt others, this is the simplest way, but you have to make sure
that your custom keys are actually used in some job definition. Here
http://manual.qooxdoo.org/current/pages/tool/generator/generator_config_macros.html
If you just want to add another library to your builds, modify the
"jobs/libraries/library" key in your config.json.
On the other side, if you want to be most specific, you can add the
jobs you want to customize directly in the "jobs" section of your
config. If "source-script" and "build-script" are the ones you want to
tailor (these two specifically generate the .js code of your
application), go ahead, add them to your config and tweak the job
settings your interested in.
Where ist the default setting for "source-script"?
As Ivan wrote, the default definition of "source-script" is in
tool/data/config/base.json. But I'm afraid it might not be as helpful
as you wish, since most jobs are built up by including other jobs. If
you want to see the fully expanded definition of the default
"source-script", create a vanilla skeleton and run 'generate.py
source-script -v' (or '-w', I've forgotton). Amongst the verbose
output you will find the fully expanded definition of the job being run.
Would it be possible to setup different build-scripts - one per
customer like build<custid>-script?
Yes, that's easily possible. You might define jobs like
"build-customer1-script" : { ... }
"build-customer2-script" : { ... }
...
and then make sure these settings are used when running the default
"build-script" : { "extend" : [ "build-customer1-script"] }
Of course it would be tedious to edit the configuration file when you
want to switch to another customer. Here, macros can help. Define
"build-script" : { "extend" : [ "build-${currentCustomer}-script"] }
in config.json, and on the command line invoke the generator with
generate.py -m currentCustomer:customer1 build
This allows you to switch between customer-specific builds on the
http://news.qooxdoo.org/branching-in-configuration-files
HTH,
T.
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial! http://pubads.g.doubleclick.net/
gampad/clk?id=1444514301&iu=/ca-pub-7940484522588532
_______________________________________________
qooxdoo-devel mailing list
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Loading...