Skip to content

Commit 134d4d3

Browse files
author
Jiri Benc
committed
Merge branch 'automake' into 'main'
Automatically redeploy changes to owners.yaml See merge request redhat/centos-stream/src/kernel/documentation!635
2 parents 4e18f81 + 1955c09 commit 134d4d3

File tree

2 files changed

+27
-40
lines changed

2 files changed

+27
-40
lines changed

.gitlab-ci.yml

Lines changed: 25 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ stages:
66
- container prep
77
- sanity check
88
- build
9-
- check
9+
- deploy
1010

1111
# https://docs.gitlab.com/ee/ci/yaml/README.html#switch-between-branch-pipelines-and-merge-request-pipelines
1212
# if a MR is opened: run a detached MR pipeline
@@ -81,12 +81,13 @@ build:
8181
- .fdo.distribution-image@alpine
8282
- .common_variables
8383
script:
84-
- cd scripts
84+
# call make at root directory to do a 'fullbuild'
8585
- make
8686
artifacts:
8787
paths:
88-
- scripts/yaml2CODEOWNERS
89-
- scripts/yaml2RHMAINTAINERS
88+
- info/RHMAINTAINERS
89+
- info/CODEOWNERS
90+
- info/owners.yaml
9091

9192
.pages:
9293
stage: build
@@ -113,6 +114,8 @@ build:
113114
- public
114115

115116
pages CI check:
117+
# This stage, while still "deploying" a gitlab pages instance, does *not* run
118+
# on the `main` branch.
116119
extends:
117120
- .pages
118121
before_script:
@@ -126,40 +129,31 @@ pages CI check:
126129
when: never
127130
- when: on_success
128131

129-
check:
130-
stage: check
132+
deploy:
133+
stage: deploy
134+
dependencies:
135+
- build
131136
extends:
132137
- .fdo.distribution-image@alpine
133138
- .common_variables
134139
script:
135-
# rebuild the current files
136-
- make
137-
138-
# clean up cache
139-
- rm -f .failed
140+
# we've already run 'make' and the artifacts are available.
141+
# so just deploy code to main
142+
- git config user.name "Gitlab Runner"
143+
- git config user.email ""
144+
- git add info/owners.yaml info/RHMAINTAINERS info/CODEOWNERS
145+
- git commit -m "[Gitlab CI/CD] Automated rebuild of info/*"
146+
- git push https://gitlab-ci-token:$MAKE_MAINT@gitlab.com/redhat/centos-stream/src/kernel/documentation.git '$CI_DEFAULT_BRANCH'
140147

141-
# check that the committed files matched
142-
- git diff --exit-code || touch .failed
143-
- |
144-
if [[ -e .failed ]]
145-
then
146-
echo '-----------------------------------------------------------------'
147-
echo ''
148-
echo ' Looks like the files scripts/CODEOWNERS or scripts/RHMAINTAINERS'
149-
echo ' have not been regenerated and checked in this commit.'
150-
echo ''
151-
echo ' Please run the following command before committing:'
152-
echo ' ./scripts/yaml2CODEOWNERS info/owners.yaml > info/CODEOWNERS'
153-
echo ' ./scripts/yaml2RHMAINTAINERS info/owners.yaml > info/RHMAINTAINERS'
154-
echo ''
155-
echo '-----------------------------------------------------------------'
156-
exit 1
157-
fi
148+
rules:
149+
- if: '$CI_PROJECT_NAMESPACE == "redhat/centos-stream/src/kernel" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
150+
- changes:
151+
- info/owners.yaml
158152

159153
pages:
160154
extends:
161155
- .pages
162-
stage: check
156+
stage: deploy
163157
rules:
164-
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
165-
- when: never
158+
- if: '$CI_PROJECT_NAMESPACE == "redhat/centos-stream/src/kernel" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
159+

README.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,8 @@ accompanied by a description of the modifications. In most cases, a simple
4343
explanation will do (for example, "Update x86 maintainers"), however the
4444
maintainers may ask for a more detailed write-up.
4545

46-
Standalone changes are NOT accepted for the RHMAINTAINERS or CODEOWNERS files,
47-
and changes are only accepted for the owners.yaml file. Merge requests that
48-
modify owners.yaml changes must include associated changes to RHMAINTAINERS &
49-
CODEOWNERS. These secondary files can be generated using these commands
50-
executed from the top level of documentation:
51-
52-
```
53-
make # requires minimum golang version 1.14
54-
```
46+
Changes are only accepted for the owners.yaml file, as the RHMAINTAINERS and
47+
CODEOWNERS files are generated automatically on-merge.
5548

5649
Users making changes must include a "Signed-off-by:" tag on all commits that
5750
acknowledges the DCO, https://developercertificate.org.

0 commit comments

Comments
 (0)