-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enh(ci): add pipeline for as400 using nfpm (#5167)
- Loading branch information
Showing
100 changed files
with
8,668 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
.github/docker/packaging/Dockerfile.packaging-plugins-java-alma8
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,29 @@ | ||
ARG REGISTRY_URL | ||
|
||
FROM ${REGISTRY_URL}/almalinux:8 | ||
|
||
RUN bash -e <<EOF | ||
|
||
dnf install -y \ | ||
git \ | ||
wget \ | ||
zstd \ | ||
https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.rpm | ||
|
||
cd /usr/local/src | ||
wget https://dlcdn.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz | ||
tar zxf apache-maven-3.8.8-bin.tar.gz | ||
ln -s /usr/local/src/apache-maven-3.8.8/bin/mvn /usr/bin/mvn | ||
rm -f apache-maven-3.8.8-bin.tar.gz | ||
|
||
echo '[goreleaser] | ||
name=GoReleaser | ||
baseurl=https://repo.goreleaser.com/yum/ | ||
enabled=1 | ||
gpgcheck=0' | tee /etc/yum.repos.d/goreleaser.repo | ||
dnf install -y nfpm | ||
dnf clean all | ||
|
||
EOF | ||
|
||
WORKDIR /src |
29 changes: 29 additions & 0 deletions
29
.github/docker/packaging/Dockerfile.packaging-plugins-java-alma9
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,29 @@ | ||
ARG REGISTRY_URL | ||
|
||
FROM ${REGISTRY_URL}/almalinux:9 | ||
|
||
RUN bash -e <<EOF | ||
|
||
dnf install -y \ | ||
git \ | ||
wget \ | ||
zstd \ | ||
https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.rpm | ||
|
||
cd /usr/local/src | ||
wget https://dlcdn.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz | ||
tar zxf apache-maven-3.8.8-bin.tar.gz | ||
ln -s /usr/local/src/apache-maven-3.8.8/bin/mvn /usr/bin/mvn | ||
rm -f apache-maven-3.8.8-bin.tar.gz | ||
|
||
echo '[goreleaser] | ||
name=GoReleaser | ||
baseurl=https://repo.goreleaser.com/yum/ | ||
enabled=1 | ||
gpgcheck=0' | tee /etc/yum.repos.d/goreleaser.repo | ||
dnf install -y nfpm | ||
dnf clean all | ||
|
||
EOF | ||
|
||
WORKDIR /src |
24 changes: 24 additions & 0 deletions
24
.github/docker/packaging/Dockerfile.packaging-plugins-java-bookworm
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,24 @@ | ||
ARG REGISTRY_URL | ||
|
||
FROM ${REGISTRY_URL}/debian:bookworm | ||
|
||
RUN bash -e <<EOF | ||
|
||
apt-get update | ||
apt-get install -y \ | ||
ca-certificates \ | ||
git \ | ||
zstd \ | ||
maven=3.8.7-1 \ | ||
openjdk-17-jdk | ||
|
||
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 all | ||
|
||
EOF | ||
|
||
WORKDIR /src |
24 changes: 24 additions & 0 deletions
24
.github/docker/packaging/Dockerfile.packaging-plugins-java-bullseye
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,24 @@ | ||
ARG REGISTRY_URL | ||
|
||
FROM ${REGISTRY_URL}/debian:bullseye | ||
|
||
RUN bash -e <<EOF | ||
|
||
apt-get update | ||
apt-get install -y \ | ||
ca-certificates \ | ||
git \ | ||
zstd \ | ||
maven=3.6.3-5 \ | ||
openjdk-17-jdk | ||
|
||
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 all | ||
|
||
EOF | ||
|
||
WORKDIR /src |
30 changes: 30 additions & 0 deletions
30
.github/docker/packaging/Dockerfile.packaging-plugins-java-jammy
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,30 @@ | ||
ARG REGISTRY_URL | ||
|
||
FROM ${REGISTRY_URL}/ubuntu:jammy | ||
|
||
RUN bash -e <<EOF | ||
|
||
apt-get update | ||
apt-get install -y \ | ||
ca-certificates \ | ||
git \ | ||
wget \ | ||
zstd \ | ||
openjdk-17-jdk | ||
|
||
cd /usr/local/src | ||
wget https://dlcdn.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz | ||
tar zxf apache-maven-3.8.8-bin.tar.gz | ||
ln -s /usr/local/src/apache-maven-3.8.8/bin/mvn /usr/bin/mvn | ||
rm -f apache-maven-3.8.8-bin.tar.gz | ||
|
||
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 all | ||
|
||
EOF | ||
|
||
WORKDIR /src |
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,149 @@ | ||
name: as400 | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
paths: | ||
- 'as400/packaging/**' | ||
push: | ||
branches: | ||
- develop | ||
- master | ||
paths: | ||
- 'as400/packaging/**' | ||
|
||
jobs: | ||
get-environment: | ||
uses: ./.github/workflows/get-environment.yml | ||
with: | ||
version_file: as400/packaging/centreon-as400-daemon.yaml | ||
|
||
package: | ||
needs: [get-environment] | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- package_extension: rpm | ||
image: packaging-plugins-java-alma8 | ||
distrib: el8 | ||
- package_extension: rpm | ||
image: packaging-plugins-java-alma9 | ||
distrib: el9 | ||
- package_extension: deb | ||
image: packaging-plugins-java-bullseye | ||
distrib: bullseye | ||
- package_extension: deb | ||
image: packaging-plugins-java-bookworm | ||
distrib: bookworm | ||
- package_extension: deb | ||
image: packaging-plugins-java-jammy | ||
distrib: jammy | ||
|
||
|
||
container: | ||
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }} | ||
credentials: | ||
username: ${{ secrets.DOCKER_REGISTRY_ID }} | ||
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }} | ||
|
||
name: package ${{ matrix.distrib }} | ||
|
||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
||
- name: Prepare files for packaging | ||
run: | | ||
find . \ | ||
-type f \ | ||
-exec grep -E '(@CONNECTOR_VERSION@)|(@CONNECTOR_HOME@)|(@CONNECTOR_ETC@)|(@CONNECTOR_LOG@)|(@CONNECTOR_USER@)|(@JAVA_BIN@)' {} ';' \ | ||
-exec sed -i \ | ||
-e 's|@CONNECTOR_VERSION@|'"%{version}"'|g' \ | ||
-e 's|@CONNECTOR_HOME@|'"%{_datadir}/centreon-as400"'|g' \ | ||
-e 's|@CONNECTOR_ETC@|'"/etc/centreon-as400/"'|g' \ | ||
-e 's|@CONNECTOR_LOG@|'"/var/log/centreon-as400/"'|g' \ | ||
-e 's|@CONNECTOR_USER@|'"centreon-as400"'|g' \ | ||
-e 's|@JAVA_BIN@|'"/usr/bin/java"'|g' \ | ||
{} ';' | ||
shell: bash | ||
|
||
- name: Set JAVA_HOME | ||
run: export JAVA_HOME=$( java -XshowSettings:properties -version 2>&1 > /dev/null | grep 'java.home' | tr -s ' ' | cut -d ' ' -f 4) | ||
|
||
- name: Build JAR using maven | ||
run: mvn -version && mvn clean install -f as400/connector.as400/pom.xml | ||
|
||
- name: Remove me after debug | ||
run: find / -name "centreon-as400*.jar" | ||
|
||
- name: Package | ||
uses: ./.github/actions/package-nfpm | ||
with: | ||
nfpm_file_pattern: "as400/packaging/centreon-as400-daemon.yaml" | ||
distrib: ${{ matrix.distrib }} | ||
package_extension: ${{ matrix.package_extension }} | ||
version: ${{ needs.get-environment.outputs.version }} | ||
release: ${{ needs.get-environment.outputs.release }} | ||
arch: all | ||
commit_hash: ${{ github.sha }} | ||
cache_key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-as400-${{ matrix.distrib }} | ||
rpm_gpg_key: ${{ secrets.RPM_GPG_SIGNING_KEY }} | ||
rpm_gpg_signing_key_id: ${{ secrets.RPM_GPG_SIGNING_KEY_ID }} | ||
rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }} | ||
stability: ${{ needs.get-environment.outputs.stability }} | ||
|
||
- name: Save to cache | ||
uses: actions/cache/save@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 | ||
with: | ||
path: ./*.${{ matrix.package_extension }} | ||
key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-${{ matrix.distrib }} | ||
|
||
deliver-rpm: | ||
needs: [get-environment, package] | ||
if: ${{ contains(fromJson('["stable", "testing", "unstable"]'), needs.get-environment.outputs.stability) }} | ||
runs-on: [self-hosted, common] | ||
|
||
strategy: | ||
matrix: | ||
distrib: [el8, el9] | ||
|
||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
||
- name: Delivery | ||
uses: ./.github/actions/rpm-delivery | ||
with: | ||
module_name: as400 | ||
distrib: ${{ matrix.distrib }} | ||
cache_key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }} | ||
stability: ${{ needs.get-environment.outputs.stability }} | ||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} | ||
|
||
deliver-deb: | ||
needs: [get-environment, package] | ||
if: ${{ contains(fromJson('["stable", "testing", "unstable"]'), needs.get-environment.outputs.stability) }} | ||
runs-on: [self-hosted, common] | ||
|
||
strategy: | ||
matrix: | ||
distrib: [bullseye, bookworm, jammy] | ||
|
||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
||
- name: Delivery | ||
uses: ./.github/actions/deb-delivery | ||
with: | ||
module_name: as400 | ||
distrib: ${{ matrix.distrib }} | ||
cache_key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }} | ||
stability: ${{ needs.get-environment.outputs.stability }} | ||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} |
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.