chore(ci): publish releases on download.centreon.com (#4340)
Refs: MON-15793
This commit is contained in:
parent
1b799785cb
commit
bf243fa98d
|
@ -0,0 +1,44 @@
|
||||||
|
name: "release-sources"
|
||||||
|
description: "Release sources on download.centreon.com"
|
||||||
|
inputs:
|
||||||
|
bucket_directory:
|
||||||
|
description: The bucket directory
|
||||||
|
required: true
|
||||||
|
module_directory:
|
||||||
|
description: The module directory
|
||||||
|
required: true
|
||||||
|
module_name:
|
||||||
|
description: The module name
|
||||||
|
required: true
|
||||||
|
version:
|
||||||
|
description: The module version
|
||||||
|
required: true
|
||||||
|
release:
|
||||||
|
description: The module release
|
||||||
|
required: true
|
||||||
|
token_download_centreon_com:
|
||||||
|
description: The token to call download.centreon.com api
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Setup awscli
|
||||||
|
run: |
|
||||||
|
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
|
||||||
|
sudo unzip -q awscliv2.zip
|
||||||
|
sudo ./aws/install
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- run: |
|
||||||
|
SRC_FILE="${{ inputs.module_name }}-${{ inputs.version }}.tar.gz"
|
||||||
|
|
||||||
|
mv "${{ inputs.module_directory }}" "${{ inputs.module_name }}-${{ inputs.version }}"
|
||||||
|
tar czf $SRC_FILE "${{ inputs.module_name }}-${{ inputs.version }}"
|
||||||
|
|
||||||
|
SRC_HASH=$(md5sum $SRC_FILE | cut -d ' ' -f 1)
|
||||||
|
SRC_SIZE=$(stat -c '%s' $SRC_FILE)
|
||||||
|
|
||||||
|
aws s3 cp --acl public-read "$SRC_FILE" "s3://centreon-download/public/${{ inputs.bucket_directory }}/$SRC_FILE"
|
||||||
|
curl --fail "https://download.centreon.com/api/?token=${{ inputs.token_download_centreon_com }}&product=${{ inputs.module_name }}&release=${{ inputs.release }}&version=${{ inputs.version }}&extension=tar.gz&md5=$SRC_HASH&size=$SRC_SIZE&ddos=0&dryrun=0"
|
||||||
|
shell: bash
|
|
@ -1,6 +1,14 @@
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
|
version:
|
||||||
|
description: The package version
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
release:
|
||||||
|
description: The package release
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
stability:
|
stability:
|
||||||
description: The package stability (stable, testing, unstable)
|
description: The package stability (stable, testing, unstable)
|
||||||
type: string
|
type: string
|
||||||
|
@ -25,8 +33,34 @@ on:
|
||||||
artifactory_token:
|
artifactory_token:
|
||||||
description: "The artifactory token"
|
description: "The artifactory token"
|
||||||
required: true
|
required: true
|
||||||
|
token_download_centreon_com:
|
||||||
|
description: "The token to call download.centreon.com api"
|
||||||
|
required: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
deliver-sources:
|
||||||
|
runs-on: [self-hosted, common]
|
||||||
|
if: ${{ contains(fromJson('["stable"]'), inputs.stability) }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout sources
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: ./build/
|
||||||
|
key: fatpacked-plugins-${{ github.sha }}-${{ github.run_id }}
|
||||||
|
|
||||||
|
- name: Deliver sources
|
||||||
|
uses: ./.github/actions/release-sources
|
||||||
|
with:
|
||||||
|
bucket_directory: centreon-plugins
|
||||||
|
module_directory: build
|
||||||
|
module_name: centreon-plugins
|
||||||
|
version: ${{ inputs.version }}
|
||||||
|
release: ${{ inputs.release }}
|
||||||
|
token_download_centreon_com: ${{ secrets.token_download_centreon_com }}
|
||||||
|
|
||||||
deliver-rpm:
|
deliver-rpm:
|
||||||
runs-on: [self-hosted, common]
|
runs-on: [self-hosted, common]
|
||||||
strategy:
|
strategy:
|
||||||
|
|
|
@ -103,6 +103,8 @@ jobs:
|
||||||
if: ${{ contains(fromJson('["stable", "testing", "unstable"]'), needs.get-environment.outputs.stability) }}
|
if: ${{ contains(fromJson('["stable", "testing", "unstable"]'), needs.get-environment.outputs.stability) }}
|
||||||
uses: ./.github/workflows/plugin-delivery.yml
|
uses: ./.github/workflows/plugin-delivery.yml
|
||||||
with:
|
with:
|
||||||
|
version: ${{ needs.get-environment.outputs.version }}
|
||||||
|
release: ${{ needs.get-environment.outputs.release }}
|
||||||
stability: ${{ needs.get-environment.outputs.stability }}
|
stability: ${{ needs.get-environment.outputs.stability }}
|
||||||
secrets:
|
secrets:
|
||||||
nexus_username: ${{ secrets.NEXUS_USERNAME }}
|
nexus_username: ${{ secrets.NEXUS_USERNAME }}
|
||||||
|
@ -112,3 +114,4 @@ 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 }}
|
||||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||||
|
token_download_centreon_com: ${{ secrets.TOKEN_DOWNLOAD_CENTREON_COM }}
|
||||||
|
|
Loading…
Reference in New Issue