Cycle-cli is the command line interface for executing Features, Playlists or Group test files. For more detailed information on cycle-cli read this article.
This article focuses on using cycle-cli to checkout and/or relinquish a licence. This is especially valuable when executing cycle-cli in parallel within a Continuous Integration pipeline.
Checking out a license at the beginning of a pipeline ensures all executions are using the same license without overlapping conflicts.
Relinquishing the license at the end of a pipeline frees that license up immediately for other users/jobs.
The command line argument for checking out a license in cycle is --license-checkout. It is best practice when using cycle-cli to include your Personal Access Token. Instructions for finding and using your Personal Access Token can be found in the linked article referenced earlier.
Example:
C:\Program Files (x86)\TryonSolutions\Cycle>cycle-cli -a 0010-1000-1010-3df5 --license-checkout
Example output after executing a command line checkout.
Validated sample_cycle_user@tryonsolutions.com Success License 64123-2e48-42d0-12g6-13142r4 Expires 2020-01-11T18:44:53Z Success
The command line argument for relinquishing a license in cycle is --license-relinquish. It is best practice when using cycle-cli to include your Personal Access Token. Instructions for finding and using your Personal Access Token can be found in the linked article referenced earlier.
Example:
C:\Program Files (x86)\TryonSolutions\Cycle>cycle-cli -a 0010-1000-1010-3df5 --license-relinquish
Example output after executing a command line relinquish.
Success
Now this license has been relinquished and added back into your team's available pool.
Using Jenkins as an example, the checkout and relinquish can be added a stages at the beginning and end or your pipeline respectively. This ensures that your parallel jobs run with the same license without conflict while not holding a license any longer than necessary.
stage('License Checkout') {
steps {
bat '"C:\\Program Files (x86)\\TryonSolutions\\Cycle\\cycle-cli" -a 0010-1000-1010-3df5 --license-checkout'
}
}
.
[Pipeline stage 1]
.
[Pipeline stage 2]
.
[Pipeline stage 3]
.
stage('License Relinquish') {
steps {
bat '"C:\\Program Files (x86)\\TryonSolutions\\Cycle\\cycle-cli" -a 0010-1000-1010-3df5 --license-relinquish'
}
}