Replies: 6 comments 4 replies
-
I don't think that a resource exists that discovers git branches. You could either build such a resource, e.g. using the GitHub API, or you could write a job that does the discovery and the modifies the pipeline using |
Beta Was this translation helpful? Give feedback.
-
Here is an example: suhlig/concourse-branch-detection.
Beware: this is just a spike. If you want to use this for real, turn the branch detection into a proper resource so that pipelines can trigger on branches added or removed (instead of polling via job trigger). |
Beta Was this translation helpful? Give feedback.
-
@suhlig Thank you!! Do you mean here to change to use a real branch name instead? I see you have resource defined .... Thanks! https://github.com/suhlig/concourse-branch-detection/blob/main/pipelines/branch-detector.yml#L2 |
Beta Was this translation helpful? Give feedback.
-
@suhlig Hi! I have another question: What does this line do? Could you please help me understand? Do I need to create a list.yaml file? https://github.com/suhlig/concourse-branch-detection/blob/main/pipelines/branch-detector.yml#L25 Thanks much! |
Beta Was this translation helpful? Give feedback.
-
No, the idea of this task is to list all branches that exist in the remote git repo (defined by the
All of the previous lines create a list of branches on |
Beta Was this translation helpful? Give feedback.
-
We had the same problem. Currently we poll the GitHub API, but we realized that a better approach is to react on webhooks, since GitHub can be configured to send a webhook (also) for branch creation. |
Beta Was this translation helpful? Give feedback.
-
Hi! The use case is I have a concourse pipeline which runs against a certain branch called
release-candidate
branch. Below is the fly command.fly sp -t team-name -c ./pipeline.yml -p app-repo-release-candidate -l settings-default.yml -v BRANCH=release-candidate
Below is how I set up gitrhub repo as a resource.
But the
release-branch
only exists when we have a release, it is deleted after the release. Once it is being deleted, I see concourse pipeline shows red mark around the resourcesource-code
. But if I can have a way to let concourse yaml only check when the branch exists/created. Or the pipeline is only active when the branch exists or is created? Any suggestions?Thanks much!
Beta Was this translation helpful? Give feedback.
All reactions