I'd like to use different parts of the build manifest file depending on
the branch I'm pushing, for instance on `dev` I'd like to run tests,
but on `master` I'd like to `deploy`. Is it even feasible out of the
box? If not, what's the recommended course of action?
Felix.
> I'd like to use different parts of the build manifest file depending on> the branch I'm pushing, for instance on `dev` I'd like to run tests,> but on `master` I'd like to `deploy`. Is it even feasible out of the> box? If not, what's the recommended course of action?
I guess one of the easier way is to check the branch into the build
script then exit if it is not master. The build will trigger on any push
but not have consequences.
On July 5, 2019 4:36:35 AM UTC, sir@hacktivista.com wrote:
>I'd like to use different parts of the build manifest file depending on>the branch I'm pushing, for instance on `dev` I'd like to run tests,>but on `master` I'd like to `deploy`.
You could have a different build manifests in each branch.
> I'd like to use different parts of the build manifest file depending on> the branch I'm pushing, for instance on `dev` I'd like to run tests,> but on `master` I'd like to `deploy`. Is it even feasible out of the> box? If not, what's the recommended course of action?
I don't see a mechanism in the manifests for setting constraints
on when a task should be run. This is a feature on other build
servers that I've used and it's something I think would be useful
here as well. As others have said, you can probably add logic
into your script that accomplishes the same goal, but you lose
some visibility into what each task is really doing by putting
conditional branches into the task.
Hi Felix,
On Fri, 05 Jul 2019 06:36:35 +0200,
sir@hacktivista.com wrote:
> > I'd like to use different parts of the build manifest file depending on> the branch I'm pushing, for instance on `dev` I'd like to run tests,> but on `master` I'd like to `deploy`. Is it even feasible out of the> box? If not, what's the recommended course of action?> > Felix.
I have something like this in my build.yml:
```
# if not on develop branch skip the next stages
if [ "$(git rev-parse origin/develop)" != "$(git rev-parse HEAD)" ]; then \
complete-build; \
fi
```
https://git.sr.ht/~xaffe/takingstack/tree/develop/.build.yml#L41
love
Tim