If you were logged in you would be able to see more operations.
|
|
|
QuickBuild
Created: 09/Jul/14 07:18 AM
Updated: 11/Jul/14 11:09 PM
|
|
Component/s: |
None
|
Affects Version/s: |
5.1.12
|
Fix Version/s: |
None
|
|
Original Estimate:
|
Unknown
|
Remaining Estimate:
|
Unknown
|
Time Spent:
|
Unknown
|
Environment:
|
Not related to environment. Reproducible in our Dev/Test/Live machines
|
|
We have a configuration, that should track and trigger build if changes are made in different branches of a GIT repo.
So we have set up a configuration with a Git repo.
Branch Name = ${vars.get("gitBranch")}
Variable - gitBranch = TEST-*
Scheduled every 5 min.
Build Condition = If changes found in referenced repositories
The configuration is sadly never triggered.
If the gitBranch variable is not set as a wildcard parameter (example TEST-1)
The Build is triggered as expected.
There is currently a workaround with groovy script we use. But this could work out of the box with "If changes found in referenced repositories"
Workaround itself is:
Build Condition: If specified script evaluates to true.
groovy:
for (repository in configuration.getReferencedRepositories()) {
if (repository instanceof com.pmease.quickbuild.dependency.QuickbuildRepository) {
continue;
}
if (repository.name=="reponame" && repository.isChanged())
{
return true;
}
}
return false;
All the best and hope to hear from you,
Andrel
|
Description
|
We have a configuration, that should track and trigger build if changes are made in different branches of a GIT repo.
So we have set up a configuration with a Git repo.
Branch Name = ${vars.get("gitBranch")}
Variable - gitBranch = TEST-*
Scheduled every 5 min.
Build Condition = If changes found in referenced repositories
The configuration is sadly never triggered.
If the gitBranch variable is not set as a wildcard parameter (example TEST-1)
The Build is triggered as expected.
There is currently a workaround with groovy script we use. But this could work out of the box with "If changes found in referenced repositories"
Workaround itself is:
Build Condition: If specified script evaluates to true.
groovy:
for (repository in configuration.getReferencedRepositories()) {
if (repository instanceof com.pmease.quickbuild.dependency.QuickbuildRepository) {
continue;
}
if (repository.name=="reponame" && repository.isChanged())
{
return true;
}
}
return false;
All the best and hope to hear from you,
Andrel
|
Show » |
|
1. define a simple repo as below:
git init /path/to/repo
git add file
git commit -m "initial"
git checkout -b branch1
git checkout -b branch2
2. define a git repository with pull url set to "/path/torepo", and branch set to "branch*", and set the schedule to trigger every 1 minute, with build condition set to "if changes found in referenced repositories".
3. define a checkout step to checkout above repository.
4. now wait for a minute the two builds will be generated in the configuration, one of branch1 and another for branch2
5. make new commits in /path/to/repo for branch1 and branch2
6. wait for a minute, and another two builds will be fired automatically for branch1 and branch2
So the reason it does not work at your side might be due to a mis-configuration. Can you please test above simple case against your repo to see if it works?