Skip to content

Commit 18f1fc1

Browse files
committed
prerelease
1 parent 3fd4771 commit 18f1fc1

2 files changed

Lines changed: 45 additions & 6 deletions

File tree

.github/workflows/build-release-stable.yml

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,57 @@ on:
44
tags: 'v*'
55

66
jobs:
7-
build-package:
7+
build-image:
88
runs-on: ubuntu-latest
9+
outputs:
10+
image: ${{ steps.get_image.outputs.IMAGE }}
911
steps:
1012
- uses: actions/checkout@v4
13+
# docker login is needed for pushing the test image
14+
- uses: docker/login-action@v3
15+
with:
16+
registry: ghcr.io
17+
username: ${{ github.actor }}
18+
password: ${{ secrets.GITHUB_TOKEN }}
19+
- id: get_hash
20+
run: echo "HASH=$(find mkp -type f -printf '%p:%s' | xargs | md5sum | cut -d\ -f1)" >> $GITHUB_OUTPUT
21+
- id: get_image
22+
run: echo "IMAGE=$(echo ghcr.io/${{ github.repository }} | tr '[:upper:]' '[:lower:]'):${{ steps.get_hash.outputs.HASH }}" >> $GITHUB_OUTPUT
23+
- run: echo "image ${{ steps.get_image.outputs.IMAGE }}"
1124
# build container image for package creation
12-
- run: /usr/bin/docker build -t ${{ github.job }} -f build/Dockerfile .
13-
# actually build .mkp file
14-
- run: /usr/bin/docker run --volume $PWD:/source ${{ github.job }}
25+
- run: docker pull ${{ steps.get_image.outputs.IMAGE }} || docker build -t ${{ steps.get_image.outputs.IMAGE }} -f dockerfiles/checkmk/Dockerfile .
26+
- run: docker push ${{ steps.get_image.outputs.IMAGE }}
27+
28+
build-package:
29+
runs-on: ubuntu-latest
30+
needs: build-image
31+
container:
32+
image: ${{ needs.build-image.outputs.image }}
33+
env:
34+
CMK: /omd/sites/cmk
35+
SU: su - cmk -c
36+
steps:
37+
- uses: actions/checkout@v4
38+
- run: cp -r mkp/local/* ${CMK}/local
39+
- run: ${SU} "mkdir ${CMK}/tmp/check_mk"
40+
- run: ${SU} "mkp template yum"
41+
- run: git config --global --add safe.directory ${PWD}
42+
- run: modify-extension.py ${PWD} ${CMK}/tmp/check_mk/yum.manifest.temp
43+
# avoid error:
44+
# Error removing file /omd/sites/cmk/local/lib/python3/cmk/base/cee/plugins/bakery/yum.py: [Errno 13] Permission denied: '/omd/sites/cmk/local/lib/python3/cmk/base/cee/plugins/bakery/yum.py'
45+
# and likewise the `mkp package` fails due to already existing files
46+
- run: chmod go+rw ${CMK}/local/lib/python3/cmk/base/cee/plugins/bakery
47+
- run: chmod go+rw ${CMK}/local/lib/python3/cmk_addons/plugins/yum/agent_based
48+
- run: chmod go+rw ${CMK}/local/lib/python3/cmk_addons/plugins/yum/checkman
49+
- run: chmod go+rw ${CMK}/local/lib/python3/cmk_addons/plugins/yum/rulesets
50+
- run: cat ${CMK}/tmp/check_mk/yum.manifest.temp
51+
- run: ${SU} "mkp package ${CMK}/tmp/check_mk/yum.manifest.temp"
52+
# copy created extension package back to workspace
53+
- run: cp ${CMK}/var/check_mk/packages_local/*.mkp ${PWD}/mkp/
1554
# upload results
1655
- uses: actions/upload-artifact@v4
1756
with:
18-
path: ./*.mkp
57+
path: ./mkp/*.mkp
1958
retention-days: 1
2059

2160
github-release:

mkp/local/lib/python3/cmk_addons/plugins/yum/rulesets/yum_cee.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def _parameter_form_yum_bakery() -> Dictionary:
129129
CascadingSingleChoiceElement(
130130
name='no_deploy',
131131
title=Title("Do not deploy the YUM Update Check"),
132-
parameter_form=FixedValue(value=False),
132+
parameter_form=FixedValue(value=True),
133133
)
134134
]
135135
),

0 commit comments

Comments
 (0)