2023-01-10 15:03:40 +01:00
|
|
|
name: "deb-package"
|
|
|
|
description: "Package DEB Centreon"
|
|
|
|
inputs:
|
|
|
|
distrib:
|
|
|
|
description: "The distribution used for packaging"
|
|
|
|
required: true
|
2023-02-17 11:18:25 +01:00
|
|
|
nexus_username:
|
|
|
|
description: The nexus username
|
2023-01-10 15:03:40 +01:00
|
|
|
required: true
|
2023-02-17 11:18:25 +01:00
|
|
|
nexus_password:
|
|
|
|
description: The nexus password
|
2023-01-10 15:03:40 +01:00
|
|
|
required: true
|
|
|
|
cache_key:
|
|
|
|
description: "The cached package key"
|
|
|
|
required: true
|
|
|
|
stability:
|
|
|
|
description: "The package stability (stable, testing, unstable)"
|
|
|
|
required: true
|
2023-02-17 11:18:25 +01:00
|
|
|
artifactory_token:
|
|
|
|
description: "token for artifactory"
|
|
|
|
required: true
|
2023-01-10 15:03:40 +01:00
|
|
|
|
|
|
|
runs:
|
|
|
|
using: "composite"
|
|
|
|
steps:
|
|
|
|
- name: Use cache DEB files
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: ./*.deb
|
|
|
|
key: ${{ inputs.cache_key }}
|
|
|
|
|
2023-03-03 10:54:34 +01:00
|
|
|
- uses: jfrog/setup-jfrog-cli@v3
|
|
|
|
env:
|
|
|
|
JF_URL: https://centreon.jfrog.io
|
|
|
|
JF_ACCESS_TOKEN: ${{ inputs.artifactory_token }}
|
|
|
|
|
|
|
|
- name: Publish DEBs to artifactory
|
|
|
|
run: |
|
2023-03-10 10:45:02 +01:00
|
|
|
jf rt upload "*.deb" "apt-plugins-${{ inputs.stability }}/pool/" --deb "${{ inputs.distrib }}/main/all"
|
2023-03-03 10:54:34 +01:00
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: Publish DEBs to Nexus
|
2023-01-10 15:03:40 +01:00
|
|
|
run: |
|
2023-01-17 11:47:42 +01:00
|
|
|
for MAJOR in "22.04" "22.10"; do
|
|
|
|
echo "Delivering to $MAJOR ${{ inputs.stability }}"
|
2023-01-10 15:03:40 +01:00
|
|
|
|
2023-01-17 11:47:42 +01:00
|
|
|
FOLDER_SUFFIX="-${{ inputs.stability }}"
|
|
|
|
if [[ "${{ inputs.stability }}" == "stable" ]]; then
|
|
|
|
FOLDER_SUFFIX=""
|
|
|
|
fi
|
2023-01-10 15:03:40 +01:00
|
|
|
|
2023-03-21 23:15:34 +01:00
|
|
|
find -name "*.deb" -print0 | xargs -0 -t -I % -P 2 sh -c "curl --connect-timeout 10 --retry 2 --retry-max-time 30 --fail --silent --show-error -u '${{ inputs.nexus_username }}':'${{ inputs.nexus_password }}' -H 'Content-Type: multipart/form-data' --data-binary '@%' https://apt.centreon.com/repository/$MAJOR$FOLDER_SUFFIX/ >/dev/null || exit 255" || break
|
2023-01-17 11:47:42 +01:00
|
|
|
done
|
2023-01-10 15:03:40 +01:00
|
|
|
shell: bash
|