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

updating some things to clean up for final review #10

Merged
merged 14 commits into from
Nov 22, 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
6 changes: 4 additions & 2 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# .ansible-lint

rulesdir:
- ../../ansible-lint-custom-rules/rules/
profile: production

# rulesdir:
# - ../../ansible-lint-custom-rules/rules/

enable_list:
- fqcn-builtins # opt-in
Expand Down
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.yml linguist-detectable
*.yaml linguist-detectable
128 changes: 128 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
---
name: Release

on:
release:
types:
- published

jobs:
ansible-tests:
uses: ansible-middleware/rhbk-ha-cluster/.github/workflows/ansible.yml@main
ci:
uses: ansible-middleware/rhbk-ha-cluster/.github/workflows/ci.yml@main
prechecks:
needs:
- ansible-tests
- ci
runs-on: ubuntu-latest
steps:
- run: >-
python -c "assert set([
'${{ needs.ansible-tests.result }}',
'${{ needs.ci.result }}',
]) == {'success'}"
infra_release:
needs:
- prechecks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install Ansible
run: pip install --upgrade ansible-core

- name: Update version in galaxy.yml
run: sed -i 's/version:.*$/version:{{:dumb_space_issue:}}${{ github.ref_name }}/' galaxy.yml; sed -i 's/{{:dumb_space_issue:}}/ /' galaxy.yml

- name: Build collection
run: ansible-galaxy collection build -vvv
shell: bash
working-directory: ${{ vars.GITHUB_PATH }}

- name: Get tar name
run: echo "tar_file=$(ls | grep '.tar')" >> $GITHUB_OUTPUT
id: build

- name: Get version
run: echo "NUM=$(cat galaxy.yml | grep version | cut -d ':' -f 2 | awk '{print $1}')" >> $GITHUB_OUTPUT
id: vers

- name: Install collection
run: ansible-galaxy collection install ./infra-rhbk_ha_cluster-${{ steps.vers.outputs.NUM }}.tar.gz -p /home/runner/collections
shell: bash
working-directory: ${{ vars.GITHUB_PATH }}

- name: Publish to galaxy
run: ansible-galaxy collection publish --api-key=${{ secrets.GALAXY_INFRA_KEY }} ${{ steps.build.outputs.tar_file }}

- name: Publish to Automation Hub
run: |
cat << EOF > ansible.cfg
[galaxy]
server_list = rh_automation_hub
[galaxy_server.rh_automation_hub]
url=https://cloud.redhat.com/api/automation-hub/
auth_url=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
token=${{ secrets.CONSOLE_API_KEY }}
EOF
ansible-galaxy collection publish ${{ steps.build.outputs.tar_file }}
rm ansible.cfg

- name: Upload files to tag
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ steps.build.outputs.tar_file }}
tag: ${{ github.ref }}
overwrite: true
changelog:
needs:
- infra_release
runs-on: ubuntu-latest
env:
ANSIBLE_FORCE_COLOR: 1
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install Ansible
run: pip install --upgrade ansible-core antsibull-changelog

- name: Update version in galaxy.yml
run: sed -i 's/version:.*$/version:{{:dumb_space_issue:}}${{ github.ref_name }}/' galaxy.yml; sed -i 's/{{:dumb_space_issue:}}/ /' galaxy.yml

- name: Run changelog
run: antsibull-changelog release --verbose --version ${{ github.ref_name }}

- name: Create Pull Request
id: prcreate
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Update changelog ${{ github.ref_name }}
committer: GitHub <noreply@github.com>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
signoff: false
base: main
branch: changelog-patches
delete-branch: true
title: '[RELEASE] Update changelog ${{ github.ref_name }}'
body: |
Update changelog
- Updated with changelog for release ${{ github.ref_name }}
- Auto-generated by [create-pull-request][1]

[1]: https://github.com/peter-evans/create-pull-request
labels: |
changelog
automated pr
draft: false
...
1 change: 1 addition & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
releases: {}
32 changes: 32 additions & 0 deletions changelogs/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
add_plugin_period: true
changelog_filename_template: ../CHANGELOG.rst
changelog_filename_version_depth: 0
changes_file: changelog.yaml
changes_format: combined
keep_fragments: false
mention_ancestor: true
new_plugins_after_name: removed_features
notesdir: fragments
prelude_section_name: release_summary
prelude_section_title: Release Summary
sections:
- - major_changes
- Major Changes
- - minor_changes
- Minor Changes
- - breaking_changes
- Breaking Changes / Porting Guide
- - deprecated_features
- Deprecated Features
- - removed_features
- Removed Features (previously deprecated)
- - security_fixes
- Security Fixes
- - bugfixes
- Bugfixes
- - known_issues
- Known Issues
title: CHANGE THIS IN changelogs/config.yaml!
trivial_section_name: trivial
use_fqcn: true
Empty file added changelogs/fragments/.keep
Empty file.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion files/id_rsa_aws.pub

This file was deleted.

3 changes: 1 addition & 2 deletions galaxy.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
namespace: infra
name: rhbk_ha_cluster
version: "1.0.0"
version: 1.0.0
readme: README.md
authors:
- Guido Grazioli <ggraziol@redhat.com>
Expand Down Expand Up @@ -37,7 +37,6 @@ issues: https://github.com/ansible-middleware/rhbk-ha-cluster/issues
build_ignore:
- .gitignore
- .github
- .ansible-lint
- .yamllint
- '*.tar.gz'
- '*.zip'
Expand Down
1 change: 0 additions & 1 deletion playbooks/files

This file was deleted.

2 changes: 1 addition & 1 deletion roles/certificates/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ galaxy_info:

license: Apache License 2.0

min_ansible_version: "2.14"
min_ansible_version: 2.15.0

galaxy_tags:
- java
Expand Down
2 changes: 1 addition & 1 deletion roles/fastpackages/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ galaxy_info:

license: Apache License 2.0

min_ansible_version: "2.14"
min_ansible_version: 2.15.0

galaxy_tags:
- java
Expand Down
2 changes: 1 addition & 1 deletion roles/promtail/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ galaxy_info:

license: Apache License 2.0

min_ansible_version: "2.14"
min_ansible_version: 2.15.0

galaxy_tags:
- java
Expand Down
Loading