Skip to content

Commit

Permalink
feat: Add ubuntu 24.04 (NR-248002) (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
gsanchezgavier committed May 14, 2024
1 parent bac9ba5 commit 1418bae
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 11 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci_build_docker_runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
- ubuntu1804
- ubuntu2004
- ubuntu2204
- ubuntu2404

steps:
- name: Checkout repository
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
jobs:
molecule-packaging-tests:
name: Launch molecule tests with infra-agent package
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
env:
TESTING: 'true'
steps:
Expand All @@ -16,6 +16,6 @@ jobs:
with:
repo_base_url: 'https://download.newrelic.com/infrastructure_agent'
package_name: 'newrelic-infra'
package_version: '1.48.4'
package_version: '1.52.1'
gpg_key: 'https://download.newrelic.com/infrastructure_agent/gpg/newrelic-infra.gpg'
platforms: "al2,al2023,centos7,centos8,debian-bullseye,debian-buster,redhat8,redhat9,suse15.2,suse15.3,suse15.4,suse15.5,ubuntu1604,ubuntu1804,ubuntu2004,ubuntu2204"
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
molecule/default/molecule.yml
# having the molecule.yml in .gitignore prevents the molecule converge to run.
# https://github.com/ansible/molecule/issues/4117

#molecule/default/molecule.yml
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Github action that tests the correct installation of a given package and version
- ubuntu1804
- ubuntu2004
- ubuntu2204
- ubuntu2404

## Example usage

Expand All @@ -44,7 +45,7 @@ on:
jobs:
molecule-packaging-tests:
name: Launch molecule tests with infra-agent package
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2

Expand Down
5 changes: 1 addition & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ runs:
- name: Configure Molecule and Ansible
shell: bash
run: |
sudo pipx uninstall ansible-core
sudo pip3 install molecule[docker]==4.0.4
sudo pip3 install 'rich>=10.0.0,<11.0.0'
sudo pip3 install ansible-lint[community]==5.3.2
python3 -m pip install molecule==24.2.1 ansible==9.5.1 ansible-core==2.16.6 "molecule-plugins[docker]==23.5.3"
- name: Prepare OS versions
shell: bash
run: ${GITHUB_ACTION_PATH}/prepare_platform.sh ${{ inputs.platforms }}
Expand Down
2 changes: 1 addition & 1 deletion molecule/default/dockerfiles/ubuntu1604
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM ubuntu:16.04

RUN apt-get update \
&& apt-get install -y init ca-certificates sudo curl python3 apt-transport-https\
&& apt-get install -y init ca-certificates sudo curl apt-transport-https python-minimal\
&& apt-get clean all

# Adding fake systemctl
Expand Down
10 changes: 10 additions & 0 deletions molecule/default/dockerfiles/ubuntu2404
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM ubuntu:24.04

RUN apt-get update \
&& apt-get install -y init gpg ca-certificates sudo curl \
&& apt-get clean all

# Adding fake systemctl
RUN curl https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/master/files/docker/systemctl.py -o /usr/local/bin/systemctl

CMD ["/usr/local/bin/systemctl"]
4 changes: 2 additions & 2 deletions prepare_platform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ This is a bash script to make generate a Molecule configutaion.
exit
fi

available_platforms=("al2" "al2023" "centos7" "centos8" "debian-bullseye" "debian-buster" "debian-bookworm" "redhat8" "redhat9" "suse15.2" "suse15.3" "suse15.4" "suse15.5" "ubuntu1604" "ubuntu1804" "ubuntu2004" "ubuntu2204")
available_platforms=("al2" "al2023" "centos7" "centos8" "debian-bullseye" "debian-buster" "debian-bookworm" "redhat8" "redhat9" "suse15.2" "suse15.3" "suse15.4" "suse15.5" "ubuntu1604" "ubuntu1804" "ubuntu2004" "ubuntu2204" "ubuntu2404")

# check_platforms verifies that the provided platforms are available
check_platforms() {
Expand Down Expand Up @@ -71,7 +71,7 @@ set_platforms_config() {
fi

# set python interpreter groups
if [[ $PLATFORM == "al2" || $PLATFORM == "centos7" ]]; then
if [[ $PLATFORM == "al2" || $PLATFORM == "centos7" || $PLATFORM == "ubuntu1604" ]]; then
yq -i ".platforms[] |= select(.name == \"$PLATFORM\") += {\"groups\": [\"python\"]}" $FILE_PATH
else
yq -i ".platforms[] |= select(.name == \"$PLATFORM\") += {\"groups\": [\"python3\"]}" $FILE_PATH
Expand Down

0 comments on commit 1418bae

Please sign in to comment.