Setting the deployment mode via an environment variable is not yet supported, you've got to supply the Java system property via a JVM argument, -Dignition.config.mode=yourdeploymentmode. As @paul-griffith mentions, we're going to be doing additional refinements in this area. However, I've got some guidance that might be useful in the meantime.
Currently, at time of writing w/ 8.3.0, if you add the deployment mode arg explicitly to your data/ignition.conf, it will be within any gateway backup (GWBK) that you collect. Thus, if you restore it to a given gateway, the gateway will assume that deployment mode. This isn't going to be what you want, so we've got to define that arg in a different scope.
This is where you can use wrapper.java.additional_file and wrapper.java.additional_file.required to your advantage.
Below are some steps to configure the deployment mode in a way that will be excluded from the gateway backup:
-
Create a hidden folder called
data/.customunder your Ignition installation. -
Add the following lines to your
data/ignition.conf(ideally, place after the other "Java Additional Parameters" section):# Java Additional Parameters via file wrapper.java.additional_file=data/.custom/jvm-args.txt wrapper.java.additional_file.required=FALSE -
Place a file
data/.custom/jvm-args.txtwith the following contents:#encoding=UTF-8 -Dignition.config.mode=mydeploymentmode
You can then customize the contents of data/.custom/jvm-args.txt on a given Ignition Gateway to set the target deployment mode. You can also omit the file altogether to stay in the core deployment mode. This definition will not be collected in a gateway backup (GWBK) nor will it be disturbed by a gateway restore.
Hope this helps!