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

Update README and RPM release #1

Merged
merged 2 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
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
19 changes: 18 additions & 1 deletion .github/workflows/rpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,46 +18,63 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Create tag based on metadata.rb
id: create_tag
run: |
TAG=$(grep -o 'version\s*["'\''][^"'\'']*' ./resources/metadata.rb | sed 's/version\s*["'\'']//;s/["'\'']//')
echo "TAG=$TAG" >> $GITHUB_ENV
shell: bash

- name: Check if Tag Exists
id: check_tag
run: |
if git rev-parse "refs/tags/${{ env.TAG }}" >/dev/null 2>&1; then
echo "Tag ${{ env.TAG }} already exists, exiting."
exit 1
fi
shell: bash

- name: Set Version
if: success()
run: echo "VERSION=${{ env.TAG }}" >> $GITHUB_ENV

- name: Run Docker Container
if: success()
run: docker run --privileged -d --name builder --network host rockylinux:9 /bin/sleep infinity

- name: Install build tools RPM
if: success()
run: |
docker cp ./ builder:/build
docker exec builder bash -c "yum install -y epel-release && yum install -y make git mock"
docker exec builder bash -c "rm -rf /etc/mock/default.cfg"

- name: Setup SDK
if: success()
run: |
docker exec builder bash -c "curl https://raw.githubusercontent.com/redBorder/repoinit/master/sdk9.cfg > /build/sdk9.cfg"
docker exec builder bash -c "echo \"config_opts['use_host_resolv'] = True\" >> /build/sdk9.cfg"
docker exec builder bash -c "ln -s /build/sdk9.cfg /etc/mock/default.cfg"

- name: Build RPM using mock
if: success()
run: |
docker exec builder bash -c "git config --global --add safe.directory /build"
docker exec builder bash -c "cd /build/ && VERSION=${{ env.TAG }} make rpm"

- name: Copy RPMS
if: success()
run: |
docker cp builder:/build/packaging/rpm/pkgs/. ./rpms

- name: Delete non-.rpm files
if: success()
run: |
find ./rpms -type f -not -name '*.rpm' -exec rm {} \;

- name: Release
if: success()
uses: softprops/action-gh-release@v1
with:
files: ./rpms/*
Expand Down
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,35 @@
# cookbook-keepalived
# cookbook-keepalived
[![Build Status][build-shield]][build-url]
[![Linters][linters-shield]][linters-url]
[![License][license-shield]][license-url]

<!-- Badges -->
[build-shield]: https://github.com/redBorder/cookbook-keepalived/actions/workflows/rpm.yml/badge.svg?branch=master
[build-url]: https://github.com/redBorder/cookbook-keepalived/actions/workflows/rpm.yml?query=branch%3Amaster
[linters-shield]: https://github.com/redBorder/cookbook-keepalived/actions/workflows/lint.yml/badge.svg?event=push
[linters-url]: https://github.com/redBorder/cookbook-keepalived/actions/workflows/lint.yml
[license-shield]: https://img.shields.io/badge/license-AGPLv3-blue.svg
[license-url]: https://github.com/cookbook-keepalived/blob/HEAD/LICENSE

Chef cookbook to install and configure redborder keepalived

### Platforms

- Rocky Linux 9

### Chef

- Chef 15.7.0 or later

## Contributing

1. Fork the repository on Github
2. Create a named feature branch (like `add_component_x`)
3. Write your change
4. Write tests for your change (if applicable)
5. Run the tests, ensuring they all pass
6. Submit a Pull Request using Github

## License

GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007
Loading