Skip to content

Commit

Permalink
sync
Browse files Browse the repository at this point in the history
  • Loading branch information
mushroomempires committed Nov 26, 2024
1 parent d7756b2 commit fd1e2d8
Show file tree
Hide file tree
Showing 179 changed files with 8,869 additions and 595 deletions.
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# https://editorconfig.org/

root = true

# Global rules
[*]
charset = utf-8
end_of_line = lf

# Rules for php files
[*.php]
insert_final_newline = true

# Tab indentation (no size specified)
[Makefile]
indent_style = tab
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto eol=lf
17 changes: 11 additions & 6 deletions .github/actions/changes-trigger-checks/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ inputs:
has_test_changes:
description: Whether the PR contains changes on the test suite
required: true
is_nightly:
description: Nightly status
required: true

outputs:
trigger_delivery:
Expand All @@ -25,19 +28,21 @@ runs:
- name: Validate package delivery trigger
id: trigger_delivery
run: |
TRIGGER_DELIVERY=false
if [[ ${{ inputs.has_frontend_changes }} == 'true' || ${{ inputs.has_backend_changes }} == 'true' ]]; then
TRIGGER_DELIVERY=true
TRIGGER_DELIVERY='false'
if [[ ${{ inputs.is_nightly }} == 'false' && (${{ inputs.has_frontend_changes }} == 'true' || ${{ inputs.has_backend_changes }} == 'true') ]]; then
TRIGGER_DELIVERY='true'
fi
echo "trigger_delivery=$TRIGGER_DELIVERY"
echo "trigger_delivery=$TRIGGER_DELIVERY" >> $GITHUB_OUTPUT
shell: bash

- name: Validate API testing trigger
id: trigger_api_testing
run: |
TRIGGER_API_TESTING=false
if [[ ${{ inputs.has_backend_changes }} == 'true' || ${{ inputs.has_test_changes }} == 'true' ]]; then
TRIGGER_API_TESTING=true
TRIGGER_API_TESTING='false'
if [[ ${{ inputs.is_nightly }} == 'true' || (${{ inputs.has_backend_changes }} == 'true' || ${{ inputs.has_test_changes }} == 'true') ]]; then
TRIGGER_API_TESTING='true'
fi
echo "trigger_api_testing=$TRIGGER_API_TESTING"
echo "trigger_api_testing=$TRIGGER_API_TESTING" >> $GITHUB_OUTPUT
shell: bash
2 changes: 1 addition & 1 deletion .github/docker/centreon-web/alma8/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG REGISTRY_URL=docker.centreon.com/centreon
ARG FROM_IMAGE_VERSION=develop

FROM ${REGISTRY_URL}/centreon-web-dependencies-alma8:${FROM_IMAGE_VERSION}
FROM ${REGISTRY_URL}/centreon-web-dependencies-collect-alma8:${FROM_IMAGE_VERSION}

ARG STABILITY

Expand Down
17 changes: 16 additions & 1 deletion .github/docker/centreon-web/alma8/Dockerfile.dependencies
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG VERSION

FROM almalinux:8
FROM almalinux:8 AS web_dependencies

ARG VERSION
ARG IS_CLOUD
Expand Down Expand Up @@ -109,3 +109,18 @@ EOF
COPY --chmod=755 ./.github/docker/centreon-web/init/systemctl /bin/systemctl

