Skip to content

Commit

Permalink
fixed release script and workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Meggle committed Mar 11, 2024
1 parent ad497ae commit cc9adb1
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 20 deletions.
15 changes: 9 additions & 6 deletions .devcontainer/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,30 @@ set -u
MVERSION="2"
NAME="robotmk"
PACKAGEFILE=$OMD_ROOT/var/check_mk/packages/$NAME
PKGDIR=$OMD_ROOT/var/check_mk/packages_local

# Ownership can look dubious for git, fix this.
git config --global --add safe.directory $WORKSPACE
# get the current tag (Release) or commit hash (Artifact)
export RMK_VERSION=$(git describe --exact-match --tags 2>/dev/null || git rev-parse --short HEAD)
#export RMK_VERSION=$(git describe --tags `git rev-list --tags --max-count=1`)
# dirty hack - won't spent more time into this...
export RMK_VERSION="1.4.3"

echo "▹ Removing old packages..."
rm -f $OMD_ROOT/var/check_mk/packages/*

echo "---------------------------------------------"
echo "▹ Generating package infofile ..."
jq '. += {version:env.RMK_VERSION}' $WORKSPACE/pkginfo >$PACKAGEFILE
jq --arg omdversion "$(omd version | rev | cut -d" " -f 1 | rev)" '. += {version:env.RMK_VERSION, "version.packaged":$omdversion}' $WORKSPACE/pkginfo >$PACKAGEFILE

echo "---------------------------------------------"
echo "$PACKAGEFILE:"
cat $PACKAGEFILE
echo "---------------------------------------------"
echo "▹ Building the MKP '$NAME' on $RMK_VERSION ..."
# set -x
ls -la $PACKAGEFILE
mkp -v pack $NAME
FILE=$(ls -rt1 *.mkp | tail -1)
mkp -v package $PACKAGEFILE
FILE=$(ls -rt1 $PKGDIR/*.mkp | tail -1)
# robotmk.cmk2-v1.1.0.mkp
NEWFILENAME=$NAME.$RMK_VERSION-cmk$MVERSION.mkp
mv $FILE $NEWFILENAME
Expand All @@ -61,7 +63,8 @@ if [ -n "${GITHUB_WORKSPACE-}" ]; then
echo "▹ Set Outputs for GitHub Workflow steps"
echo "::set-output name=pkgfile::$NEWFILENAME"
# echo "::set-output name=pkgname::${NAME}"
VERSION=$(jq -r '.version' $PACKAGEFILE)
# dirty hack - won't spent more time into this...
VERSION="1.4.3"
# echo "::set-output name=pkgversion::$RMK_VERSION"
# echo "::set-output name=cmkmversion::$MVERSION"
echo "::set-output name=artifactname::$NEWFILENAME"
Expand Down
23 changes: 15 additions & 8 deletions .github/workflows/mkp-release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: MKP-Release

on:
workflow_dispatch:
push:
tags:
- '*'
branches:
- 'v1/stable'

jobs:

Expand All @@ -21,7 +22,7 @@ jobs:

steps:
- name: Install tools
run: apt update && apt-get -y install sudo jq tree
run: apt update && apt-get -y install sudo jq tree hub
- name: Create Checkmk Site
run: /docker-entrypoint.sh /bin/true
- name: Checkout Robotmk repository
Expand Down Expand Up @@ -55,6 +56,8 @@ jobs:
env:
WORKSPACE: ${{ github.workspace }}
steps:
- name: Install tools
run: sudo apt update && sudo apt-get -y install hub
- name: Checkout Robotmk repository
uses: actions/checkout@v2
- name: Download CMK1/2 artifact
Expand All @@ -73,19 +76,23 @@ jobs:
- name: chag
run: bash chag contents > RELEASE_CHANGELOG.md

- name: Get Tag
id: tag
run: echo ::set-output name=VERSION::${GITHUB_REF##*/}
# - name: Get Tag
# id: tag
# run: echo ::set-output name=VERSION::${GITHUB_REF##*/}
- name: Get Version
id: version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
# (The Release text will be taken from the annotated tag, created with "chag")
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_NAME: ${GITHUB_REF##*/}
RELEASE_NAME: ${{ steps.version.outputs.VERSION }}
with:
name: Release ${{ steps.tag.outputs.VERSION }}
name: Release ${{ steps.version.outputs.VERSION }}
body_path: RELEASE_CHANGELOG.md
tag_name: ${{ steps.version.outputs.VERSION }}
draft: false
prerelease: false
# -m "" means: Leave the Release mesage body as it is, do not modify
Expand Down
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## 1.4.3 - 2024-03-08
## Unreleased

Compatibility version for Checkmk V2.3

This will be the last version of Robotmk v1.
Robotmk will be continued as an integration in Checkmk v2.3 (aka "Synthetic Monitoring").

## 1.4.2 - 2023-05-16

Compatibility patch for Checkmk V2.3
Compatibility patch for Checkmk V2.2

### Changed

Expand Down
7 changes: 4 additions & 3 deletions pkginfo
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "robotmk",
"author": "Simon Meggle <[email protected]>",
"description": "Robotmk integrates Robot Framework results into Checkmk. Robot Framework is a generic testing framework which can test web based and native applications (and much more). It is very popular, easy to learn and highly extendable by libraries. Libraries provide the functionality to use modern test web technologies (Playwright/Selenium), control user interfaces (ImageHorizon, SikuliX, AutoIT, SAP, ...), REST/SOAP APIs etc. It is based on Python and can be extended by own libraries as well. See https://robotframework.org for more information.",
"description": "Robotmk integrates Robot Framework results into Checkmk.",
"download_url": "https://github.com/elabit/robotmk/releases",
"title": "Robotmk | Robot Framework End2End Test Integration",
"title": "Robotmk v1 | Robot Framework End2End Test Integration",
"files": {
"agent_based": [
"robotmk.py"
Expand All @@ -27,5 +27,6 @@
"htdocs/images/icons/robotmk80_dot.png"
]
},
"version.min_required": "2.0.0"
"version.packaged": "2.3.0b1.cce",
"version.min_required": "2.3.0b1.cce"
}
2 changes: 1 addition & 1 deletion release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function release() {
git checkout $masterbranch
git merge $devbranch --no-ff --no-edit --strategy-option theirs
header "Create annotated git tag from Changelog entry ..."
chag tag --addv
chag tag
header "Pushing ..."
git push origin $masterbranch
git push origin $VTAG
Expand Down

0 comments on commit cc9adb1

Please sign in to comment.