Skip to content

Commit

Permalink
Merge pull request #5 from darkwizard242/feature/update-workflows
Browse files Browse the repository at this point in the history
Update workflows
  • Loading branch information
darkwizard242 authored Feb 15, 2022
2 parents ff63afd + d0ba95b commit 24833bd
Show file tree
Hide file tree
Showing 12 changed files with 55 additions and 76 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ on:
- 'master'
push:
branches:
- 'feature*'
- 'feature_*'
- 'feature/*'
- 'hotfix/*'
- 'hotfix*'
- 'master'
schedule:
- cron: '0 0 * * *'
Expand All @@ -17,19 +21,20 @@ jobs:
code_quality:

name: SonarCloud Code Quality Check
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

steps:

- name: Checkout source code
uses: actions/checkout@v1
uses: actions/checkout@v2
with:
path: 'darkwizard242.scout'
fetch-depth: 0

- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
with:
projectBaseDir: 'darkwizard242.scout'
args: >
-Dsonar.projectVersion=${{ github.ref }}_${{ github.run_number }}
env:
Expand All @@ -40,23 +45,23 @@ jobs:
build:

name: Build & Test
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
strategy:
max-parallel: 8
max-parallel: 6
matrix:
IMAGE: [ubuntu-20.04, ubuntu-18.04, ubuntu-16.04, centos-8, centos-7, debian-buster, debian-stretch]
IMAGE: [ubuntu-20.04, ubuntu-18.04, rockylinux-8, centos-7, debian-buster, debian-stretch]

steps:

- name: Checkout source code
uses: actions/checkout@v1
uses: actions/checkout@v2
with:
path: 'darkwizard242.scout'

- name: Set up Python 3.8
- name: Set up Python 3.10.0
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.10.0

- name: Update repo cache, install python3-setuptools and required pip modules
run: |
Expand All @@ -65,6 +70,7 @@ jobs:
pip3 install -U pip wheel ansible molecule[docker] docker ansible-lint flake8 pytest-testinfra
- name: Execute Molecule test of role for ${{ matrix.IMAGE }}
working-directory: 'darkwizard242.scout'
run: DISTRO=${{ matrix.IMAGE }} molecule test
env:
PY_COLORS: '1'
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ jobs:
release:

name: Release
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

steps:

- name: Checkout source code
uses: actions/checkout@v1
uses: actions/checkout@v2
with:
path: 'darkwizard242.scout'

- name: Set up Python 3.8
- name: Set up Python 3.10.0
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.10.0

