Skip to content

Commit

Permalink
add promote to windows-agent.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
jean-christophe81 committed Oct 3, 2024
1 parent d763134 commit 21be045
Showing 1 changed file with 57 additions and 23 deletions.
80 changes: 57 additions & 23 deletions .github/workflows/windows-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ concurrency:

on:
workflow_dispatch:
inputs:
installer_in_artifact:
description: 'Save installer and binary in artifacts'
required: true
default: false
type: boolean

pull_request:
paths:
Expand Down Expand Up @@ -47,6 +41,11 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.COLLECT_S3_SECRET_KEY }}

steps:
- uses: jfrog/setup-jfrog-cli@26da2259ee7690e63b5410d7451b2938d08ce1f9 # v4.0.0
env:
JF_URL: https://centreon.jfrog.io
JF_ACCESS_TOKEN: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}

# in order to have the same checksum between windows-agent and windows-agent-robot-test
- name: nocrlf conversion
run: git config --system core.autocrlf false
Expand All @@ -58,25 +57,60 @@ jobs:
run: .github/scripts/windows-agent-compile.ps1
shell: powershell

- name: Common test
run: |
cd build_windows
tests/ut_common
# - name: Common test
# run: |
# cd build_windows
# tests/ut_common

- name: Agent test
run: |
cd build_windows
tests/ut_agent
# - name: Agent test
# run: |
# cd build_windows
# tests/ut_agent

- name: Upload package artifacts
- name: deliver
if: |
inputs.installer_in_artifact == true ||
(github.event_name != 'workflow_dispatch' &&
contains(fromJson('["stable"]'), needs.get-version.outputs.stability) &&
contains(fromJson('["unstable", "testing"]'), needs.get-version.outputs.stability) &&
! cancelled() &&
! contains(needs.*.result, 'failure') &&
! contains(needs.*.result, 'cancelled'))
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
name: packages-centreon-monitoring-agent-windows
path: agent\installer\centreon-monitoring-agent.exe
! contains(needs.*.result, 'cancelled')
run: |

Check failure on line 76 in .github/workflows/windows-agent.yml

View workflow job for this annotation

GitHub Actions / yaml-lint

76:15 [trailing-spaces] trailing spaces
Write-Host "[DEBUG] deliver to testing - Major version: ${{ needs.get-version.outputs.major_version }}"
Write-Host "[DEBUG] deliver to testing - Minor version: ${{ needs.get-version.outputs.minor_version }}"
$VERSION = "${{ needs.get-version.outputs.version }}"
$MODULE_NAME = "monitoring-agent-$VERSION"
$STABILITY = "${{ needs.get-version.outputs.stability }}"
$TARGET_PATH = "installers/monitoring-agent/${{ needs.get-version.outputs.major_version }}/$STABILITY/$MODULE_NAME/"
$VERSION_EXE_PATH = "centreon-monitoring-agent-${VERSION}.exe"
Copy-Item -Path "agent\installer\centreon-monitoring-agent.exe" -Destination "$VERSION_EXE_PATH"
Write-Host "[DEBUG] deliver testing to - Target path: $TARGET_PATH"
jf rt upload $VERSION_EXE_PATH "$TARGET_PATH" --sync-deletes="$TARGET_PATH"
- name: promote testing to stable
# if: |
# contains(fromJson('["stable", "testing"]'), needs.get-version.outputs.stability) && github.event_name != 'workflow_dispatch' && ! cancelled()

Check failure on line 95 in .github/workflows/windows-agent.yml

View workflow job for this annotation

GitHub Actions / yaml-lint

95:154 [trailing-spaces] trailing spaces
run: |
Write-Host "[DEBUG] promote to stable - Major version: ${{ needs.get-version.outputs.major_version }}"
Write-Host "[DEBUG] promote to stable - Minor version: ${{ needs.get-version.outputs.minor_version }}"
$VERSION= "${{ needs.get-version.outputs.version }}"
$MODULE_NAME= "monitoring-agent-${{ needs.get-version.outputs.version }}"
$STABILITY= "${{ needs.get-version.outputs.stability }}"
$SRC_PATH = "installers/monitoring-agent/${{ needs.get-version.outputs.major_version }}/canary/$MODULE_NAME/"
#$SRC_PATH = "installers/monitoring-agent/${{ needs.get-version.outputs.major_version }}/testing/$MODULE_NAME/"
$TARGET_PATH = "installers/monitoring-agent/${{ needs.get-version.outputs.major_version }}/$STABILITY/$MODULE_NAME/"
$VERSION_EXE_PATH = "centreon-monitoring-agent-${VERSION}.exe"
Write-Host "[DEBUG] promote to stable - Target path: $TARGET_PATH"
jf rt download "${TARGET_PATH}/${VERSION_EXE_PATH}"
jf rt upload $VERSION_EXE_PATH "$TARGET_PATH" --sync-deletes="$TARGET_PATH"
shell: powershell

0 comments on commit 21be045

Please sign in to comment.