fix(ci): fix plugins delivery to debian and artifactory (#4230)
This commit is contained in:
parent
a6496efd04
commit
ba7f10e8cc
|
@ -4,11 +4,11 @@ inputs:
|
||||||
distrib:
|
distrib:
|
||||||
description: "The distribution used for packaging"
|
description: "The distribution used for packaging"
|
||||||
required: true
|
required: true
|
||||||
artifactory_username:
|
nexus_username:
|
||||||
description: The artifactory username
|
description: The nexus username
|
||||||
required: true
|
required: true
|
||||||
artifactory_password:
|
nexus_password:
|
||||||
description: The artifactory password
|
description: The nexus password
|
||||||
required: true
|
required: true
|
||||||
version:
|
version:
|
||||||
description: "Centreon packaged version"
|
description: "Centreon packaged version"
|
||||||
|
@ -22,6 +22,9 @@ inputs:
|
||||||
stability:
|
stability:
|
||||||
description: "The package stability (stable, testing, unstable)"
|
description: "The package stability (stable, testing, unstable)"
|
||||||
required: true
|
required: true
|
||||||
|
artifactory_token:
|
||||||
|
description: "token for artifactory"
|
||||||
|
required: true
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
|
@ -42,6 +45,7 @@ runs:
|
||||||
FOLDER_SUFFIX=""
|
FOLDER_SUFFIX=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
find -name "*.deb" -print0 | xargs -0 -t -I % -P 2 curl -u "${{ inputs.artifactory_username }}":"${{ inputs.artifactory_password }}" -H "Content-Type: multipart/form-data" --data-binary "@%" https://apt.centreon.com/repository/$MAJOR$FOLDER_SUFFIX/
|
find -name "*.deb" -print0 | xargs -0 -t -I % -P 2 curl --fail -v -u "${{ inputs.nexus_username }}":"${{ inputs.nexus_password }}" -H "Content-Type: multipart/form-data" --data-binary "@%" https://apt.centreon.com/repository/$MAJOR$FOLDER_SUFFIX/
|
||||||
|
find -name "*.deb" -print0 | xargs -0 -t -I % -P 2 curl --fail -v -H "Authorization: Bearer ${{ inputs.artifactory_token }}" -X PUT "https://centreon.jfrog.io/artifactory/apt-$MAJOR-${{ inputs.stability }}/pool/%;deb.distribution=${{ inputs.distrib }};deb.component=main;deb.architecture=all" -T "%"
|
||||||
done
|
done
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
|
@ -31,6 +31,9 @@ inputs:
|
||||||
stability:
|
stability:
|
||||||
description: "The package stability (stable, testing, unstable)"
|
description: "The package stability (stable, testing, unstable)"
|
||||||
required: true
|
required: true
|
||||||
|
artifactory_token:
|
||||||
|
description: "token for artifactory"
|
||||||
|
required: true
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
|
@ -68,12 +71,18 @@ runs:
|
||||||
|
|
||||||
if [ "$REPOTYPE" == "stable" ]; then
|
if [ "$REPOTYPE" == "stable" ]; then
|
||||||
TARGET="/srv/centreon-yum/yum.centreon.com/$PROJECT_PATH/$MAJOR/$DISTRIB/$REPOTYPE/$ARCH/RPMS"
|
TARGET="/srv/centreon-yum/yum.centreon.com/$PROJECT_PATH/$MAJOR/$DISTRIB/$REPOTYPE/$ARCH/RPMS"
|
||||||
|
ARTIFACTORY_TARGET="https://centreon.jfrog.io/artifactory/rpm/$PROJECT_PATH/$MAJOR/$DISTRIB/${{ inputs.stability }}/$ARCH"
|
||||||
else
|
else
|
||||||
FOLDER="centreon-$PROJECT-$VERSION-$RELEASE"
|
FOLDER="centreon-$PROJECT-$VERSION-$RELEASE"
|
||||||
TARGET="/srv/centreon-yum/yum.centreon.com/$PROJECT_PATH/$MAJOR/$DISTRIB/$REPOTYPE/$ARCH/$PROJECT/$FOLDER"
|
TARGET="/srv/centreon-yum/yum.centreon.com/$PROJECT_PATH/$MAJOR/$DISTRIB/$REPOTYPE/$ARCH/$PROJECT/$FOLDER"
|
||||||
PROJECT_LOCATION="/srv/centreon-yum/yum.centreon.com/$PROJECT_PATH/$MAJOR/$DISTRIB/$REPOTYPE/$ARCH/$PROJECT"
|
PROJECT_LOCATION="/srv/centreon-yum/yum.centreon.com/$PROJECT_PATH/$MAJOR/$DISTRIB/$REPOTYPE/$ARCH/$PROJECT"
|
||||||
|
ARTIFACTORY_TARGET="https://centreon.jfrog.io/artifactory/rpm/$PROJECT_PATH/$MAJOR/$DISTRIB/${{ inputs.stability }}/$ARCH/$PROJECT/$FOLDER"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
for FILE in $FILES; do
|
||||||
|
curl --fail -v -H "Authorization: Bearer ${{ inputs.artifactory_token }}" -X PUT "$ARTIFACTORY_TARGET/$FILE" -T "./$FILE"
|
||||||
|
done
|
||||||
|
|
||||||
echo "[DEBUG] - Folder: $FOLDER"
|
echo "[DEBUG] - Folder: $FOLDER"
|
||||||
echo "[DEBUG] - Project : $PROJECT"
|
echo "[DEBUG] - Project : $PROJECT"
|
||||||
echo "[DEBUG] - Target : $TARGET"
|
echo "[DEBUG] - Target : $TARGET"
|
||||||
|
|
|
@ -14,9 +14,9 @@ on:
|
||||||
type: string
|
type: string
|
||||||
required: true
|
required: true
|
||||||
secrets:
|
secrets:
|
||||||
artifactory_username:
|
nexus_username:
|
||||||
required: true
|
required: true
|
||||||
artifactory_password:
|
nexus_password:
|
||||||
required: true
|
required: true
|
||||||
update_repo_path:
|
update_repo_path:
|
||||||
description: "The update repo script path"
|
description: "The update repo script path"
|
||||||
|
@ -30,6 +30,9 @@ on:
|
||||||
yum_repo_key:
|
yum_repo_key:
|
||||||
description: "The repo key"
|
description: "The repo key"
|
||||||
required: true
|
required: true
|
||||||
|
artifactory_token:
|
||||||
|
description: "The artifactory token"
|
||||||
|
required: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deliver-rpm:
|
deliver-rpm:
|
||||||
|
@ -54,6 +57,7 @@ jobs:
|
||||||
yum_repo_address: ${{ secrets.yum_repo_address }}
|
yum_repo_address: ${{ secrets.yum_repo_address }}
|
||||||
yum_repo_key: ${{ secrets.yum_repo_key }}
|
yum_repo_key: ${{ secrets.yum_repo_key }}
|
||||||
stability: ${{ inputs.stability }}
|
stability: ${{ inputs.stability }}
|
||||||
|
artifactory_token: ${{ secrets.artifactory_token }}
|
||||||
|
|
||||||
deliver-deb:
|
deliver-deb:
|
||||||
runs-on: [self-hosted, common]
|
runs-on: [self-hosted, common]
|
||||||
|
@ -71,7 +75,8 @@ jobs:
|
||||||
distrib: ${{ matrix.distrib }}
|
distrib: ${{ matrix.distrib }}
|
||||||
version: ${{ inputs.version }}
|
version: ${{ inputs.version }}
|
||||||
release: ${{ inputs.release }}
|
release: ${{ inputs.release }}
|
||||||
artifactory_username: ${{ secrets.artifactory_username }}
|
nexus_username: ${{ secrets.nexus_username }}
|
||||||
artifactory_password: ${{ secrets.artifactory_password }}
|
nexus_password: ${{ secrets.nexus_password }}
|
||||||
cache_key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }}
|
cache_key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }}
|
||||||
stability: ${{ inputs.stability }}
|
stability: ${{ inputs.stability }}
|
||||||
|
artifactory_token: ${{ secrets.artifactory_token }}
|
||||||
|
|
|
@ -107,9 +107,10 @@ jobs:
|
||||||
release: ${{ needs.get-environment.outputs.release }}
|
release: ${{ needs.get-environment.outputs.release }}
|
||||||
stability: ${{ needs.get-environment.outputs.stability }}
|
stability: ${{ needs.get-environment.outputs.stability }}
|
||||||
secrets:
|
secrets:
|
||||||
artifactory_username: ${{ secrets.NEXUS_USER }}
|
nexus_username: ${{ secrets.NEXUS_USERNAME }}
|
||||||
artifactory_password: ${{ secrets.NEXUS_PASSWD }}
|
nexus_password: ${{ secrets.NEXUS_PASSWORD }}
|
||||||
update_repo_path: ${{ secrets.UPDATE_REPO_PATH }}
|
update_repo_path: ${{ secrets.UPDATE_REPO_PATH }}
|
||||||
cloudfront_id: ${{ secrets.CLOUDFRONT_ID }}
|
cloudfront_id: ${{ secrets.CLOUDFRONT_ID }}
|
||||||
yum_repo_address: ${{ secrets.YUM_REPO_ADDRESS }}
|
yum_repo_address: ${{ secrets.YUM_REPO_ADDRESS }}
|
||||||
yum_repo_key: ${{ secrets.YUM_REPO_KEY }}
|
yum_repo_key: ${{ secrets.YUM_REPO_KEY }}
|
||||||
|
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||||
|
|
Loading…
Reference in New Issue