addLatestSnapshot tool is a simple version of the
addSnapshot tool. Use
addLatestSnapshot when you want to create a snapshot for the latest version of the code base. When the tool has finished, the snapshot is ready to be built and indexed by the
Snapshots created with this tool are not "tagged"; this means they are subject to the project's snapshot deletion policy for managing automatically added snapshots.
This tool is run from the command line as follows:
addLatestSnapshot tool supports the following flags:
Optional. Output more detailed information about actions. This increases the verbosity to level 4.
Optional. Define the precise level of reporting required where
Optional, defines the location of the
Default: current directory
Optional, use to allow the concurrent execution of other commands. Use with care.
Default: the snapshot files are locked to other tools until this tool has completed.
Optional, define a name for the snapshot.
|Optional, set a variable for the |
Optional, use to abort checkout if any checkout command returns a failure (non-zero) exit code.
Optional, use to delete any pre-existing snapshot for the current date and create a new snapshot.
Default: when the project file includes a
Optional, defines a custom working directory for all the build commands. This directory must already exist.
Default: the snapshot's source location
Optional, define a custom location to store the source for the snapshot. This directory must already exist.
Default: source directory defined by the
|Optional, define a checkout command. May be repeated. Commands are executed in sequence. Overrides any checkout commands defined in the |
|Optional, define a build command. May be repeated. Commands are executed in sequence. Overrides any build commands defined in the |
Running the tool from a project directory:
Calling the tool from a nightly data processing script:
myproject is the project that you want to add a new snapshot to.
When this tool runs it performs the following operations:
- Read the
projectconfiguration in the current directory or specified by the
days-between-updatesis defined as greater than zero, check for an existing snapshot for the current date. If present, then exit unless the
--overwriteflag was defined.
- Create a new directory for the revision in the directory where the
projectconfiguration file is stored (if data files are stored with configuration files) or in the project sub-directory under
SEMMLE_DATAif data files are stored separately.
- Get the latest version of the code using the checkout commands defined either in the
projectfile or by command-line flags.
- Write a
snapshotconfiguration file. If
build-dircommand-line flags were defined, then include this information in the
<build>element. Otherwise copy the build information from the
- Check the snapshot policy for the project and, where necessary, delete unwanted snapshots.
- If all tasks are completed successfully, then exits with code 0.
When the tool is complete, the snapshot is ready to be built and indexed using the
The tool reports the output of all source control checkout commands executed. The output from the checkout commands is also copied to the
checkout-log.log file in the
log directory of the newly created snapshot. If any problems are encountered then additional information is output. For example:
If one or more of the checkout commands fail, then the output will contain a footer with detailed information, starting with the text:
The tool supports a single daily snapshot of a project. If this number is exceeded, then no new checkout is performed and the following message is output:
addLatestSnapshot command exits with a 0 exit code if the snapshot was successfully created or if no new snapshot is required due to the auto-update policy. If there were any errors creating the snapshot, the return value is non-zero and the errors are reported in the output.