You've already forked ansible-role-common
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 183d438c06 | |||
| 0902ffb768 | |||
| 29dc2c1142 | |||
| 86e63365ce | |||
| 98bd8c9a9e | |||
| 6e7800f161 | |||
| 65f576a65c | |||
| 8e8ea09da4 | |||
| ed89133f1b | |||
| ee0b737af7 |
82
.github/workflows/ci.yml
vendored
Normal file
82
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
name: CI
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
# lint:
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - uses: actions/checkout@v4
|
||||
# - uses: actions/setup-go@v5
|
||||
# with:
|
||||
# go-version: '1.22'
|
||||
# - uses: golangci/golangci-lint-action@v3
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.10'
|
||||
#cache: 'pip' # caching pip dependencies
|
||||
- name: Ensure requirements are installed
|
||||
run: pip install -r requirements.txt
|
||||
- name: Lint with ansible-lint
|
||||
run: ansible-lint -c ".ansible-lint"
|
||||
env:
|
||||
PY_COLORS: '1'
|
||||
ANSIBLE_FORCE_COLOR: '1'
|
||||
- name: Lint with yamllint
|
||||
run: yamllint .
|
||||
env:
|
||||
PY_COLORS: '1'
|
||||
ANSIBLE_FORCE_COLOR: '1'
|
||||
molecule:
|
||||
name: Molecule Tests ${{ matrix.os }}
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
os: [almalinux8, almalinux9]
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.10'
|
||||
#cache: 'pip' # caching pip dependencies
|
||||
|
||||
- name: Ensure requirements are installed
|
||||
run: pip install -r requirements.txt
|
||||
|
||||
- name: Run Molecule tests.
|
||||
run: molecule test
|
||||
env:
|
||||
PY_COLORS: '1'
|
||||
ANSIBLE_FORCE_COLOR: '1'
|
||||
MOLECULE_DISTRO: ${{ matrix.os }}
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.22'
|
||||
- name: Install gitea provider for Go Semantic Release
|
||||
run: |
|
||||
mkdir -p .semrel/$(go env GOOS)_$(go env GOARCH)/provider-gitea/${GITEA_PROVIDER_VER}/ && \
|
||||
wget https://github.com/cybercinch/go-semantic-release-provider-gitea/releases/download/v${GITEA_PROVIDER_VER}/go-semantic-release-provider-gitea_v${GITEA_PROVIDER_VER}_linux_amd64 \
|
||||
-O .semrel/$(go env GOOS)_$(go env GOARCH)/provider-gitea/${GITEA_PROVIDER_VER}/gitea && \
|
||||
chmod a+x .semrel/$(go env GOOS)_$(go env GOARCH)/provider-gitea/${GITEA_PROVIDER_VER}/gitea
|
||||
env:
|
||||
GITEA_PROVIDER_VER: 1.0.11
|
||||
- run: |
|
||||
echo "github repo: ${GITHUB_REPOSITORY}"
|
||||
echo "env vars: $(env)"
|
||||
- uses: go-semantic-release/action@v1
|
||||
with:
|
||||
custom-arguments: --provider=gitea
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.G_TOKEN }}
|
||||
GITEA_HOST: ${{ secrets.G_SERVER_URL}}
|
||||
48
.woodpecker/release.yml
Normal file
48
.woodpecker/release.yml
Normal file
@@ -0,0 +1,48 @@
|
||||
matrix:
|
||||
include:
|
||||
- MOLECULE_DISTRO: centos7
|
||||
- MOLECULE_DISTRO: almalinux8
|
||||
- MOLECULE_DISTRO: almalinux9
|
||||
|
||||
clone:
|
||||
git:
|
||||
image: woodpeckerci/plugin-git
|
||||
settings:
|
||||
recursive: true
|
||||
submodule_update_remote: true
|
||||
when:
|
||||
event: [ push ]
|
||||
|
||||
steps:
|
||||
create-release:
|
||||
name: Test on ${MOLECULE_DISTRO}
|
||||
image: guisea/ansible-molecule
|
||||
pull: true
|
||||
environment:
|
||||
PY_COLORS: '1'
|
||||
ANSIBLE_FORCE_COLOR: '1'
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
commands:
|
||||
- molecule test --scenario-name ${MOLECULE_SCENARIO:-default}
|
||||
#secrets: [ auth_duo_host, auth_duo_ikey, auth_duo_skey, auth_duo_mirror_url ]
|
||||
when:
|
||||
event:
|
||||
- push
|
||||
- manual
|
||||
ntfy:
|
||||
image: codeberg.org/l-x/woodpecker-ntfy
|
||||
settings:
|
||||
url: https://ntfy.cybercinch.nz/ci-status
|
||||
title: "Test failed for ${CI_REPO_NAME} - Distro: ${MOLECULE_DISTRO} Scenario: ${MOLECULE_SCENARIO:-default}"
|
||||
priority: urgent
|
||||
icon: https://woodpecker-ci.org/img/logo.svg
|
||||
tags: robot,warning,rotating_light,${CI_BUILD_EVENT},${CI_REPO_NAME}
|
||||
message: >
|
||||
📝 Commit by ${CI_COMMIT_AUTHOR} on ${CI_COMMIT_BRANCH}:
|
||||
${CI_COMMIT_MESSAGE}
|
||||
when:
|
||||
event: [ push, manual ]
|
||||
status: [ failure ]
|
||||
depends_on:
|
||||
- lint
|
||||
@@ -1,4 +1,4 @@
|
||||
# Common [](https://ci.cybercinch.nz/repos/6)
|
||||
# Common [](https://ci.cybercinch.nz/repos/8)
|
||||
=========
|
||||
|
||||
A brief description of the role goes here.
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
# /usr/local/bin/dynmotd
|
||||
#
|
||||
|
||||
if getent group "{{ admin_group }}" | grep -qw "$(whoami)"; then
|
||||
USER=`/usr/bin/env whoami`
|
||||
HOSTNAME=`/usr/bin/env uname -n | /usr/bin/env cut -d. -f1`
|
||||
IP=`/usr/bin/env ip route get 1 | /usr/bin/env grep -Po '(?<=src.)[\w\d.]+'`
|
||||
@@ -96,3 +97,7 @@ echo -e "
|
||||
if [ -f /etc/motd ]; then
|
||||
/usr/bin/env cat /etc/motd
|
||||
fi
|
||||
else
|
||||
# Just exit :)
|
||||
exit 0
|
||||
fi;
|
||||
|
||||
Reference in New Issue
Block a user