Skip to content

Commit

Permalink
Merge pull request #12 from markosamuli/feature/v2
Browse files Browse the repository at this point in the history
Support for RedHat-based systems and latest Ansible versions
  • Loading branch information
markosamuli authored Feb 17, 2023
2 parents 1a38b3e + 7aaa59f commit 43e4115
Show file tree
Hide file tree
Showing 40 changed files with 1,026 additions and 474 deletions.
5 changes: 4 additions & 1 deletion .ansible-lint
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
---
exclude_paths:
- .travis.yml
- .travis.yml
- .ansible-lint
- .github/
120 changes: 120 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
---
name: Test and release

# This workflow is triggered on pushes to the repository.
on:
pull_request:
branches:
- "**"
push:
branches:
- master
tags:
- v.*

jobs:
lint:
name: Lint with pre-commit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: "18"

- uses: actions/setup-python@v3
with:
python-version: "3.11"

- uses: actions/setup-go@v3
with:
go-version: "1.19"

- name: Install dependencies
run: |
pip3 install pre-commit
go install mvdan.cc/sh/v3/cmd/shfmt@latest
sudo apt-get install -y shellcheck
python --version
shfmt -version
shellcheck --version
pre-commit --version
- name: Cache pre-commit dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pre-commit/
# yamllint disable-line rule:line-length
key: ${{ runner.os }}-pre-commit-${{ hashFiles('**/.pre-commit-config.yaml') }}
restore-keys: |
${{ runner.os }}-pre-commit-
- name: Run pre-commit
run: pre-commit run -a

ubuntu:
runs-on: ubuntu-latest
strategy:
matrix:
distrib: [ubuntu]
release: [focal, jammy, bionic]

name: Test on ${{ matrix.distrib }}:${{ matrix.release }}
env:
DISTRIB: ${{ matrix.distrib }}
RELEASE: ${{ matrix.release }}
steps:
- uses: actions/checkout@v3

- name: Run tests on ${{ matrix.distrib }}:${{ matrix.release }}
run: ./tests/run-tests ${DISTRIB}-${RELEASE}

debian:
runs-on: ubuntu-latest
strategy:
matrix:
distrib: [debian]
release: [bullseye, buster]

name: Test on ${{ matrix.distrib }}:${{ matrix.release }}
env:
DISTRIB: ${{ matrix.distrib }}
RELEASE: ${{ matrix.release }}
steps:
- uses: actions/checkout@v3

- name: Run tests on ${{ matrix.distrib }}:${{ matrix.release }}
run: ./tests/run-tests ${DISTRIB}-${RELEASE}

fedora:
runs-on: ubuntu-latest
strategy:
matrix:
distrib: [fedora]
release: [37]

name: Test on ${{ matrix.distrib }}:${{ matrix.release }}
env:
DISTRIB: ${{ matrix.distrib }}
RELEASE: ${{ matrix.release }}
steps:
- uses: actions/checkout@v3

- name: Run tests on ${{ matrix.distrib }}:${{ matrix.release }}
run: ./tests/run-tests ${DISTRIB}-${RELEASE}

release:
name: Publish tagged releases to Ansible Galaxy
needs:
- lint
- ubuntu
- debian
- fedora
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: galaxy
uses: robertdebock/[email protected]
with:
galaxy_api_key: ${{ secrets.galaxy_api_key }}
33 changes: 14 additions & 19 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,51 +1,46 @@
# -*- mode: yaml -*-
# vim:ts=2:sw=2:ai:si:syntax=yaml
################################
# pre-commit hooks configuration
################################
---

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks.git
rev: v2.2.3
rev: v4.4.0
hooks:
- id: check-executables-have-shebangs
- id: check-byte-order-marker
- id: check-case-conflict
- id: check-merge-conflict
- id: trailing-whitespace
args: ['--markdown-linebreak-ext=md']
args: ["--markdown-linebreak-ext=md"]
- id: end-of-file-fixer
- id: mixed-line-ending
args: ['--fix=lf']
args: ["--fix=lf"]
- id: check-yaml
- id: pretty-format-json
args: ['--autofix', '--indent=2', '--no-sort-keys']
args: ["--autofix", "--indent=2", "--no-sort-keys"]

- repo: https://github.com/adrienverge/yamllint.git
rev: v1.16.0
rev: v1.29.0
hooks:
- id: yamllint

- repo: https://github.com/ansible/ansible-lint.git
rev: v4.1.0
rev: v6.13.1
hooks:
- id: ansible-lint
files: \.(yaml|yml)$
exclude: .github/workflows/pipeline.yml