- name: Update repo cache, install python3-setuptools and required pip modules
run: |
Expand All @@ -31,4 +31,5 @@ jobs:
pip3 install -U pip wheel ansible
- name: Import to Ansible Galaxy.
working-directory: 'darkwizard242.scout'
run: ansible-galaxy role import --api-key ${{ secrets.GALAXY_API_KEY }} ${{ github.repository_owner }} $(echo ${{ github.repository }} | sed 's/.*\///')
45 changes: 0 additions & 45 deletions .travis.yml.bk

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Ali Muhammad
Copyright (c) 2022 Ali Muhammad

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
30 changes: 18 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,28 @@ Available variables are listed below (located in `defaults/main.yml`):
```yaml
scout_app: scout
scout_version: 0.15.1
scout_osarch: linux-amd64
scout_dl_url: https://github.com/liamg/{{ scout_app }}/releases/download/v{{ scout_version }}/{{ scout_app }}-{{ scout_osarch }}
scout_os: linux
scout_arch: amd64
scout_dl_url: https://github.com/liamg/{{ scout_app }}/releases/download/v{{ scout_version }}/{{ scout_app }}-{{ scout_os }}-{{ scout_arch }}
scout_bin_path: "/usr/local/bin/{{ scout_app }}"
scout_bin_permission_mode: '0755'
scout_file_owner: root
scout_file_group: root
scout_file_mode: '0755'
```
### Variables table:
Variable | Value (default) | Description
------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------
scout_app | scout | Defines the app to install i.e. **scout**
scout_version | 0.14.0 | Defined to dynamically fetch the desired version to install. Defaults to: **0.14.0**
scout_osarch | linux-amd64 | Defines os architecture. Used for obtaining the correct type of binaries based on OS System Architecture. Defaults to: **linux-amd64**
scout_dl_url | <https://github.com/liamg/{{> scout_app }}/releases/download/v{{ scout_version }}/{{ scout_app }}-{{ scout_osarch }} | Defines URL to download the scout binary from.
scout_bin_path | "/usr/local/bin/{{ scout_app }}" | Defined to dynamically set the appropriate path to store scout binary into. Defaults to (as generally available on any user's PATH): **/usr/local/bin/scout**
scout_bin_permission_mode | '0755' | Defines the permission mode level for the file.
Variable (default) | Description
------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------
scout_app | Defines the app to install i.e. **scout**
scout_version | Defined to dynamically fetch the desired version to install. Defaults to: **0.14.0**
scout_os | Defines os type. Used for obtaining the correct type of binaries based on OS type. Defaults to: **linux**
scout_arch | Defines os architecture. Used to set the correct type of binaries based on OS System Architecture. Defaults to: **amd64**
scout_dl_url | Defines URL to download the scout binary from.
scout_bin_path | Defined to dynamically set the appropriate path to store scout binary into. Defaults to (as generally available on any user's PATH): **/usr/local/bin/scout**
scout_file_owner | Owner for the binary file of scout.
scout_file_group | Group for the binary file of scout.
scout_file_mode | Mode for the binary file of scout.
## Dependencies
Expand Down Expand Up @@ -74,4 +80,4 @@ For customizing behavior of role (i.e. placing binary of **scout** package in di
## Author Information
This role was created by [Ali Muhammad](https://www.linkedin.com/in/ali-muhammad-759791130/).
This role was created by [Ali Muhammad](https://www.alimuhammad.dev/).
9 changes: 6 additions & 3 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@

scout_app: scout
scout_version: 0.15.1
scout_osarch: linux-amd64
scout_dl_url: https://github.com/liamg/{{ scout_app }}/releases/download/v{{ scout_version }}/{{ scout_app }}-{{ scout_osarch }}
scout_os: linux
scout_arch: amd64
scout_dl_url: https://github.com/liamg/{{ scout_app }}/releases/download/v{{ scout_version }}/{{ scout_app }}-{{ scout_os }}-{{ scout_arch }}
scout_bin_path: "/usr/local/bin/{{ scout_app }}"
scout_bin_permission_mode: '0755'
scout_file_owner: root
scout_file_group: root
scout_file_mode: '0755'
1 change: 0 additions & 1 deletion meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ galaxy_info:
platforms:
- name: Ubuntu
versions:
- xenial
- bionic
- focal
- name: Debian
Expand Down
2 changes: 2 additions & 0 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
hosts: all
roles:
- role: darkwizard242.scout
vars:
ansible_python_interpreter: /usr/bin/python3
4 changes: 2 additions & 2 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ lint: |
ansible-lint
flake8
platforms:
- name: ${DISTRO:-ubuntu-18.04}
image: "darkwizard242/ansible:${DISTRO:-ubuntu-18.04}"
- name: ${DISTRO:-ubuntu-20.04}
image: "darkwizard242/ansible:${DISTRO:-ubuntu-20.04}"
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
pre_build_image: true
Expand Down
1 change: 1 addition & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ sonar.projectKey=ansible-role-scout
sonar.organization=tech-overlord-github
sonar.projectName=ansible-role-scout
sonar.coverage.exclusions=**/**
sonar.python.version=3
#sonar.projectVersion=$TRAVIS_JOB_ID

# =====================================================
Expand Down
3 changes: 3 additions & 0 deletions tasks/install_debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@
url: "{{ scout_dl_url }}"
dest: "{{ scout_bin_path }}"
mode: "{{ scout_bin_permission_mode }}"
owner: "{{ scout_file_owner }}"
group: "{{ scout_file_group }}"
mode: "{{ scout_file_mode }}"
3 changes: 3 additions & 0 deletions tasks/install_el.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@
url: "{{ scout_dl_url }}"
dest: "{{ scout_bin_path }}"
mode: "{{ scout_bin_permission_mode }}"
owner: "{{ scout_file_owner }}"
group: "{{ scout_file_group }}"
mode: "{{ scout_file_mode }}"

0 comments on commit 24833bd

Please sign in to comment.