Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
feat(IMPORT): import role from legacy provisioner project
Browse files Browse the repository at this point in the history
  • Loading branch information
niall-byrne committed May 29, 2021
1 parent c6e5f0b commit 0c88a23
Show file tree
Hide file tree
Showing 16 changed files with 281 additions and 95 deletions.
12 changes: 12 additions & 0 deletions .cookiecutter/cookiecutter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"_template": "https://github.com/shared-vision-solutions/ansible-workbench.git",
"author": "Niall Byrne",
"company": "Shared Vision Solutions",
"description": "Ansible role that installs the JumpCloud agent on OSX machines.",
"email": "niall@niallbyrne.ca",
"galaxy_namespace_slug": "osx_provisioner",
"galaxy_role_slug": "jumpcloud",
"github_handle": "osx-provisioner",
"project_name": "role-jumpcloud",
"project_slug": "role-jumpcloud"
}
174 changes: 105 additions & 69 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,36 @@ on:

jobs:

build:
documentation_test:

runs-on: ubuntu-latest

steps:

- name: Documentation Test -- Checkout Repository
uses: actions/checkout@v1

- name: Documentation Test -- Setup Environment
run: |
source ./.github/scripts/setup.sh
env:
WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}

- name: Documentation Test -- Documentation Validation
uses: gaurav-nelson/github-action-markdown-link-check@1.0.11
with:
use-quiet-mode: 'no'
use-verbose-mode: 'yes'

- name: Documentation Test -- Report Success
run: |
./.github/scripts/notifications.sh "${NOTIFICATION}" ":white_check_mark: documentation test was successful!"
- name: Documentation Test -- Report Failure
if: failure()
run: |
./.github/scripts/notifications.sh "${NOTIFICATION}" ":x: documentation test has failed!"
molecule_lint:

runs-on: ubuntu-latest
strategy:
Expand All @@ -19,65 +48,84 @@ jobs:
python-version: [3.7]

steps:
- name: Set up Python ${{ matrix.python-version }}

- name: Molecule Lint -- Checkout Repository
uses: actions/checkout@v1
- name: Molecule Lint -- Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Build -- Checkout Repository
uses: actions/checkout@v1

- name: Build -- Setup Environment
- name: Molecule Lint -- Setup Environment
run: |
source ./.github/scripts/setup.sh
env:
WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}

- name: Build -- Install Requirements
- name: Molecule Lint -- Install Requirements
run: |
pip install poetry
poetry install
- name: Build -- Run Linter
- name: Molecule Lint -- Run Linter
run: |
poetry run molecule lint
- name: Build -- Run docker1 Scenario
run: |
poetry run molecule test -s docker1
- name: Build -- Report Job Status (Success)
- name: Molecule Lint -- Report Job Status (Success)
run: |
./.github/scripts/notifications.sh "${NOTIFICATION}" "build was successful!"
- name: Build -- Report Job Status (Failure)
./.github/scripts/notifications.sh "${NOTIFICATION}" ":white_check_mark: molecule linting was successful!"
- name: Molecule Lint -- Report Job Status (Failure)
if: failure()
run: |
./.github/scripts/notifications.sh "${NOTIFICATION}" "build has failed!"
./.github/scripts/notifications.sh "${NOTIFICATION}" ":x: molecule linting has failed!"
documentation_test:
release:
needs: [molecule_lint, documentation_test, security_test]

runs-on: ubuntu-latest

steps:
- name: Documentation Test -- Checkout Repository

- name: Release -- Checkout Repository
if: contains(github.ref, '/tags/v')
uses: actions/checkout@v1
- name: Documentation Test -- Setup Environment

- name: Release -- Setup Environment
if: contains(github.ref, '/tags/v')
run: |
source ./.github/scripts/setup.sh
NEWTAG=${BRANCH_OR_TAG}
echo "NEWTAG=${NEWTAG}" >> $GITHUB_ENV
echo "{}" > package.json
env:
WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}

- name: Documentation Test -- Documentation Validation
uses: gaurav-nelson/github-action-markdown-link-check@1.0.11
- name: Release -- Generate Changelog
if: contains(github.ref, '/tags/v')
uses: scottbrenner/generate-changelog-action@1.0.3
id: Changelog
env:
REPO: ${{ github.repository }}
- name: Release -- Create Github Release
if: contains(github.ref, '/tags/v')
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
use-quiet-mode: 'no'
use-verbose-mode: 'yes'
tag_name: ${{ env.NEWTAG }}
release_name: Release ${{ env.NEWTAG }}
body: |
${{ steps.Changelog.outputs.changelog }}
draft: true
prerelease: false

- name: Documentation Test -- Report Success
- name: Release -- Report Job Status (Success)
if: contains(github.ref, '/tags/v')
run: |
./.github/scripts/notifications.sh "${NOTIFICATION}" "documentation test has passed!"
- name: Documentation Test -- Report Failure
if: failure()
./.github/scripts/notifications.sh "${NOTIFICATION}" ":white_check_mark: automated release has been created:\nhttps://github.com/${USERNAME}/${PROJECT_NAME}/releases"
- name: Release -- Report Job Status (Failure)
if: failure() && contains(github.ref, '/tags/v')
run: |
./.github/scripts/notifications.sh "${NOTIFICATION}" "documentation test has failed!"
./.github/scripts/notifications.sh "${NOTIFICATION}" ":x: automated release generation failed!"
security_test:

Expand All @@ -88,13 +136,14 @@ jobs:
python-version: [3.7]

steps:

- name: Security Test -- Checkout Repository
uses: actions/checkout@v1
- name: Security Test -- Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Security Test -- Checkout Repository
uses: actions/checkout@v1
- name: Security Test -- Setup Environment
run: |
source ./.github/scripts/setup.sh
Expand All @@ -111,61 +160,48 @@ jobs:
poetry install
safety check
- name: Shellcheck -- Report Job Status on Success
- name: Security Test -- Report Job Status on Success
run: |
./.github/scripts/notifications.sh "${NOTIFICATION}" "security checks succeeded!"
- name: Shellcheck -- Report Job Status on Failure
./.github/scripts/notifications.sh "${NOTIFICATION}" ":white_check_mark: security checks were successful!"
- name: Security Test -- Report Job Status on Failure
if: failure()
run: |
./.github/scripts/notifications.sh "${NOTIFICATION}" "security checks failed!"
./.github/scripts/notifications.sh "${NOTIFICATION}" ":x: security checks failed!"
release:
needs: [build, documentation_test, security_test]
workflow_lint:

runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.7]

steps:
- name: Release -- Checkout

- name: Workflow Lint -- Checkout Repository
uses: actions/checkout@v1
- name: Workflow Lint -- Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Release -- Setup Environment
- name: Workflow Lint -- Setup Environment
run: |
source ./.github/scripts/setup.sh
env:
WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
- name: Workflow Lint -- Install Requirements
run: |
pip install yamllint
- name: Release -- Prepare Content
if: contains(github.ref, '/tags/v')
- name: Workflow Lint -- Run Linter
run: |
NEWTAG=${BRANCH_OR_TAG}
echo "NEWTAG=${NEWTAG}" >> $GITHUB_ENV
echo "{}" > package.json
- name: Release -- Generate Changelog
if: contains(github.ref, '/tags/v')
uses: scottbrenner/generate-changelog-action@1.0.3
id: Changelog
env:
REPO: ${{ github.repository }}
- name: Release -- Create Github Release
if: contains(github.ref, '/tags/v')
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.NEWTAG }}
release_name: Release ${{ env.NEWTAG }}
body: |
${{ steps.Changelog.outputs.changelog }}
draft: true
prerelease: false
yamllint .github/workflows
- name: Release -- Report Job Status (Success)
if: contains(github.ref, '/tags/v')
- name: Workflow Lint -- Report Job Status (Success)
run: |
./.github/scripts/notifications.sh \
"${NOTIFICATION}" \
"automated release has been created: https://github.com/${USERNAME}/${PROJECT_NAME}/releases"
- name: Release -- Report Job Status (Failure)
if: failure() && contains(github.ref, '/tags/v')
./.github/scripts/notifications.sh "${NOTIFICATION}" ":white_check_mark: workflow linting was successful!"
- name: Workflow Lint -- Report Job Status (Failure)
if: failure()
run: |
./.github/scripts/notifications.sh "${NOTIFICATION}" "automated release generation failed!"
./.github/scripts/notifications.sh "${NOTIFICATION}" ":x: workflow linting has failed!"
13 changes: 7 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ jobs:
python-version: [3.7]

steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Publish to Galaxy -- Code Checkout (workflow dispatch)
if: github.event_name == 'workflow_dispatch'
Expand All @@ -42,6 +38,11 @@ jobs:
with:
fetch-depth: 0

- name: Publish to Galaxy -- Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Publish to Galaxy -- Setup Environment
run: |
source .github/scripts/setup.sh
Expand All @@ -60,8 +61,8 @@ jobs:

- name: Publish to Galaxy -- Report Job Status (Success)
run: |
./.github/scripts/notifications.sh "${NOTIFICATION}" "automated galaxy import has been completed!"
./.github/scripts/notifications.sh "${NOTIFICATION}" ":white_check_mark: automated ansible galaxy import has been completed!"
- name: Publish to Galaxy -- Report Job Status (Failure)
if: failure()
run: |
./.github/scripts/notifications.sh "${NOTIFICATION}" "automated galaxy import has failed!"
./.github/scripts/notifications.sh "${NOTIFICATION}" ":x: automated ansible galaxy import has failed!"
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ jobs:
- os: osx
osx_image: xcode12.5
env:
- SCENARIO=hostmachine1
- SCENARIO=mock_install_no_update
- os: osx
osx_image: xcode12.5
env:
- SCENARIO=mock_install_with_update
before_install: []
install:
- sudo python3 -m pip install poetry
Expand All @@ -16,4 +20,4 @@ script:
- poetry run molecule test -s "${SCENARIO}"
notifications:
slack:
onOocckzUfSjYwx/o1tD1wvWvOGsLYRp8LXEUDU79ycPjm/MQy2rSYiOFxkd54bn75MQZEagUm48ehVOgRzmBKEfBqcSbY7oVYinjaE3FrTedplnwbP7/925d1fWr+zqd2XshU7IQZHRNepFKw7Uux8L+tSYrGUFpgak4zS/KBDpfEzyQbqyiYeu/BycF21Mc+hgoNPzwi3oIOWhN+W6xQmIWdkqwHDi8Ut/37nLMCOtoljIVGLjHjy64Wk5Kf88xZQNMJU34BSBK5lYgsZQ8eDJlAn/yGGkxW+qUCZ1EgP9c6+jAsjLOpCUgwR7IvkYCtYQ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line number Diff line number Diff line change
Expand Up @@ -21,18 +21,23 @@ rules:
indentation:
spaces: consistent
indent-sequences: true
level: error
comments: disable
comments-indentation: disable
document-start: enable
document-start:
level: error
empty-lines:
max: 3
level: error
hyphens:
level: error
key-duplicates: enable
key-duplicates:
level: error
line-length: disable
new-line-at-end-of-file: enable
new-line-at-end-of-file:
level: error
new-lines:
type: unix
trailing-spaces: enable
trailing-spaces:
level: error
truthy: disable
Loading

0 comments on commit 0c88a23

Please sign in to comment.