- repo: https://github.com/bemeurer/beautysh.git
rev: '4.1'
- repo: https://github.com/syntaqx/git-hooks
rev: v0.0.17
hooks:
- id: beautysh
- id: shellcheck
files: (tests/run-.*|tests/update)$

- repo: https://github.com/openstack-dev/bashate.git
rev: '0.6.0'
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.6.0-1
hooks:
- id: bashate
- id: shfmt
files: (tests/run-.*|tests/update)$

- repo: https://github.com/igorshubovych/markdownlint-cli.git
rev: v0.17.0
rev: v0.33.0
hooks:
- id: markdownlint
55 changes: 46 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,81 @@
# Changelog

## [2.0.0] - 2023-02-17

### Ansible compatibility

- Require Ansible 2.9.22
- Support Ansible 7.2.0
- Use fully qualified collection names (FQCN) with builtin modules

### Fixes

- Use `become_user` instead of `become` when installing with Git by [@Hunsu] in [#6]
- Remove installer script checksum that causes issues [#10]

[@hunsu]: https://github.com/Hunsu
[#6]: https://github.com/markosamuli/ansible-linuxbrew/pull/6
[#10]: https://github.com/markosamuli/ansible-linuxbrew/issues/10

### Python compatibility

- Use Python 3 on all test Docker images
- Drop support for EOL Python 2.7

### OS compatibility

- Add support for Ubuntu 20.04 LTS and 22.04 LTS
- Add support for Debian 11
- Add support for Fedora 37 and RedHat based-systems by [@aarey] in [#9]
- Drop support for Debian 11
- Drop support for Ubuntu 16.04 LTS

[@aarey]: https://github.com/aairey
[#9]: https://github.com/markosamuli/ansible-linuxbrew/pull/9

### Testing

- Run tests with supported Docker images on GitHub Actions

## [1.2.2] - 2020-09-06

### Fixed

* Update `install.sh` checksum
* Create missing `var/homebrew/linked` directory
* Update `linuxbrew-core` repository URL
- Update `install.sh` checksum
- Create missing `var/homebrew/linked` directory
- Update `linuxbrew-core` repository URL

## [1.2.1] - 2020-09-05

### Fixed

* Migrate to the new `install.sh` script
- Migrate to the new `install.sh` script

## [1.2.0] - 2019-10-25

### Changes

* Add `linuxbrew_init_shell` variable to allow shell file modification to be
- Add `linuxbrew_init_shell` variable to allow shell file modification to be
disabled. Fixes [#1]

## [1.1.1] - 2019-07-20

### Fixes

* Updated `install.sh` checksum for the 2019-07-18 updated version.
- Updated `install.sh` checksum for the 2019-07-18 updated version.

## [1.1.0] - 2019-07-14

### Changes

* Use Ansible tasks to clone the Homebrew Git repositories, create directories
- Use Ansible tasks to clone the Homebrew Git repositories, create directories
and set permissions where possible instead of using the official installer
bash script.

### Fixes

* Install installation dependencies.
* Update both `.bashrc` and `.zshrc` shell scripts.
- Install installation dependencies.
- Update both `.bashrc` and `.zshrc` shell scripts.

## [1.0.0] - 2019-01-13

Expand Down
38 changes: 33 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,40 @@
PRE_COMMIT_HOOKS=.git/hooks/pre-commit

.DEFAULT_GOAL := help

# Use VERBOSE=1 make <command> to get verbose output
ifndef VERBOSE
.SILENT:
endif

.PHONY: help
help: ## print this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort -d | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
@echo ""
$(MAKE) list-images

PRE_COMMIT_HOOKS = .git/hooks/pre-commit

TEST_IMAGES = $(shell ls tests/*/Dockerfile | xargs dirname | xargs basename)

.PHONY: setup
setup: $(PRE_COMMIT_HOOKS)

.PHONY: test
test:
@./tests/run-tests
test: ## run tests with all available Docker images
./tests/run-tests

.PHONY: list-images
list-images: ## list available test images
@echo "Available test images:"
@for i in $(TEST_IMAGES); do echo "$$i" | awk '{printf "\033[36m%-30s\033[0m run tests with %s\n", $$1, $$1}'; done

.PHONY: $(TEST_IMAGES)
$(TEST_IMAGES):
./tests/run-tests $@

.PHONY: lint
lint: $(PRE_COMMIT_HOOKS)
@pre-commit run -a
pre-commit run -a

$(PRE_COMMIT_HOOKS):
@pre-commit install
pre-commit install
Loading

0 comments on commit 43e4115

Please sign in to comment.