Pacemaker attributes - make check more robust (is pacemaker active, a… #9
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CD | |
# Controls when the workflow will run | |
on: | |
push: | |
tags: | |
- "v[0-9]+-*" | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "deploy" | |
deploy: | |
permissions: | |
# write permission is required to create a github release | |
contents: write | |
# write permission is required for autolabeler | |
# otherwise, read permission is required at least | |
pull-requests: write | |
runs-on: [ubuntu-latest] | |
env: | |
_VERSION: 9999 | |
_RELEASE: 0.1.beta0 | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v4 | |
- name: Show environment | |
run: | | |
pwd | |
env | |
- name: set Version from tag | |
if: github.ref_type == 'tag' | |
run: | | |
tagname=${GITHUB_REF_NAME#v} | |
version=${tagname%%-*} | |
release=${tagname##*-} | |
echo "_VERSION=${version}" >> "$GITHUB_ENV" | |
echo "_RELEASE=${release}" >> "$GITHUB_ENV" | |
- name: set VERSION_RELEASE_COMMIT | |
run: | | |
release_commit=${_RELEASE}.g${GITHUB_SHA::8} | |
version_release_commit=${_VERSION}-${release_commit} | |
echo "RELEASE_COMMIT=${release_commit}" >> "$GITHUB_ENV" | |
echo "VERSION_RELEASE_COMMIT=${version_release_commit}" >> "$GITHUB_ENV" | |
- name: copy files for opt build | |
run: | | |
mkdir -p build/opt/sap/saphana-checks | |
rm -rf build/opt/sap/saphana-checks/* | |
rm -rf ./scripts/lib/check_staging_area | |
cp -rp ./scripts/{bin,lib} ./build/opt/sap/saphana-checks | |
- name: modifiy VERSION & DATE | |
run: | | |
echo "[INFO] VERSION_RELEASE_COMMIT> $VERSION_RELEASE_COMMIT" | |
perl ./buildscripts/replace-version.pl ./build/opt/sap/saphana-checks/bin/saphana-check.sh ${VERSION_RELEASE_COMMIT} | |
diff ./build/opt/sap/saphana-checks/bin/saphana-check.sh ./scripts/bin/saphana-check.sh || true | |
perl ./buildscripts/replace-version.pl ./build/opt/sap/saphana-checks/bin/saphana-helper-funcs ${VERSION_RELEASE_COMMIT} | |
diff ./build/opt/sap/saphana-checks/bin/saphana-helper-funcs ./scripts/bin/saphana-helper-funcs || true | |
perl ./buildscripts/replace-version.pl ./build/opt/sap/saphana-checks/bin/saphana-logger ${VERSION_RELEASE_COMMIT} | |
diff ./build/opt/sap/saphana-checks/bin/saphana-logger ./scripts/bin/saphana-logger || true | |
- name: list opt build files | |
run: | | |
ls -Rl build/ | |
ls -dl build/opt/sap/saphana-checks/{bin,lib} | |
- name: set Ownership and Permissions | |
run: | | |
sudo chmod -R 444 build/opt/sap/saphana-checks | |
sudo chmod 755 build/opt/sap/saphana-checks/bin/saphana-check.sh | |
sudo chown -R root:root build/opt/sap/saphana-checks | |
- name: create rpm | |
run: | | |
echo "[INFO] _VERSION> $_VERSION" | |
echo "[INFO] RELEASE_COMMIT> $RELEASE_COMMIT" | |
echo "[INFO] VERSION_RELEASE_COMMIT> $VERSION_RELEASE_COMMIT" | |
mkdir -p rpmbuild/BUILD/saphana-checks | |
rm -rf rpmbuild/BUILD/saphana-checks/* | |
sudo cp -rp build/* rpmbuild/BUILD/saphana-checks/ | |
sudo rpmbuild -v -bb --define "_topdir $(pwd)/rpmbuild" --define "_version ${_VERSION}" --define "_release ${RELEASE_COMMIT}" ./buildscripts/saphana-checks-rpm.spec | |
cp rpmbuild/RPMS/noarch/saphana-checks-${VERSION_RELEASE_COMMIT}.noarch.rpm build/ | |
rpm -Kv build/saphana-checks-${VERSION_RELEASE_COMMIT}.noarch.rpm > build/saphana-checks-${VERSION_RELEASE_COMMIT}.noarch.rpm.digest | |
- name: create zipped tarball | |
run: | | |
echo "[INFO] VERSION_RELEASE_COMMIT> $VERSION_RELEASE_COMMIT" | |
sudo tar -czf build/saphana-checks-${VERSION_RELEASE_COMMIT}.tgz --directory=./build/opt/sap saphana-checks | |
sha256sum build/saphana-checks-${VERSION_RELEASE_COMMIT}.tgz > build/saphana-checks-${VERSION_RELEASE_COMMIT}.tgz.sha256 | |
ls -l build/ | |
tar -tvf build/saphana-checks-${VERSION_RELEASE_COMMIT}.tgz | |
- name: Create Release | |
run: | | |
RELEASE_TITLE="${{ github.ref_name }}" | |
RELEASE_NOTES='https://github.com/SAP/arp142-hana/milestone/xx?closed=1' | |
gh release create ${{ github.ref_name }} --draft --prerelease --title "$RELEASE_TITLE" --notes "$RELEASE_NOTES" | |
gh release upload --clobber ${{ github.ref_name }} build/saphana-checks-*.rpm* | |
gh release upload --clobber ${{ github.ref_name }} build/saphana-checks-*.tgz* | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |