-
Notifications
You must be signed in to change notification settings - Fork 277
149 lines (127 loc) · 5.04 KB
/
as400.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: as400
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
workflow_dispatch:
pull_request:
paths:
- 'as400/**'
push:
branches:
- develop
- master
paths:
- 'as400/**'
jobs:
get-environment:
uses: ./.github/workflows/get-environment.yml
with:
version_file: as400/packaging/centreon-as400-daemon.yaml
package:
needs: [get-environment]
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
- package_extension: rpm
image: packaging-plugins-java-alma8
distrib: el8
- package_extension: rpm
image: packaging-plugins-java-alma9
distrib: el9
- package_extension: deb
image: packaging-plugins-java-bullseye
distrib: bullseye
- package_extension: deb
image: packaging-plugins-java-bookworm
distrib: bookworm
- package_extension: deb
image: packaging-plugins-java-jammy
distrib: jammy
container:
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}
credentials:
username: ${{ secrets.DOCKER_REGISTRY_ID }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
name: package ${{ matrix.distrib }}
steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Prepare files for packaging
run: |
find . \
-type f \
-exec grep -E '(@CONNECTOR_VERSION@)|(@CONNECTOR_HOME@)|(@CONNECTOR_ETC@)|(@CONNECTOR_LOG@)|(@CONNECTOR_USER@)|(@JAVA_BIN@)' {} ';' \
-exec sed -i \
-e 's|@CONNECTOR_VERSION@|'"%{version}"'|g' \
-e 's|@CONNECTOR_HOME@|'"%{_datadir}/centreon-as400"'|g' \
-e 's|@CONNECTOR_ETC@|'"/etc/centreon-as400/"'|g' \
-e 's|@CONNECTOR_LOG@|'"/var/log/centreon-as400/"'|g' \
-e 's|@CONNECTOR_USER@|'"centreon-as400"'|g' \
-e 's|@JAVA_BIN@|'"/usr/bin/java"'|g' \
{} ';'
shell: bash
- name: Set JAVA_HOME
run: export JAVA_HOME=$( java -XshowSettings:properties -version 2>&1 > /dev/null | grep 'java.home' | tr -s ' ' | cut -d ' ' -f 4)
- name: Build JAR using maven
run: mvn -version && mvn clean install -f as400/connector.as400/pom.xml
- name: Remove me after debug
run: find / -name "centreon-as400*.jar"
- name: Package
uses: ./.github/actions/package-nfpm
with:
nfpm_file_pattern: "as400/packaging/centreon-as400-daemon.yaml"
distrib: ${{ matrix.distrib }}
package_extension: ${{ matrix.package_extension }}
version: ${{ needs.get-environment.outputs.version }}
release: 1
arch: all
commit_hash: ${{ github.sha }}
cache_key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-as400-${{ matrix.distrib }}
rpm_gpg_key: ${{ secrets.RPM_GPG_SIGNING_KEY }}
rpm_gpg_signing_key_id: ${{ secrets.RPM_GPG_SIGNING_KEY_ID }}
rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }}
stability: ${{ needs.get-environment.outputs.stability }}
- name: Save to cache
uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ./*.${{ matrix.package_extension }}
key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-${{ matrix.distrib }}
deliver-rpm:
needs: [get-environment, package]
if: ${{ contains(fromJson('["stable", "testing", "unstable"]'), needs.get-environment.outputs.stability) }}
runs-on: [self-hosted, common]
strategy:
matrix:
distrib: [el8, el9]
steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Delivery
uses: ./.github/actions/rpm-delivery
with:
module_name: as400
distrib: ${{ matrix.distrib }}
cache_key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
stability: ${{ needs.get-environment.outputs.stability }}
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
deliver-deb:
needs: [get-environment, package]
if: ${{ contains(fromJson('["stable", "testing", "unstable"]'), needs.get-environment.outputs.stability) }}
runs-on: [self-hosted, common]
strategy:
matrix:
distrib: [bullseye, bookworm, jammy]
steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Delivery
uses: ./.github/actions/deb-delivery
with:
module_name: as400
distrib: ${{ matrix.distrib }}
cache_key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }}
stability: ${{ needs.get-environment.outputs.stability }}
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}