Skip to content

Commit e2bf9e8

Browse files
committed
tweaks
1 parent 4b2fb0c commit e2bf9e8

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

user/conditional-builds-stages-jobs.md

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ You can filter out and reject builds, stages and jobs by specifying conditions i
77

88
## Conditional Builds
99

10-
Configure Travis CI to only run builds when certain conditions are met. Any builds that do not meet these conditions are listed in the *Requests* tab of your repository, even though the actual build is not generated.
10+
You can configure Travis CI to only run builds when certain conditions are met. Any builds that do not meet these conditions are listed in the *Requests* tab of your repository, even though the actual build is not generated.
1111

12-
For example, this allows builds only to run on the master branch:
12+
For example, this allows builds only to run on the `master` branch:
1313

1414
```yaml
1515
# require the branch name to be master (note for PRs this is the base branch name)
@@ -21,9 +21,7 @@ Build requests that do not match the condition will not generate a build, but wi
2121
2222
## Conditional Stages
2323
24-
Configure Travis CI to only include stages when certain conditions are met. Stages that do not match the given condition are silently skipped.
25-
26-
For example, this allows the deploy stage to run only on the master branch:
24+
You can configure Travis CI to only include stages when certain conditions are met. Stages that do not match the given condition are silently skipped. For example, this allows the deploy stage to run only on the `master` branch:
2725

2826
```yaml
2927
stages:
@@ -37,9 +35,7 @@ Stages that do not match the condition will be skipped silently.
3735

3836
## Conditional Jobs
3937

40-
Configure Travis CI to only include jobs when certain conditions are met.
41-
42-
For example, this includes the listed job only to builds on the master branch:
38+
You can configure Travis CI to only include jobs when certain conditions are met. For example, this includes the listed job only to builds on the `master` branch:
4339

4440
```yaml
4541
jobs:
@@ -50,15 +46,13 @@ jobs:
5046
```
5147
{: data-file=".travis.yml"}
5248

53-
Jobs need to be listed explicitly, i.e., using `jobs.include` (or its alias `matrix.include`), in order to specify conditions for them. Jobs created via [matrix expansion](/user/customizing-the-build/#build-matrix) currently cannot have conditions, but they can be conditionally excluded (see the next section).
49+
Jobs need to be listed explicitly, i.e., using `jobs.include` (or its alias `matrix.include`), in order to specify conditions for them. Jobs created via [matrix expansion](/user/customizing-the-build/#build-matrix) currently cannot have conditions, but they can be conditionally excluded (see [below](/#conditionally-excluding-jobs)).
5450

5551
Jobs that do not match the condition will be skipped silently.
5652

5753
## Conditionally Excluding Jobs
5854

59-
Configure Travis CI to exclude jobs only when certain conditions are met.
60-
61-
For example, this will create two jobs on all branches, but only one job (with the env var `ONE=one`) on the master branch:
55+
You can configure Travis CI to exclude jobs when certain conditions are met. For example, this will create two jobs on all branches, but only one job (with the env var `ONE=one`) on the `master` branch:
6256

6357
```yaml
6458
env:
@@ -73,9 +67,7 @@ jobs:
7367

7468
## Conditionally Allowing Jobs To Fail
7569

76-
Configure Travis CI to allow jobs to fail only when certain conditions are met.
77-
78-
For example, this will allow the job with the env var `TWO=two` to fail when the build runs on the branch `dev`:
70+
You can configure Travis CI to allow jobs to fail only when certain conditions are met. For example, this will allow the job with the env var `TWO=two` to fail when the build runs on the branch `dev`:
7971

8072
```yaml
8173
env:

0 commit comments

Comments
 (0)