Build system (Jenkins), MUPX and environment variables


#1

I finally get a jenkins build system working (building mobile apps, deploying browser-apps with mupx) with meteor and it runs pretty nice i.e. mup is so good before Galaxy is disrupting earth :).

Actually I am wondering what the best configuration is to exchange/forward environment variables in this context.

I have defined global and job specific environment variables in Jenkins, but when it comes to mupx there is a further configuration file with mup.json. This means that my deployment server do not have access to these environment vars anymore.

In particular I have e.g. a global variable such as PRODUCT_VERSION and three different jenkins job specific MONGO_URLs.

So what is the best and securest way to forward build server environment variables (general and private ones such as AWS keys) to deployment servers with mupx?

It is ok to push all needed environment variables inside “METEOR_SETTINGS” and manipulate the mup.json (env {} section) file per script in jenkins to automatically set the deployment server specific environment variables with the ones defined in Jenkins.
Or it is even easier to generate an environment file to use a jenkins plugin.

Is this a good way doing this?


#2

So what I did, was putting all needed environment variables in jenkins inside METEOR_SETTINGS. Such as METEOR_SETTINGS={“version”:"$version"}.
And this METEOR_SETTINGS file I echo in a settings file as one build step and this I use with --settings option in mupx.
Finally using it with this package https://atmospherejs.com/4commerce/pubsettings-template-helper to streamline the whole environment thingi.

This works perfectly, but I am wondering if this a secure and good solution.
Finally the problem is that I cannot forward/use an environment variable insde the mupx.json.