Creating-Environment-Variables.md 8.16 KB
Newer Older
Andrew Hazelden's avatar
Andrew Hazelden committed
1 2 3 4
# Table Of Contents #

- [Creating Environment Variables](Creating-Environment-Variables.md)
	- [Reactor Environment Variables](Creating-Environment-Variables.md#reactor-environment-variables)
5
		- [Viewing the Reactor Log File](Creating-Environment-Variables.md#viewing-the-reactor-log-file)
Andrew Hazelden's avatar
Andrew Hazelden committed
6 7 8
	- [Using the Windows System Control Panel](Creating-Environment-Variables.md#using-the-windows-system-control-panel)
	- [Using a Linux BASH Profile](Creating-Environment-Variables.md#using-a-linux-bash-profile)
	- [Using MacOS Launch Agent PLIST Files](Creating-Environment-Variables.md#using-macos-launch-agent-plist-files)
9

Andrew Hazelden's avatar
Andrew Hazelden committed
10 11 12 13
# <a name="creating-environment-variables"></a>Creating Environment Variables #

## <a name="reactor-environment-variables"></a>Reactor Environment Variables ##

14
To see more diagnostic logging detail from the Reactor GUI you can add the `REACTOR_DEBUG` environment variable to your system:
Andrew Hazelden's avatar
Andrew Hazelden committed
15

16
### <a name="reactor-debug"></a>Reactor Debug ###
Andrew Hazelden's avatar
Andrew Hazelden committed
17

18
The `REACTOR_DEBUG` environment variable can be set to true if you want to see more verbose logging output when you run the Reactor GUI:
Andrew Hazelden's avatar
Andrew Hazelden committed
19 20 21

`REACTOR_DEBUG=true`

22 23 24 25 26 27 28 29 30 31 32 33 34
#### <a name="viewing-the-reactor-log-file"></a>Viewing the ReactorLog.txt File ####

When the `REACTOR_DEBUG` environment variable is active it will tell Reactor that you want to have a log file written to `Temp:/Reactor/ReactorLog.txt`. You can quickly open this document by selecting the **Reactor > Tools > Open ReactorLog** menu item:

![Open Reactor Log Menu Item](Images/reactor-menu-open-reactor-log.png)

When you open the `ReactorLog.txt` file in your programmer's text editor it will look something like this:

![Reactor Log in BBedit](Images/reactorlog-textfile.png)

The first few lines of the log file indicate the state of the Reactor environment variables. Then each of the commands that are used by Reactor to sync files is listed. If the `REACTOR_DEBUG_FILES` environment variable was active you will also see the raw file downloads concatenated inline in the log file too.

### <a name="reactor-debug-files"></a>Reactor Debug Files ###
Andrew Hazelden's avatar
Andrew Hazelden committed
35 36 37 38 39

The `REACTOR_DEBUG_FILES` environment variable can be set to true if you want to see Console logging output that shows each of the cURL based file download operations. When the environment variable is set to true Reactor will print the contents of the files as they are downloaded and written to disk. This debugging information is useful for spotting formatting issues and "Error 404" states when a file has trouble successfully downloading from GitLab:

`REACTOR_DEBUG_FILES=true`

40 41
### <a name="reactor-debug-collections"></a>Reactor Debug Collections ###

Andrew Hazelden's avatar
Andrew Hazelden committed
42
The `REACTOR_DEBUG_COLLECTIONS` environment variable can be set to true while you are developing and testing atoms that use the Reactor Collections category.
43

Andrew Hazelden's avatar
Andrew Hazelden committed
44
`REACTOR_DEBUG_COLLECTIONS=true`
45 46

### <a name="reactor-branch"></a>Reactor Branch ###
Andrew Hazelden's avatar
Andrew Hazelden committed
47 48 49 50 51

The `REACTOR_BRANCH` environment variable allows you to change the default GitLab branch that is used in the Reactor Installer script, and in the Reactor Package Manager GUI when new content is downloaded and the Reactor utility scripts are updated. When the `REACTOR_BRANCH` environment variable is not specified the "master" branch will be used.

This example would tell Reactor to download content from the "dev" branch:

52
`REACTOR_BRANCH=dev`
Andrew Hazelden's avatar
Andrew Hazelden committed
53

54
### <a name="reactor-install-pathmap"></a>Reactor Install PathMap ###
Andrew Hazelden's avatar
Andrew Hazelden committed
55 56 57 58 59 60 61 62 63 64 65 66 67

The `REACTOR_INSTALL_PATHMAP` environment variable can be used to change the Reactor installation location to something other then the default PathMap value of "AllData:".

`REACTOR_INSTALL_PATHMAP=AllData:`

or

`REACTOR_INSTALL_PATHMAP=UserData:`

or

`REACTOR_INSTALL_PATHMAP=Profile:`

68 69
or your own custom Reactor installation location on a local or network path like:

Andrew Hazelden's avatar
Andrew Hazelden committed
70 71 72 73 74 75 76
		REACTOR_INSTALL_PATHMAP=E:\Pipeline\Reactor
		REACTOR_INSTALL_PATHMAP=/Volumes/Pipeline/Reactor
		REACTOR_INSTALL_PATHMAP=/opt/Reactor

On Windows you would open the **System Control Panel > Advanced System Settings > Environment Variables...** window and add a new `REACTOR_INSTALL_PATHMAP` entry like this:

![Windows Environment Variable](Images/windows-adding-an-environment-variable.png)
77 78 79 80 81 82 83 84 85

### <a name="reactor-local-system"></a>Reactor Local System ###

The `REACTOR_LOCAL_SYSTEM` environment variable allows you to do local development of the files in the `Reactor:/System/` folder without needing to git sync each of those revisions with the Reactor GitLab repository.

Whatever folderpath you define in the `REACTOR_LOCAL_SYSTEM` environment variable will be used as a local source of the `Reactor:/System/` folder contents. When you run the **Reactor > Open Reactor...** menu item the `REACTOR_LOCAL_SYSTEM` defined files will be copied automatically to the `Reactor:/System/` folder.

To use this environment variable you need to have a copy of the full Reactor `System` folder with the `Protocols`, `Scripts`, and `UI` folders present along with a copy of the `Reactor.lua` script.

Andrew Hazelden's avatar
Andrew Hazelden committed
86 87
## <a name="using-the-windows-system-control-panel"></a>Using the Windows System Control Panel ##

88
On Windows the Reactor Branch environment variables can be specified in the **System Control Panel > Advanced System Settings > Environment Variables...** window.
Andrew Hazelden's avatar
Andrew Hazelden committed
89 90 91 92 93 94 95 96 97 98 99 100 101 102

![Windows Environment Variables](Images/windows-environment-variables.png)

On Windows you can type `set` into the Command Prompt window to see all of the active environment variables on the system.

## <a name="using-a-linux-bash-profile"></a>Using a Linux BASH Profile ##

If you are on a Linux system you can add your own custom Reactor environment variables by editing your `$HOME/.bash_profile` or `$HOME/.profile`.

You would then add new environment variable entries that look like this:

		export REACTOR_DEBUG_FILES=true
		export REACTOR_DEBUG=true
		export REACTOR_INSTALL_PATHMAP=AllData:
103
		export REACTOR_LOCAL_SYSTEM=/opt/Reactor/System
Andrew Hazelden's avatar
Andrew Hazelden committed
104 105 106 107 108 109 110 111 112 113 114 115 116

On Linux you can type `env` into the Terminal window to see all of the active environment variables on the system.

## <a name="using-macos-launch-agent-plist-files"></a>Using MacOS Launch Agent PLIST Files ##

On a MacOS system the easiest and most reliable way to setup new environment variables is with the help of LaunchAgent .plist files. If you want to make it easy to visually edit a LaunchAgent plist document you can look at using a 3rd party utility like ["LaunchControl" by Soma-Zone](http://www.soma-zone.com/LaunchControl/).

The Reactor GitLab repository has a copy of some initial Reactor LaunchAgent example .plist files in the folder:

			Bonus/Mac/setenv.reactor.REACTOR_LOCAL_SYSTEM.plist
			Bonus/Mac/setenv.reactor.REACTOR_DEBUG_FILES.plist
			Bonus/Mac/setenv.reactor.REACTOR_BRANCH.plist
			Bonus/Mac/setenv.reactor.REACTOR_DEBUG.plist
117
			Bonus/Mac/setenv.reactor.REACTOR_INSTALL_PATHMAP.plist
Andrew Hazelden's avatar
Andrew Hazelden committed
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147

You would need to edit these files in a programmer's text editor to customize them before you install them on your system.

These plist documents are designed to be installed on your MacOS system using root permissions to the folder:

`/Library/LaunchAgents/`

When you go to install the plist files you will need to change the documents to be owned by "root", have the group name of "wheel", and have a Unix "octal" file permission setting of 644.

			sudo chown root /Library/LaunchAgents/setenv.reactor.*.plist
			sudo chgrp wheel /Library/LaunchAgents/setenv.reactor.*.plist
			sudo chmod 644 /Library/LaunchAgents/setenv.reactor.*.plist

You can take a look at the file permissions of the Launch Agent files on your system using the following terminal command:

			ls -la /Library/LaunchAgents/

You will then see a directory listing that looks something like this:

			drwxr-xr-x  24 root  wheel   816 Nov 17 12:28 .
			drwxr-xr-x+ 62 root  wheel  2108 Nov 17 11:59 ..
			-rw-r--r--   1 root  wheel   715 Oct 26  2016 org.macosforge.xquartz.startx.plist
			-rw-r--r--@  1 root  wheel   474 Nov 17 05:42 setenv.reactor.REACTOR_BRANCH.plist
			-rw-r--r--@  1 root  wheel   463 Oct 25 07:25 setenv.reactor.REACTOR_DEBUG.plist
			-rw-r--r--@  1 root  wheel   475 Oct 25 07:27 setenv.reactor.REACTOR_DEBUG_FILES.plist
			-rw-r--r--@  1 root  wheel   473 Dec  7 22:23 setenv.reactor.REACTOR_INSTALL_PATHMAP.plist

On MacOS you can type `env` into the Terminal window to see all of the active environment variables on the system.


Andrew Hazelden's avatar
Andrew Hazelden committed
148
Last Revised 2018-07-16