-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (108 loc) · 4.44 KB
/
ci.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
# This file is part of IRIS HTTP Send Module.
#
# Copyright (C) 2023 Airbus CyberSecurity (SAS)
#
# IRIS HTTP Send Module is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# IRIS HTTP Send Module is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
# for more details.
#
# You should have received a copy of the GNU Lesser General Public License along
# with IRIS HTTP Send Module. If not, see <https://www.gnu.org/licenses/>.
name: Continuous Integration
on: push
jobs:
iris-httpsend-module:
name: Build iris-httpsend-module
runs-on: ubuntu-20.04
steps:
- name: Check out iris-httpsend-module
uses: actions/checkout@v4
- name: Get iris-httpsend-module version
id: get-version
run: |
echo "version=$(python setup.py --version)" >> $GITHUB_OUTPUT
- name: Build wheel for iris-httpsend-module ${{ steps.get-version.outputs.version }}
run: |
python setup.py bdist_wheel
- name: Archive iris-httpsend-module wheel
uses: actions/upload-artifact@v4
with:
name: iris-httpsend-module-wheel
path: |
dist/iris_httpsend_module-${{ steps.get-version.outputs.version }}-py3-none-any.whl
LICENSE
COPYING.*
if-no-files-found: error
retention-days: 1
outputs:
version: ${{ steps.get-version.outputs.version }}
dockers:
name: Build iris dockers with iris-httpsend-module and run end-to-end tests
runs-on: ubuntu-20.04
needs: iris-httpsend-module
env:
IRIS_VERSION: v2.3.2
HTTPSEND_VERSION: ${{ needs.iris-httpsend-module.outputs.version }}
steps:
- name: Check out Iris ${{ env.IRIS_VERSION }}
uses: actions/checkout@v4
with:
repository: dfir-iris/iris-web
ref: ${{ env.IRIS_VERSION }}
path: iris-web
- name: Download iris-httpsend-module wheel
uses: actions/download-artifact@v4
with:
name: iris-httpsend-module-wheel
path: iris-web/source/dependencies
- name: Check out iris-httpsend-module
uses: actions/checkout@v4
with:
path: iris-httpsend-module
- name: Patch Iris (if any patch present)
working-directory: iris-web
run: |
if [ -d ../iris-httpsend-module/patches ]
then
git apply --verbose ../iris-httpsend-module/patches/*.patch
fi
- name: Build dockers
working-directory: iris-web
run: |
printf "\ndependencies/iris_httpsend_module-${{ env.HTTPSEND_VERSION }}-py3-none-any.whl" >> source/requirements.txt
cp .env.model .env
docker-compose build
# - name: Run end-to-end tests
# working-directory: iris-httpsend-module/tests
# run: |
# python -m venv venv
# source venv/bin/activate
# pip install -r requirements.txt
# python -u -m unittest --verbose
- name: Produce tar archive with dockers
run: |
docker tag iriswebapp_db:${{ env.IRIS_VERSION }} iriswebapp_db:${{ env.HTTPSEND_VERSION }}
docker tag iriswebapp_nginx:${{ env.IRIS_VERSION }} iriswebapp_nginx:${{ env.HTTPSEND_VERSION }}
docker tag iriswebapp_app:${{ env.IRIS_VERSION }} iriswebapp_app:${{ env.HTTPSEND_VERSION }}
docker save iriswebapp_db:${{ env.HTTPSEND_VERSION }} iriswebapp_nginx:${{ env.HTTPSEND_VERSION }} iriswebapp_app:${{ env.HTTPSEND_VERSION }} | gzip > iris-httpsend-${{ env.HTTPSEND_VERSION }}.dockers.tar.gz
zip iris-httpsend-${{ env.HTTPSEND_VERSION }}.zip iris-httpsend-${{ env.HTTPSEND_VERSION }}.dockers.tar.gz LICENSE COPYING.*
- name: Archive dockers tar as artifact
uses: actions/upload-artifact@v4
with:
name: dockers
path: iris-httpsend-${{ env.HTTPSEND_VERSION }}.zip
if-no-files-found: error
retention-days: 1
- name: Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
iris-httpsend-${{ env.HTTPSEND_VERSION }}.zip
fail_on_unmatched_files: true