Local Actions
Dette indhold er ikke tilgængeligt i dit sprog endnu.
Similar to other repository settings, users can now store Actions as part of the Workspace. Users can now create .vscode/actions.json
inside of your Workspace, and can contain Actions that are specific to that Workspace. That configuration file should also be checked into git for that application.
Running local Actions will execute the commands with the working directory as the deploy directory.
There is a tool that can generate an initial actions.json
file for you. After connecting to a system, open the command palette (F1) and search for ‘Launch Actions Setup’. This shows a multi-select window where the user can pick which technologies they’re using. Based on the selection, an actions.json
will be created.
Available variables
These variables can be used for local development. They can be referenced in actions.json
or .env
.
Libraries
Variable | Description |
---|---|
&BUILDLIB | The same as &CURLIB |
&CURLIB | The current library defined in the User Library List view. Can also use *CURLIB |
&LIBLS | The library list with spaces between each item |
&BRANCHLIB | A deterministic library name built from the current branch in git |
Directories and Files
Variable | Description |
---|---|
&RELATIVEPATH | The relative path to the file in the workspace |
&LOCALPATH | The full path to the file on the local machine |
&FULLPATH | The full path to the file on the remote machine |
&WORKDIR | The working directory. Typically this means the deploy directory |
&FILEDIR | The directory of the file on the remote machine |
&PARENT | The local parent directory |
&BASENAME | The basename of the file (name.ext ). Can also use {filename} |
&NAME | The name of the file (or use &NAMEL for lowercase) |
&EXT | The extension of the file (or use &EXTL for lowercase) |
Other
Variable | Description |
---|---|
&USERNAME | Connected username. Can also use {usrprf} |
&HOST | Connected hostname. Can also use {host} |
&HOME | Current home directory. Typically not the same as deploy directory. |
&BRANCH | The current branch name in git. Can also use {branch} |
Compiling non-IFS sources
When working in the local workspace, it is possible to define an Action that will automatically copy to a temporary member and compile from there. This is required for legacy object likes like DSPF, PF and LF, or other commands that use SRCFILE
instead of SRCSTMF
.
If you have a local (inside actions.json
) ile
action, and the command contains &SRCFILE
, then the source will be copied to a temporary member inside the build library from your local workspace before running the compile command.
PASE environment variables
When you run Actions in the pase environment, all variables from VS Code (things like &CURLIB
, &BUILDLIB
, custom variables, .env
variables) are inherited into the spawned pase shell.
For example, let’s say we had this shell script and this Action:
You will see the output:
Environment file
As well as custom variables defined in the User Library List view, users can also make use of the .env
file.
The .env
file allows each developer to define their own configuration. For example, standard development practice with git is everyone developing in their own environment - so developers might build into their own libraries. The .env
file should always be in the .gitignore
file.
Variables defined in this file will overwrite any of the default variables provided.
actions.json
Developer specific .env
files
Branch library
&BRANCHLIB
is a special variable for generating a library name based on the branch name. The Source Orbit tool also supports this same branch library name logic.
The &BRANCHLIB
variable will always start with VS
followed by a deterministic set of 8 characters based on the current branch name.
.env
and ILE actions
When you are compiling local sources using "environment": "ile"
, then it will use the User Library List for the job. You can use the CURLIB
and LIBL
variables to override them. This is useful because then it allows project-specific library lists.