-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore(ci): Lint and test in GitHub Actions * chore(ci): Error w.r.t. directory * chore(ci): Interjob dependency * chore(ci): Fix YAML lint errors * chore(ci): Fix path to code base for Molecule * chore(ci): Install playbook dependencies * chore(ci): Add PHP role to requirements file * chore(ci): Workaround for idempotence failure * chore: Change name in license * chore: Deploy via GitHub Actions * chore(cd): Fix YAML lint error Line too long.
- Loading branch information
1 parent
b2a766b
commit 12a9da0
Showing
11 changed files
with
208 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
--- | ||
# This file is part of Learning Sandbox Online. | ||
# | ||
# Learning Sandbox Online is free software: you can redistribute it | ||
# and/or modify it under the terms of the GNU General Public License as | ||
# published by the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# Learning Sandbox Online is distributed in the hope that it will be | ||
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||
# Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License along with | ||
# Learning Sandbox Online. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
## | ||
# Continuous integration in GitHub Actions that lints the Ansible code and tests | ||
# the playbooks with Molecule. | ||
# | ||
# @copyright 2023 Geoffrey Bernardo van Wyk (https://geoffreyvanwyk.dev) | ||
# @see GitHub Actions {@link https://docs.github.com/en/actions} | ||
## | ||
|
||
name: Build | ||
"on": | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
yamllint: | ||
name: YAML Lint | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out the codebase. | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python 3. | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.x" | ||
|
||
- name: Install test dependencies. | ||
run: pip3 install yamllint | ||
|
||
- name: Lint code. | ||
run: yamllint . | ||
|
||
ansible-lint: | ||
name: Ansible Lint | ||
needs: yamllint | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out the codebase. | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python 3. | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.x" | ||
|
||
- name: Install test dependencies. | ||
run: pip3 install ansible-lint | ||
|
||
- name: Lint code. | ||
run: ansible-lint . | ||
|
||
molecule: | ||
name: Molecule | ||
needs: ansible-lint | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: Check out the codebase. | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python 3. | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.x" | ||
|
||
- name: Install test dependencies. | ||
run: pip3 install ansible molecule molecule-plugins[docker] docker | ||
|
||
- name: Install playbooks dependencies | ||
run: ansible-galaxy role install --role-file requirements.yml | ||
|
||
- name: Run Molecule tests. | ||
run: molecule test | ||
env: | ||
PY_COLORS: "1" | ||
ANSIBLE_FORCE_COLOR: "1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
# This file is part of Learning Sandbox Online. | ||
# | ||
# Learning Sandbox Online is free software: you can redistribute it | ||
# and/or modify it under the terms of the GNU General Public License as | ||
# published by the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# Learning Sandbox Online is distributed in the hope that it will be | ||
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||
# Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License along with | ||
# Learning Sandbox Online. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
## | ||
# Continuous delivery in GitHub Actions that runs the Ansible playbooks on the | ||
# public website's servers. | ||
# | ||
# @copyright 2023 Geoffrey Bernardo van Wyk (https://geoffreyvanwyk.dev) | ||
# @see GitHub Actions {@link https://docs.github.com/en/actions} | ||
## | ||
|
||
name: Deploy | ||
"on": | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
ansible-playbook: | ||
name: Run playbook | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: Check out the codebase. | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python 3. | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.x" | ||
|
||
- name: Install Ansible. | ||
run: pip3 install ansible | ||
|
||
- name: Install playbooks dependencies | ||
run: ansible-galaxy role install --role-file requirements.yml | ||
|
||
- name: Install SSH key. | ||
uses: shimataro/ssh-key-action@v2 | ||
with: | ||
key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
known_hosts: ${{ secrets.KNOWN_HOSTS }} | ||
|
||
- name: Run plays. | ||
run: | | ||
ansible-playbook main.yml | ||
--inventory ${{ secrets.ANSIBLE_INVENTORY }}, | ||
--user ${{ secrets.ANSIBLE_USER }} | ||
env: | ||
PY_COLORS: "1" | ||
ANSIBLE_FORCE_COLOR: "1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
extends: default | ||
|
||
rules: | ||
truthy: | ||
allowed-values: ["true", "false", "yes", "no"] | ||
check-keys: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,25 @@ | ||
--- | ||
# This file is part of Online Learning Sandbox. | ||
# This file is part of Learning Sandbox Online. | ||
# | ||
# Online Learning Sandbox is free software: you can redistribute it | ||
# Learning Sandbox Online is free software: you can redistribute it | ||
# and/or modify it under the terms of the GNU General Public License as | ||
# published by the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# Online Learning Sandbox is distributed in the hope that it will be | ||
# Learning Sandbox Online is distributed in the hope that it will be | ||
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||
# Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License along with | ||
# Online Learning Sandbox. If not, see <https://www.gnu.org/licenses/>. | ||
# Learning Sandbox Online. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
## | ||
# List of roles on which this project depends. | ||
# | ||
# @copyright 2023 Geoffrey Bernardo van Wyk (https://geoffreyvanwyk.dev) | ||
## | ||
|
||
- name: geoffreyvanwyk.php | ||
- name: geoffreyvanwyk.moodle | ||
- name: geerlingguy.certbot |
8 changes: 4 additions & 4 deletions
8
...ble_sandbox_domain_alias_virtualhosts.yml → tasks/deploy_domain_alias_virtualhosts.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.