The Wayback Machine - https://web.archive.org/web/20201206230356/https://github.com/agola-io/agola/issues/73
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditional runs on branch/ref #73

Open
simonerota opened this issue Jul 30, 2019 · 4 comments
Open

Conditional runs on branch/ref #73

simonerota opened this issue Jul 30, 2019 · 4 comments

Comments

@simonerota
Copy link
Collaborator

@simonerota simonerota commented Jul 30, 2019

It would be nice to be able to specify an include/exclude filter (regex?) on branches or refs to include or exclude runs on a project.
Example: for a project I'd like to only start a run if the branch name is 'master' or 'release'.

@sgotti
Copy link
Member

@sgotti sgotti commented Aug 1, 2019

@simonerota This should be implemented in two places:

  • At the config level: add a When field to the run definition like already done for tasks. So users could define when to execute a run (remember that there can be more than one run defined and every run can have different when conditions).

  • As a project config (something like RunWhen). This will happen just after receiving a webhook if the conditions isn't met nothing will be done (the config file is not even fetched).

@sgotti
Copy link
Member

@sgotti sgotti commented Aug 2, 2019

First task implemented in #78

@huapox
Copy link

@huapox huapox commented Nov 4, 2019

Perfect, I'll try test this latter.

@huapox
Copy link

@huapox huapox commented Dec 4, 2019

  • Test Result:
local task_gitsrc() = {
    name: 'git-src',
    runtime: {
      arch: 'amd64',
      containers: [{image: 'alpine/git'}],
    },
    steps: steps_gitsrc(),
    depends: [],
    when: {
      // branch: '#.*#',
      branch: '#master#',
      ref: '#refs/pull/\\d+/head#',
    },

选区_390_agolaWhenTest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.