Skip to content

Commit 5c5a7a8

Browse files
chore: Update ci enterprise
1 parent 9acb72e commit 5c5a7a8

File tree

3 files changed

+129
-95
lines changed

3 files changed

+129
-95
lines changed

.github/workflows/ci-enterprise.yaml

Lines changed: 127 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,15 @@ jobs:
184184
scanners: "vuln"
185185

186186
test-container:
187+
strategy:
188+
matrix:
189+
deployment_type: ["docker", "podman"]
187190
runs-on: ubuntu-latest
191+
continue-on-error: true
188192
needs:
189193
- meta
190194
- build_action
191-
container:
192-
image: python:3.9-buster
195+
193196
services:
194197
splunk:
195198
image: splunk/splunk:${{ fromJson(needs.meta.outputs.matrix_supportedSplunk)[0].version }}
@@ -202,41 +205,68 @@ jobs:
202205
SPLUNK_PASSWORD: Changed@11
203206
SPLUNK_START_ARGS: --accept-license
204207
SPLUNK_APPS_URL: https://github.com/splunk/splunk-configurations-base-indexes/releases/download/v1.0.0/splunk_configurations_base_indexes-1.0.0.tar.gz
205-
sc4s:
206-
image: ${{ needs.meta.outputs.container_base }}
207-
ports:
208-
- 514:514
209-
- 601:601
210-
- 5614:5514
211-
- 5601:5601
212-
- 6000:6000
213-
- 6002:6002
214-
- 9000:9000
215-
env:
216-
SC4S_DEST_SPLUNK_HEC_DEFAULT_URL: https://splunk:8088
217-
SC4S_DEST_SPLUNK_HEC_DEFAULT_TOKEN: 70b6ae71-76b3-4c38-9597-0c5b37ad9630
218-
SC4S_DEST_SPLUNK_HEC_DEFAULT_TLS_VERIFY: "no"
219-
SC4S_DEST_SPLUNK_HEC_DEFAULT_HTTP_COMPRESSION: "yes"
220-
SC4S_LISTEN_PFSENSE_FIREWALL_TCP_PORT: 6000
221-
SC4S_LISTEN_SIMPLE_TEST_ONE_TCP_PORT: 5514
222-
SC4S_LISTEN_SIMPLE_TEST_ONE_UDP_PORT: 5514
223-
SC4S_LISTEN_SIMPLE_TEST_TWO_TCP_PORT: 5601
224-
SC4S_LISTEN_SPECTRACOM_NTP_TCP_PORT: 6002
225-
SC4S_LISTEN_CISCO_ESA_TCP_PORT: 9000
226-
SC4S_LISTEN_RARITAN_DSX_TCP_PORT: 9001
227-
SC4S_LISTEN_CHECKPOINT_SPLUNK_NOISE_CONTROL: "yes"
228-
SC4S_SOURCE_RICOH_SYSLOG_FIXHOST: "yes"
229-
TEST_SC4S_ACTIVATE_EXAMPLES: "yes"
230-
SC4S_DEBUG_CONTAINER: "yes"
231-
SC4S_SOURCE_VMWARE_VSPHERE_GROUPMSG: "yes"
232-
SC4S_NETAPP_ONTAP_NEW_FORMAT: "yes"
233-
SC4S_USE_VPS_CACHE: "yes"
208+
234209
steps:
235210
- name: Checkout
236211
uses: actions/checkout@v4
237212
with:
238213
submodules: false
239214
persist-credentials: false
215+
- name: Install Ansible and other dependencies as python package
216+
run: |
217+
pip install ansible~=6.1.0 --no-cache-dir \
218+
&& pip install pywinrm>=0.4.2 --no-cache-dir \
219+
&& pip install ansible-lint>=6.0.0 --no-cache-dir \
220+
&& pip install docker
221+
- name: Configure Ansible Environment Variables
222+
env:
223+
ANSIBLE_CONFIG: ansible.cfg
224+
ANSIBLE_HOST_KEY_CHECKING: False
225+
run: |
226+
echo "ANSIBLE_CONFIG is set to: $ANSIBLE_CONFIG"
227+
echo "ANSIBLE_HOST_KEY_CHECKING is set to: $ANSIBLE_HOST_KEY_CHECKING"
228+
sudo systemctl set-environment SC4S_IMAGE=${{ needs.meta.outputs.container_base }}
229+
- name: Update inventory file
230+
run: |
231+
cat << EOF > ansible/inventory/inventory.yaml
232+
---
233+
all:
234+
hosts:
235+
children:
236+
node:
237+
hosts:
238+
node_1:
239+
ansible_host: 127.0.0.1
240+
ansible_connection: local
241+
ansible_user: root
242+
- name: Update env_file
243+
run: |
244+
echo "Updating ansible/inventory/inventory.yaml"
245+
cat << EOF > ansible/resources/env_file
246+
SC4S_DEST_SPLUNK_HEC_DEFAULT_URL=https://127.0.0.1:8088
247+
SC4S_DEST_SPLUNK_HEC_DEFAULT_TOKEN=70b6ae71-76b3-4c38-9597-0c5b37ad9630
248+
SC4S_DEST_SPLUNK_HEC_DEFAULT_TLS_VERIFY=no
249+
SC4S_DEST_SPLUNK_HEC_DEFAULT_HTTP_COMPRESSION=yes
250+
SC4S_LISTEN_PFSENSE_FIREWALL_TCP_PORT=6000
251+
SC4S_LISTEN_SIMPLE_TEST_ONE_TCP_PORT=5514
252+
SC4S_LISTEN_SIMPLE_TEST_ONE_UDP_PORT=5514
253+
SC4S_LISTEN_SIMPLE_TEST_TWO_TCP_PORT=5601
254+
SC4S_LISTEN_SPECTRACOM_NTP_TCP_PORT=6002
255+
SC4S_LISTEN_CISCO_ESA_TCP_PORT=9000
256+
SC4S_LISTEN_RARITAN_DSX_TCP_PORT=9001
257+
SC4S_LISTEN_CHECKPOINT_SPLUNK_NOISE_CONTROL=yes
258+
SC4S_SOURCE_RICOH_SYSLOG_FIXHOST=yes
259+
TEST_SC4S_ACTIVATE_EXAMPLES=yes
260+
SC4S_DEBUG_CONTAINER=yes
261+
SC4S_SOURCE_VMWARE_VSPHERE_GROUPMSG=yes
262+
SC4S_NETAPP_ONTAP_NEW_FORMAT=yes
263+
SC4S_USE_VPS_CACHE=yes
264+
- name: Update current SC4S image in unit file
265+
run: |
266+
sed -i 's|Environment="SC4S_IMAGE=ghcr.io/splunk/splunk-connect-for-syslog/container3:latest"|Environment="SC4S_IMAGE=${{ needs.meta.outputs.container_base }}"|' ansible/resources/${{ matrix.deployment_type }}_sc4s.service
267+
- name: Run Ansible Playbook
268+
run: |
269+
ansible-playbook --connection=local -i ansible/inventory/inventory.yaml ansible/playbooks/${{ matrix.deployment_type }}.yml
240270
- name: Run tests
241271
run: |
242272
pip3 install poetry
@@ -245,93 +275,91 @@ jobs:
245275
poetry run pytest -v --tb=long \
246276
--splunk_type=external \
247277
--splunk_hec_token=70b6ae71-76b3-4c38-9597-0c5b37ad9630 \
248-
--splunk_host=splunk \
249-
--sc4s_host=sc4s \
278+
--splunk_host=127.0.0.1 \
279+
--sc4s_host=127.0.0.1 \
250280
--junitxml=test-results/test.xml \
251281
-n 14 \
252282
-k 'not lite and not name_cache'
253-
test-ipv4-name-cache:
283+
- name: artifact-test-results
284+
uses: actions/upload-artifact@v4
285+
with:
286+
name: test-container-results_${{ matrix.deployment_type }}.xml
287+
path: test-results/test.xml
288+
if: ${{ !cancelled() }}
289+
290+
test-name-cache:
291+
strategy:
292+
matrix:
293+
deployment_type: ["docker", "podman"]
294+
SC4S_IPV6_ENABLE: ["yes","no"]
254295
runs-on: ubuntu-latest
296+
continue-on-error: true
255297
needs:
256298
- meta
257299
- build_action
258-
container:
259-
image: python:3.9-buster
300+
260301
services:
261302
splunk:
262303
image: splunk/splunk:${{ fromJson(needs.meta.outputs.matrix_supportedSplunk)[0].version }}
263304
ports:
305+
- 8000:8000
264306
- 8088:8088
265307
- 8089:8089
266308
env:
267309
SPLUNK_HEC_TOKEN: 70b6ae71-76b3-4c38-9597-0c5b37ad9630
268310
SPLUNK_PASSWORD: Changed@11
269311
SPLUNK_START_ARGS: --accept-license
270312
SPLUNK_APPS_URL: https://github.com/splunk/splunk-configurations-base-indexes/releases/download/v1.0.0/splunk_configurations_base_indexes-1.0.0.tar.gz
271-
sc4s:
272-
image: ${{ needs.meta.outputs.container_base }}
273-
ports:
274-
- 514:514
275-
env:
276-
SC4S_DEST_SPLUNK_HEC_DEFAULT_URL: https://splunk:8088
277-
SC4S_DEST_SPLUNK_HEC_DEFAULT_TOKEN: 70b6ae71-76b3-4c38-9597-0c5b37ad9630
278-
SC4S_DEST_SPLUNK_HEC_DEFAULT_TLS_VERIFY: "no"
279-
SC4S_USE_NAME_CACHE: "yes"
280-
SC4S_CLEAR_NAME_CACHE: "yes"
313+
281314
steps:
282315
- name: Checkout
283316
uses: actions/checkout@v4
284317
with:
285318
submodules: false
286319
persist-credentials: false
287-
- name: Run tests
320+
- name: Install Ansible and other dependencies as python package
288321
run: |
289-
pip3 install poetry
290-
poetry install
291-
mkdir -p test-results || true
292-
poetry run pytest -v --tb=long \
293-
--splunk_type=external \
294-
--splunk_hec_token=70b6ae71-76b3-4c38-9597-0c5b37ad9630 \
295-
--splunk_host=splunk \
296-
--sc4s_host=sc4s \
297-
--junitxml=test-results/test.xml \
298-
-n 1 \
299-
-m 'name_cache'
300-
test-ipv6-name-cache:
301-
runs-on: ubuntu-latest
302-
needs:
303-
- meta
304-
- build_action
305-
container:
306-
image: python:3.9-buster
307-
services:
308-
splunk:
309-
image: splunk/splunk:${{ fromJson(needs.meta.outputs.matrix_supportedSplunk)[0].version }}
310-
ports:
311-
- 8088:8088
312-
- 8089:8089
313-
env:
314-
SPLUNK_HEC_TOKEN: 70b6ae71-76b3-4c38-9597-0c5b37ad9630
315-
SPLUNK_PASSWORD: Changed@11
316-
SPLUNK_START_ARGS: --accept-license
317-
SPLUNK_APPS_URL: https://github.com/splunk/splunk-configurations-base-indexes/releases/download/v1.0.0/splunk_configurations_base_indexes-1.0.0.tar.gz
318-
sc4s:
319-
image: ${{ needs.meta.outputs.container_base }}
320-
ports:
321-
- 514:514
322+
pip install ansible~=6.1.0 --no-cache-dir \
323+
&& pip install pywinrm>=0.4.2 --no-cache-dir \
324+
&& pip install ansible-lint>=6.0.0 --no-cache-dir \
325+
&& pip install docker
326+
- name: Configure Ansible Environment Variables
322327
env:
323-
SC4S_DEST_SPLUNK_HEC_DEFAULT_URL: https://splunk:8088
324-
SC4S_DEST_SPLUNK_HEC_DEFAULT_TOKEN: 70b6ae71-76b3-4c38-9597-0c5b37ad9630
325-
SC4S_DEST_SPLUNK_HEC_DEFAULT_TLS_VERIFY: "no"
328+
ANSIBLE_CONFIG: ansible.cfg
329+
ANSIBLE_HOST_KEY_CHECKING: False
330+
run: |
331+
echo "ANSIBLE_CONFIG is set to: $ANSIBLE_CONFIG"
332+
echo "ANSIBLE_HOST_KEY_CHECKING is set to: $ANSIBLE_HOST_KEY_CHECKING"
333+
sudo systemctl set-environment SC4S_IMAGE=${{ needs.meta.outputs.container_base }}
334+
- name: Update inventory file
335+
run: |
336+
cat << EOF > ansible/inventory/inventory.yaml
337+
---
338+
all:
339+
hosts:
340+
children:
341+
node:
342+
hosts:
343+
node_1:
344+
ansible_host: 127.0.0.1
345+
ansible_connection: local
346+
ansible_user: root
347+
- name: Update env_file
348+
run: |
349+
echo "Updating ansible/inventory/inventory.yaml"
350+
cat << EOF > ansible/resources/env_file
351+
SC4S_DEST_SPLUNK_HEC_DEFAULT_URL=https://127.0.0.1:8088
352+
SC4S_DEST_SPLUNK_HEC_DEFAULT_TOKEN=70b6ae71-76b3-4c38-9597-0c5b37ad9630
353+
SC4S_DEST_SPLUNK_HEC_DEFAULT_TLS_VERIFY=no
326354
SC4S_USE_NAME_CACHE: "yes"
327355
SC4S_CLEAR_NAME_CACHE: "yes"
328-
SC4S_IPV6_ENABLE: "yes"
329-
steps:
330-
- name: Checkout
331-
uses: actions/checkout@v4
332-
with:
333-
submodules: false
334-
persist-credentials: false
356+
SC4S_IPV6_ENABLE: "${{ matrix.SC4S_IPV6_ENABLE }}"
357+
- name: Update current SC4S image in unit file
358+
run: |
359+
sed -i 's|Environment="SC4S_IMAGE=ghcr.io/splunk/splunk-connect-for-syslog/container3:latest"|Environment="SC4S_IMAGE=${{ needs.meta.outputs.container_base }}"|' ansible/resources/${{ matrix.deployment_type }}_sc4s.service
360+
- name: Run Ansible Playbook
361+
run: |
362+
ansible-playbook --connection=local -i ansible/inventory/inventory.yaml ansible/playbooks/${{ matrix.deployment_type }}.yml
335363
- name: Run tests
336364
run: |
337365
pip3 install poetry
@@ -340,19 +368,25 @@ jobs:
340368
poetry run pytest -v --tb=long \
341369
--splunk_type=external \
342370
--splunk_hec_token=70b6ae71-76b3-4c38-9597-0c5b37ad9630 \
343-
--splunk_host=splunk \
344-
--sc4s_host=sc4s \
371+
--splunk_host=127.0.0.1 \
372+
--sc4s_host=127.0.0.1 \
345373
--junitxml=test-results/test.xml \
346374
-n 1 \
347375
-m 'name_cache'
376+
- name: artifact-test-results
377+
uses: actions/upload-artifact@v4
378+
with:
379+
name: test-name-cache-results_${{ matrix.deployment_type }}_IPv6_${{ matrix.SC4S_IPV6_ENABLE }}.xml
380+
path: test-results/test.xml
381+
if: ${{ !cancelled() }}
348382
release:
349383
name: Release
350384
runs-on: ubuntu-latest
351385
needs:
352386
- meta
353387
- build_action
354388
- test-container
355-
- test-ipv4-name-cache
389+
- test-name-cache
356390
steps:
357391
- uses: actions/checkout@v4
358392
with:

.github/workflows/ci-lite.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ jobs:
369369
- name: artifact-test-results
370370
uses: actions/upload-artifact@v4
371371
with:
372-
name: test-container-results_${{ matrix.deployment_type }}_IPv6_${{ matrix.SC4S_IPV6_ENABLE }}.xml
372+
name: test-name-cache-results_${{ matrix.deployment_type }}_IPv6_${{ matrix.SC4S_IPV6_ENABLE }}.xml
373373
path: test-results/test.xml
374374
if: ${{ !cancelled() }}
375375

.github/workflows/ci-main.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ jobs:
370370
- name: artifact-test-results
371371
uses: actions/upload-artifact@v4
372372
with:
373-
name: test-container-results_${{ matrix.deployment_type }}_IPv6_${{ matrix.SC4S_IPV6_ENABLE }}.xml
373+
name: test-name-cache-results_${{ matrix.deployment_type }}_IPv6_${{ matrix.SC4S_IPV6_ENABLE }}.xml
374374
path: test-results/test.xml
375375
if: ${{ !cancelled() }}
376376

0 commit comments

Comments
 (0)