COPY --chmod=755 ./.github/docker/centreon-web/init/* /etc/init.d/

FROM web_dependencies AS web_dependencies_collect

RUN bash -e <<EOF

dnf install -y \
centreon-gorgone \
centreon-engine \
centreon-broker-cbmod \
centreon-broker-cbd \
centreon-connector

dnf clean all --enablerepo=*

EOF
2 changes: 1 addition & 1 deletion .github/docker/centreon-web/alma9/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG REGISTRY_URL=docker.centreon.com/centreon
ARG FROM_IMAGE_VERSION=develop

FROM ${REGISTRY_URL}/centreon-web-dependencies-alma9:${FROM_IMAGE_VERSION}
FROM ${REGISTRY_URL}/centreon-web-dependencies-collect-alma9:${FROM_IMAGE_VERSION}

ARG STABILITY

Expand Down
17 changes: 16 additions & 1 deletion .github/docker/centreon-web/alma9/Dockerfile.dependencies
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG VERSION

FROM almalinux:9
FROM almalinux:9 AS web_dependencies

ARG VERSION
ARG IS_CLOUD
Expand Down Expand Up @@ -105,3 +105,18 @@ EOF
COPY --chmod=755 ./.github/docker/centreon-web/init/systemctl /bin/systemctl

COPY --chmod=755 ./.github/docker/centreon-web/init/* /etc/init.d/

FROM web_dependencies AS web_dependencies_collect

RUN bash -e <<EOF

dnf install -y \
centreon-gorgone \
centreon-engine \
centreon-broker-cbmod \
centreon-broker-cbd \
centreon-connector

dnf clean all --enablerepo=*

EOF
2 changes: 1 addition & 1 deletion .github/docker/centreon-web/bookworm/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG REGISTRY_URL=docker.centreon.com/centreon
ARG FROM_IMAGE_VERSION=develop

FROM ${REGISTRY_URL}/centreon-web-dependencies-bookworm:${FROM_IMAGE_VERSION}
FROM ${REGISTRY_URL}/centreon-web-dependencies-collect-bookworm:${FROM_IMAGE_VERSION}

ARG STABILITY

Expand Down
21 changes: 19 additions & 2 deletions .github/docker/centreon-web/bookworm/Dockerfile.dependencies
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
ARG VERSION

FROM debian:bookworm
FROM debian:bookworm AS web_dependencies

ARG VERSION

ENV DEBIAN_FRONTEND noninteractive
ENV DEBIAN_FRONTEND=noninteractive

RUN bash -e <<EOF

Expand Down Expand Up @@ -102,3 +102,20 @@ EOF
COPY --chmod=755 ./.github/docker/centreon-web/init/systemctl /bin/systemctl

COPY --chmod=755 ./.github/docker/centreon-web/init/* /etc/init.d/

FROM web_dependencies AS web_dependencies_collect

RUN bash -e <<EOF

apt-get update

apt-get install -y \
centreon-gorgone \
centreon-engine \
centreon-broker-cbmod \
centreon-broker-cbd \
centreon-connector

apt-get clean

EOF
2 changes: 1 addition & 1 deletion .github/docker/centreon-web/jammy/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG REGISTRY_URL=docker.centreon.com/centreon
ARG FROM_IMAGE_VERSION=develop

FROM ${REGISTRY_URL}/centreon-web-dependencies-jammy:${FROM_IMAGE_VERSION}
FROM ${REGISTRY_URL}/centreon-web-dependencies-collect-jammy:${FROM_IMAGE_VERSION}

ARG STABILITY

Expand Down
21 changes: 19 additions & 2 deletions .github/docker/centreon-web/jammy/Dockerfile.dependencies
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
ARG VERSION

FROM ubuntu:jammy
FROM ubuntu:jammy AS web_dependencies

ARG VERSION

ENV DEBIAN_FRONTEND noninteractive
ENV DEBIAN_FRONTEND=noninteractive

RUN bash -e <<EOF

Expand Down Expand Up @@ -99,3 +99,20 @@ EOF
COPY --chmod=755 ./.github/docker/centreon-web/init/systemctl /bin/systemctl

COPY --chmod=755 ./.github/docker/centreon-web/init/* /etc/init.d/

FROM web_dependencies AS web_dependencies_collect

RUN bash -e <<EOF

apt-get update

apt-get install -y \
centreon-gorgone \
centreon-engine \
centreon-broker-cbmod \
centreon-broker-cbd \
centreon-connector

apt-get clean

EOF
12 changes: 7 additions & 5 deletions .github/workflows/awie.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ jobs:
- uses: ./.github/actions/changes-trigger-checks
id: changes_trigger_checks
with:
is_nightly: 'false'
has_frontend_changes: 'false'
has_backend_changes: ${{ steps.filter.outputs.has_backend_changes }}
has_test_changes: ${{ steps.filter.outputs.has_test_changes }}
Expand Down Expand Up @@ -92,7 +93,7 @@ jobs:
backend-lint:
runs-on: ubuntu-24.04
needs: [changes, get-environment]
if: ${{ needs.changes.outputs.has_backend_changes == 'true' }}
if: ${{ needs.get-environment.outputs.skip_workflow == 'false' && needs.changes.outputs.has_backend_changes == 'true' }}
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0

Expand All @@ -115,7 +116,7 @@ jobs:

package:
needs: [get-environment, backend-lint]
if: ${{ needs.get-environment.outputs.stability != 'stable' }}
if: ${{ needs.get-environment.outputs.skip_workflow == 'false' && needs.get-environment.outputs.stability != 'stable' }}

strategy:
fail-fast: false
Expand Down Expand Up @@ -166,7 +167,7 @@ jobs:
deliver-sources:
runs-on: [self-hosted, common]
needs: [get-environment, package]
if: ${{ contains(fromJson('["stable"]'), needs.get-environment.outputs.stability) && github.event_name != 'workflow_dispatch' }}
if: ${{ needs.get-environment.outputs.skip_workflow == 'false' && contains(fromJson('["stable"]'), needs.get-environment.outputs.stability) && github.event_name != 'workflow_dispatch' }}

steps:
- name: Checkout sources
Expand All @@ -184,7 +185,7 @@ jobs:

deliver-rpm:
needs: [changes, get-environment, package]
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) && needs.changes.outputs.trigger_delivery == 'true' }}
if: ${{ needs.get-environment.outputs.skip_workflow == 'false' && contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) && needs.changes.outputs.trigger_delivery == 'true' }}
runs-on: [self-hosted, common]

strategy:
Expand All @@ -209,7 +210,7 @@ jobs:

deliver-deb:
needs: [changes, get-environment, package]
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) && needs.changes.outputs.trigger_delivery == 'true' }}
if: ${{ needs.get-environment.outputs.skip_workflow == 'false' && contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) && needs.changes.outputs.trigger_delivery == 'true' }}
runs-on: [self-hosted, common]

strategy:
Expand All @@ -235,6 +236,7 @@ jobs:
promote:
needs: [get-environment, deliver-rpm, deliver-deb]
if: |
needs.get-environment.outputs.skip_workflow == 'false' &&
(contains(fromJson('["stable", "testing"]'), needs.get-environment.outputs.stability) && github.event_name != 'workflow_dispatch') &&
! cancelled() &&
! contains(needs.*.result, 'failure') &&
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/behat-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,8 @@ jobs:
runs-on: ubuntu-24.04
if: |
inputs.is_nightly == 'true' && github.run_attempt == 1 &&
(failure() || cancelled())
(failure() || cancelled()) &&
startsWith(github.ref_name, 'dev')
steps:
- name: Checkout sources
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/create-nightly-incident-ticket.yml

This file was deleted.

10 changes: 7 additions & 3 deletions .github/workflows/cypress-component-parallelization.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ on:
type: string
description: 'The frontend dependencies lock file path'
is_nightly:
required: true
type: boolean
required: false
type: string
secrets:
AWS_ACCESS_KEY_ID:
required: true
Expand Down Expand Up @@ -288,8 +288,12 @@ jobs:
runs-on: ubuntu-24.04
if: |
inputs.is_nightly == 'true' && github.run_attempt == 1 &&
(failure() || cancelled())
(failure() || cancelled()) &&
startsWith(github.ref_name, 'dev')
steps:
- name: Checkout sources
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0

- name: Create Jira ticket if nightly build failure
uses: ./.github/actions/create-jira-ticket
with:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/cypress-e2e-parallelization.yml
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,12 @@ jobs:
runs-on: ubuntu-24.04
if: |
inputs.is_nightly == 'true' && github.run_attempt == 1 &&
(failure() || cancelled())
(failure() || cancelled()) &&
startsWith(github.ref_name, 'dev')
steps:
- name: Checkout sources
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0

- name: Create Jira ticket if nightly build failure
uses: ./.github/actions/create-jira-ticket
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docker-glpi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:

dockerize:
needs: [get-environment]
if: ${{ needs.get-environment.outputs.skip_workflow == 'false' }}
runs-on: ubuntu-24.04

steps:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docker-keycloak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:

create-and-push-docker:
needs: [get-environment]
if: ${{ needs.get-environment.outputs.skip_workflow == 'false' }}
runs-on: ubuntu-24.04

steps:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docker-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:

dockerize:
needs: [get-environment]
if: ${{ needs.get-environment.outputs.skip_workflow == 'false' }}

strategy:
fail-fast: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
dockerize-stable:
needs: [get-environment]
runs-on: ubuntu-24.04
if: ${{ !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') && needs.get-environment.outputs.stability == 'stable' && github.ref_name == 'master' }}
if: ${{ needs.get-environment.outputs.skip_workflow == 'false' && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') && needs.get-environment.outputs.stability == 'stable' && github.ref_name == 'master' }}

env:
project: centreon-web
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docker-translation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:

dockerize:
needs: [get-environment]
if: ${{ needs.get-environment.outputs.skip_workflow == 'false' }}
runs-on: ubuntu-24.04

steps:
Expand Down
Loading

0 comments on commit fd1e2d8

Please sign in to comment.