Skip to content

Commit

Permalink
feat(packaging): package for Ubuntu Jammy (#1097)
Browse files Browse the repository at this point in the history
Co-authored-by: Kevin Duret <[email protected]>
  • Loading branch information
mushroomempires and kduret authored Feb 2, 2024
1 parent 5b2cbc4 commit a2c199d
Show file tree
Hide file tree
Showing 19 changed files with 196 additions and 74 deletions.
16 changes: 11 additions & 5 deletions .github/actions/delivery/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ runs:
- name: Build name for DEB
shell: bash
if: ${{ inputs.distrib == 'bullseye' || inputs.distrib == 'bookworm' }}
if: ${{ contains(fromJSON('["bullseye", "bookworm", "jammy"]' , inputs.distrib) }}
run: |
echo "extfile=deb" >> $GITHUB_ENV
- name: Use cache files
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
with:
path: ./*.${{ env.extfile }}
key: ${{ inputs.cache_key }}
Expand All @@ -46,7 +46,7 @@ runs:
JF_URL: https://centreon.jfrog.io
JF_ACCESS_TOKEN: ${{ inputs.artifactory_token }}

- if: ${{ startsWith(inputs.distrib, 'el') }}
- if: ${{ env.extfile == 'rpm' }}
name: Publish RPMs
run: |
FILES="*.${{ env.extfile }}"
Expand Down Expand Up @@ -89,7 +89,7 @@ runs:
done
shell: bash

- if: ${{ inputs.distrib == 'bullseye' || inputs.distrib == 'bookworm' }}
- if: ${{ env.extfile == 'deb' }}
name: Publish DEBs
run: |
FILES="*.${{ env.extfile }}"
Expand All @@ -113,6 +113,12 @@ runs:
echo "[DEBUG] - Version: $VERSION"
jf rt upload "$FILE" "apt-standard-${{ inputs.version }}-${{ inputs.stability }}/pool/${{ inputs.module_name }}/" --deb "${{ inputs.distrib }}/main/$ARCH"
if [[ "${{ inputs.distrib }}" == "jammy" ]]; then
REPO_PREFIX="ubuntu"
else
REPO_PREFIX="apt"
fi
jf rt upload "$FILE" "${REPO_PREFIX}-standard-${{ inputs.version }}-${{ inputs.stability }}/pool/${{ inputs.module_name }}/" --deb "${{ inputs.distrib }}/main/$ARCH"
done
shell: bash
8 changes: 4 additions & 4 deletions .github/actions/package/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ runs:
else
export DIST=""
if [ "${{ inputs.stability }}" = "unstable" ] || [ "${{ inputs.stability }}" = "canary" ]; then
export RELEASE="$RELEASE-${{ inputs.distrib }}"
elif [ "${{ inputs.stability }}" = "testing" ]; then
export RELEASE="1-${{ inputs.distrib }}"
export RELEASE="$RELEASE~${{ inputs.distrib }}"
else
export RELEASE="1~${{ inputs.distrib }}"
fi
fi
Expand All @@ -87,7 +87,7 @@ runs:
shell: bash

- name: Cache packages
uses: actions/cache/save@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
uses: actions/cache/save@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
with:
path: ./*.${{ inputs.package_extension }}
key: ${{ inputs.cache_key }}
2 changes: 1 addition & 1 deletion .github/actions/promote-to-stable/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ runs:
shell: bash

- name: Promote DEB packages to stable
if: ${{ startsWith(inputs.distrib, 'bullseye') || startsWith(inputs.distrib, 'bookworm') }}
if: ${{ contains(fromJSON('["bullseye", "bookworm"]' , inputs.distrib) }}
run: |
echo "[DEBUG] - Major version: ${{ inputs.major_version }}"
echo "[DEBUG] - Minor version: ${{ inputs.minor_version }}"
Expand Down
6 changes: 4 additions & 2 deletions .github/docker/Dockerfile.centreon-collect-alma8
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARG REGISTRY_URL

FROM ${REGISTRY_URL}/almalinux:8

RUN <<EOF
RUN bash -e <<EOF

# Base dnf configuration.
echo 'http_caching=none' >> /etc/yum.conf && \
Expand Down Expand Up @@ -55,14 +55,16 @@ dnf install -y cmake \

dnf update libarchive

dnf clean all

pip3 install conan==1.61.0 --prefix=/usr --upgrade
rm -rf ~/.conan/profiles/default

EOF

COPY conanfile.txt .

RUN <<EOF
RUN bash -e <<EOF

cat conanfile.txt
conan install . -s compiler.cppstd=17 -s compiler.libcxx=libstdc++11 --build=missing
Expand Down
6 changes: 4 additions & 2 deletions .github/docker/Dockerfile.centreon-collect-alma9
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARG REGISTRY_URL

FROM ${REGISTRY_URL}/almalinux:9

RUN <<EOF
RUN bash -e <<EOF

# Base dnf configuration.
echo 'http_caching=none' >> /etc/yum.conf
Expand Down Expand Up @@ -48,14 +48,16 @@ dnf --best install -y cmake \
nfpm \
sudo

dnf clean all

pip3 install conan==1.61.0 --prefix=/usr --upgrade
rm -rf ~/.conan/profiles/default

EOF

COPY conanfile.txt .

RUN <<EOF
RUN bash -e <<EOF

cat conanfile.txt
conan install . -s compiler.cppstd=17 -s compiler.libcxx=libstdc++11 --build=missing
Expand Down
4 changes: 3 additions & 1 deletion .github/docker/Dockerfile.centreon-collect-alma9-test
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM ${REGISTRY_URL}/almalinux:9

COPY . /tmp/collect

RUN <<EOF
RUN bash -e <<EOF

# Base dnf configuration.
echo 'http_caching=none' >> /etc/yum.conf
Expand Down Expand Up @@ -38,6 +38,8 @@ dnf --best install -y \
psmisc \
sudo

dnf clean all

echo "install robot and dependencies"

pip3 install -U robotframework robotframework-databaselibrary robotframework-httpctrl robotframework-examples pymysql python-dateutil psutil
Expand Down
6 changes: 2 additions & 4 deletions .github/docker/Dockerfile.centreon-collect-debian-bookworm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARG REGISTRY_URL

FROM ${REGISTRY_URL}/debian:bookworm

RUN <<EOF
RUN bash -e <<EOF

apt-get update

Expand Down Expand Up @@ -41,8 +41,6 @@ apt-get clean

localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py
pip3 install --break-system-packages conan==1.61.0
ln -s /usr/local/bin/conan /usr/bin/conan
rm -rf ~/.conan/profiles/default
Expand All @@ -51,7 +49,7 @@ EOF

COPY conanfile.txt .

RUN <<EOF
RUN bash -e <<EOF

cat conanfile.txt
conan install . -s compiler.cppstd=17 -s compiler.libcxx=libstdc++11 --build='missing'
Expand Down
50 changes: 50 additions & 0 deletions .github/docker/Dockerfile.centreon-collect-debian-bookworm-test
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
ARG REGISTRY_URL

FROM ${REGISTRY_URL}/debian:bookworm

COPY . /tmp/collect

RUN bash -e <<EOF

apt-get update

apt-get -y install curl \
gcc \
g++ \
gdb \
git \
mariadb-server \
openssh-server \
libmariadb3 \
librrd8 \
libgnutlsxx30 \
liblua5.3 \
python3 \
python3-dev \
python3-pip \
libperl-dev \
libgcrypt20 \
aptitude \
strace \
locales \
rrdtool \
rrdcached \
zstd \
psmisc \
sudo

apt-get clean

localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8

pip3 install --break-system-packages -U robotframework robotframework-databaselibrary robotframework-httpctrl robotframework-examples pymysql python-dateutil psutil
pip3 install --break-system-packages grpcio grpcio_tools py-cpuinfo cython unqlite gitpython boto3

cd /tmp/collect

.github/scripts/collect-prepare-test-robot.sh mariadb

/bin/rm -rf /tmp/collect

EOF

6 changes: 2 additions & 4 deletions .github/docker/Dockerfile.centreon-collect-debian-bullseye
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARG REGISTRY_URL

FROM ${REGISTRY_URL}/debian:bullseye

RUN <<EOF
RUN bash -e <<EOF

apt-get update

Expand Down Expand Up @@ -42,8 +42,6 @@ apt-get clean

localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py
pip3 install conan==1.61.0
ln -s /usr/local/bin/conan /usr/bin/conan
rm -rf ~/.conan/profiles/default
Expand All @@ -52,7 +50,7 @@ EOF

COPY conanfile.txt .

RUN <<EOF
RUN bash -e <<EOF

cat conanfile.txt
conan install . -s compiler.cppstd=17 -s compiler.libcxx=libstdc++11 --build='missing'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ ARG REGISTRY_URL

FROM ${REGISTRY_URL}/debian:bullseye


COPY . /tmp/collect

RUN <<EOF
RUN bash -e <<EOF

apt-get update

Expand Down Expand Up @@ -34,15 +33,13 @@ apt-get -y install curl \
psmisc \
sudo

localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
apt-get clean

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8

pip3 install -U robotframework robotframework-databaselibrary robotframework-httpctrl robotframework-examples pymysql python-dateutil psutil
pip3 install grpcio grpcio_tools py-cpuinfo cython unqlite gitpython boto3


cd /tmp/collect

.github/scripts/collect-prepare-test-robot.sh mariadb
Expand Down
6 changes: 4 additions & 2 deletions .github/docker/Dockerfile.centreon-collect-mysql-alma9
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARG REGISTRY_URL

FROM ${REGISTRY_URL}/almalinux:9

RUN <<EOF
RUN bash -e <<EOF

# Base dnf configuration.
echo 'http_caching=none' >> /etc/yum.conf
Expand Down Expand Up @@ -48,14 +48,16 @@ dnf --best install -y cmake \
nfpm \
sudo

dnf clean all

pip3 install conan==1.61.0 --prefix=/usr --upgrade
rm -rf ~/.conan/profiles/default

EOF

COPY conanfile.txt .

RUN <<EOF
RUN bash -e <<EOF

cat conanfile.txt
conan install . -s compiler.cppstd=17 -s compiler.libcxx=libstdc++11 --build=missing
Expand Down
4 changes: 3 additions & 1 deletion .github/docker/Dockerfile.centreon-collect-mysql-alma9-test
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM ${REGISTRY_URL}/almalinux:9

COPY . /tmp/collect

RUN <<EOF
RUN bash -e <<EOF

# Base dnf configuration.
echo 'http_caching=none' >> /etc/yum.conf
Expand Down Expand Up @@ -38,6 +38,8 @@ dnf --best install -y gcc \
sudo \
iproute

dnf clean all

echo "install robot and dependencies"

pip3 install -U robotframework robotframework-databaselibrary robotframework-httpctrl robotframework-examples pymysql python-dateutil psutil
Expand Down
59 changes: 59 additions & 0 deletions .github/docker/Dockerfile.centreon-collect-ubuntu-jammy
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
ARG REGISTRY_URL

FROM ${REGISTRY_URL}/ubuntu:jammy

RUN bash -e <<EOF

apt-get update

apt-get -y install cmake \
git \
curl \
gcc \
g++ \
gdb \
pkg-config \
ninja-build \
mariadb-server \
openssh-server \
libmariadb3 \
librrd-dev \
libgnutls28-dev \
liblua5.3-dev \
python3 \
python3-pip \
libperl-dev \
libgcrypt20-dev \
aptitude \
fakeroot \
strace \
locales \
rrdtool \
rrdcached \
zstd \
sudo

echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | tee /etc/apt/sources.list.d/goreleaser.list
apt-get update
apt-get install -y nfpm

apt-get clean

localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8

pip3 install conan==1.61.0
ln -s /usr/local/bin/conan /usr/bin/conan
rm -rf ~/.conan/profiles/default

EOF

COPY conanfile.txt .

RUN bash -e <<EOF

cat conanfile.txt
conan install . -s compiler.cppstd=17 -s compiler.libcxx=libstdc++11 --build='missing'

EOF

WORKDIR /src
Loading

0 comments on commit a2c199d

Please sign in to comment.