Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CD Workflow - adjust for GH docker - rpmbuild+tar #151

Merged
merged 1 commit into from
May 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions .github/workflows/CD public.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,30 +70,31 @@ jobs:

- name: list opt build files
run: |
ls -R build/
ls -Rl build/
ls -dl build/opt/sap/saphana-checks/{bin,lib}

- name: set Ownership and Permissions
run: |
chmod -R 444 build/opt/sap/saphana-checks
chmod 755 build/opt/sap/saphana-checks/bin/saphana-check.sh
chown -R root:root build/opt/sap/saphana-checks
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 /usr/src/packages/BUILD/saphana-checks
rm -rf /usr/src/packages/BUILD/saphana-checks/*
cp -rp build/* /usr/src/packages/BUILD/saphana-checks/
rpmbuild -v -bb --define "_version ${_VERSION}" --define "_release ${RELEASE_COMMIT}" ./buildscripts/saphana-checks-rpm.spec
cp /usr/src/packages/RPMS/noarch/saphana-checks-${VERSION_RELEASE_COMMIT}.noarch.rpm build/
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"
tar -czf build/saphana-checks-${VERSION_RELEASE_COMMIT}.tgz --directory=./build/opt/sap saphana-checks
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
Expand Down