Skip to content

Commit

Permalink
[feature] Added support for Ubuntu 24.04 and Debian 12 + CI updates
Browse files Browse the repository at this point in the history
* [feature] Added support for Ubuntu 24.04 and Debian
* [ci] Avoid stopping build on QA checks failure
* [ci] Updated OSes used in CI build
* [chores] Added assets tag

---------

Co-authored-by: Gagan Deep <[email protected]>
  • Loading branch information
nemesifier and pandafy authored Jul 5, 2024
1 parent 83b8818 commit ccaba43
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 26 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ on: # yamllint disable-line rule:truthy
jobs:
build:
name: Build ${{ matrix.distro }}
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

strategy:
fail-fast: false
matrix:
distro:
- ubuntu2404
- ubuntu2204
- ubuntu2004
- debian12
- debian11

steps:
Expand All @@ -33,19 +35,19 @@ jobs:
with:
python-version: '3.x'

- name: Install python dependencies
- name: Install Dependencies
id: deps
run: |
pip install molecule molecule-plugins[docker] yamllint ansible-lint docker
pip install openwisp-utils[qa]
- name: Install Ansible Galaxy dependencies
run: ansible-galaxy collection install "community.general:>=3.6.0"
ansible-galaxy collection install "community.general:>=3.6.0"
- name: QA checks
run: |
openwisp-qa-check --skip-isort --skip-flake8 --skip-checkmigrations --skip-black
- name: Tests
if: ${{ !cancelled() && steps.deps.conclusion == 'success' }}
run: |
mkdir -p ~/.ansible/roles
ln -s $GITHUB_WORKSPACE ~/.ansible/roles/openwisp.wifi_login_pages
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ansible-openwisp-wifi-login-pages

[![Build Status](https://github.com/openwisp/ansible-openwisp-wifi-login-pages/workflows/Ansible%20OpenWISP%20WiFi%20Login%20Pages%20CI%20Build/badge.svg?branch=master)](https://github.com/openwisp/ansible-openwisp-wifi-login-pages/actions)
[![Ansible OpenWISP WiFi Login Pages CI Build](https://github.com/openwisp/ansible-openwisp-wifi-login-pages/actions/workflows/ci.yml/badge.svg)](https://github.com/openwisp/ansible-openwisp-wifi-login-pages/actions/workflows/ci.yml)

Ansible role to deploy and manage [openwisp-wifi-login-pages](https://github.com/openwisp/openwisp-wifi-login-pages).

Expand Down Expand Up @@ -31,7 +31,7 @@ to install openwisp-wifi-login-pages.

### Install ansible

Install ansible (version 2.10 or higher) **on your local machine** (not the production server!) if
Install ansible (version 2.13 or higher) **on your local machine** (not the production server!) if
you haven't done already.

To **install ansible** we suggest you follow the official [ansible installation guide](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#installing-ansible-in-a-virtual-environment-with-pip). It is recommended to install ansible through a virtual environment to avoid dependency issues.
Expand Down Expand Up @@ -196,9 +196,11 @@ pip install molecule[docker] yamllint ansible-lint docker
**Step 4**: Download docker images
```
docker pull geerlingguy/docker-ubuntu2404-ansible:latest
docker pull geerlingguy/docker-ubuntu2204-ansible:latest
docker pull geerlingguy/docker-ubuntu2004-ansible:latest
docker pull geerlingguy/docker-debian11-ansible:latest
docker pull geerlingguy/docker-debian12-ansible:latest
```
**Step 5**: Install ansible dependencies
Expand Down
2 changes: 1 addition & 1 deletion meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ galaxy_info:
author: OpenWISP
company: OpenWISP
description: Role to install and upgrade OpenWISP WiFi Login Pages
min_ansible_version: 2.10
min_ansible_version: 2.13
issue_tracker_url: https://github.com/openwisp/openwisp-wifi-login-pages/issues
platforms:
- name: Debian
Expand Down
3 changes: 2 additions & 1 deletion molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ platforms:
image: "geerlingguy/docker-${MOLECULE_DISTRO}-ansible:${tag:-latest}"
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
privileged: true
pre_build_image: true
provisioner:
Expand Down
25 changes: 22 additions & 3 deletions molecule/local/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,44 @@ lint: |
yamllint . || true
ansible-lint || true
platforms:
- name: "openwisp2-ubuntu2404"
image: "geerlingguy/docker-ubuntu2404-ansible:latest"
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
privileged: true
pre_build_image: true
- name: "openwisp2-ubuntu2204"
image: "geerlingguy/docker-ubuntu2204-ansible:latest"
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
privileged: true
pre_build_image: true
- name: "openwisp2-ubuntu2004"
image: "geerlingguy/docker-ubuntu2004-ansible:latest"
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
privileged: true
pre_build_image: true
- name: "openwisp2-debian11"
image: "geerlingguy/docker-debian11-ansible:latest"
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
privileged: true
pre_build_image: true
- name: "openwisp2-debian12"
image: "geerlingguy/docker-debian12-ansible:latest"
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
privileged: true
pre_build_image: true
provisioner:
Expand Down
49 changes: 35 additions & 14 deletions tasks/apt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,39 @@
register: result
until: result is success

- name: Add nodejs apt key
apt_key:
url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key
state: present
- name: NodeJS deb source
block:
- name: Download nodesource gpg key
get_url:
url: https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key
dest: /etc/apt/trusted.gpg.d/nodesource.asc
checksum: sha256:332d428848005f43bfc79b9578c55cd172f5f17ae38aa7d9328f03a24e21c13a
ignore_errors: true
retries: 5
delay: 10
register: result
until: result is success

- name: Add nodejs 20.x ppa for apt repo
apt_repository:
repo: "deb https://deb.nodesource.com/node_20.x {{ ansible_distribution_release.lower() }} main"
- name: Add nodejs 20.x ppa for apt repo
apt_repository:
repo: "deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/nodesource.asc] https://deb.nodesource.com/node_20.x nodistro main"

- name: Add yarn apt key
apt_key:
url: https://dl.yarnpkg.com/debian/pubkey.gpg
state: present
- name: Yarn deb source
block:
- name: Download dl.yarnpkg.com gpg key
ansible.builtin.get_url:
url: https://dl.yarnpkg.com/debian/pubkey.gpg
dest: /etc/apt/trusted.gpg.d/yarnpkg.asc
checksum: sha256:8550a7e298b523fffa899069754fc150f2ff74092701e4d4109edd1cd6d5327f
ignore_errors: true
retries: 5
delay: 10
register: result
until: result is success

- name: Add yarn ppa for apt repo
apt_repository:
repo: "deb https://dl.yarnpkg.com/debian/ stable main"
- name: Add nodejs 20.x ppa for apt repo
apt_repository:
repo: "deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/yarnpkg.asc] https://dl.yarnpkg.com/debian/ stable main"

- name: Install nodejs and yarn
apt:
Expand All @@ -47,3 +63,8 @@
- nodejs
- yarn
state: latest
ignore_errors: true
retries: 5
delay: 10
register: result
until: result is success
1 change: 1 addition & 0 deletions tasks/yarn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
group: "{{ www_group }}"
mode: 0640
failed_when: false
tags: [assets]

- name: yarn build
become: true
Expand Down

0 comments on commit ccaba43

Please sign in to comment.