Commit e5b26975 authored by Marcel Amirault's avatar Marcel Amirault

Merge branch 'docs-selhorn-monorepofix' into 'master'

Docs: Updated monorepo example

Closes #227381

See merge request gitlab-org/gitlab!36896
parents 1b7292d3 799a2159
......@@ -82,44 +82,39 @@ Using the example project above, this `gitlab-ci.yml` file will publish
and publish `MyPackage` anytime changes are made to anywhere _except_ the `Foo`
directory on the `master` branch.
```shell
```yaml
image: node:latest
stages:
- build
.default-rule: &default-rule
if: '$CI_MERGE_REQUEST_IID || $CI_COMMIT_REF_SLUG == "master"'
.foo-package:
build-foo-package:
stage: build
variables:
PACKAGE: "Foo"
before_script:
script:
- cd src/components/Foo
- echo "Building $PACKAGE"
- npm publish
only:
refs:
- master
- merge_requests
changes:
- "src/components/Foo/**/*"
.parent-package:
build-my-project-package:
stage: build
variables:
PACKAGE: "MyPackage"
except:
changes:
- "src/components/Foo/**/*"
.build-package:
stage: build
script:
- echo "Building $PACKAGE"
- npm publish
rules:
- <<: *default-rule
build-foo-package:
extends:
- .build-package
- .foo-package
build-my-project-package:
extends:
- .build-package
- .parent-package
only:
refs:
- master
- merge_requests
except:
changes:
- "src/components/Foo/**/*"
```
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment