9
9
10
10
jobs :
11
11
buildx :
12
-
13
12
runs-on : ubuntu-latest
14
-
13
+ strategy :
14
+ matrix :
15
+ include :
16
+ # tools are build in order, for dependencies.
17
+ - name : " rbqwrapped tools (p0f only)"
18
+ tools : " rbqwrapper p0f"
19
+ - name : pcap_to_node_pcap
20
+ tools : " pcap_to_node_pcap"
21
+ - name : tcprewrite_dot1q
22
+ tools : " tcprewrite_dot1q"
23
+ - name : ncapture
24
+ tools : " network_tap/ncapture"
25
+ - name : network_tap
26
+ tools : " network_tap"
27
+ - name : mercury
28
+ tools : " mercury"
29
+ - name : pcap_stats
30
+ tools : " pcap_stats"
31
+ - name : snort
32
+ tools : " snort"
15
33
steps :
16
34
- uses : actions/checkout@v2
17
35
with :
18
36
fetch-depth : 0
19
- - name : Define list of images to build
20
- id : get_images
21
- run : |
22
- echo ::set-output name=NAMES::${NAMES}
23
- env :
24
- NAMES : rbqwrapper pcap_to_node_pcap tcprewrite_dot1q network_tap/ncapture network_tap p0f mercury pcap_stats snort
25
37
- name : Get version number
26
38
id : get_version
27
39
run : |
76
88
VERSION : ${{ steps.get_version.outputs.VERSION }}
77
89
- name : Test building only
78
90
run : |
79
- for N in ${{ steps.get_images.outputs.NAMES }}
80
- do
81
- TAGGED_IMAGE="${{ secrets.DOCKER_NAMESPACE }}/$(basename ${N}):${{ steps.publish_tag.outputs.TAG }}"
82
- docker build \
83
- -t ${TAGGED_IMAGE} -f ${N}/Dockerfile .
91
+ for tool in ${{ matrix.tools }} ; do
92
+ TAGGED_IMAGE="${{ secrets.DOCKER_NAMESPACE }}/$(basename ${tool}):${{ steps.publish_tag.outputs.TAG }}"
93
+ docker build -t ${TAGGED_IMAGE} -f "${tool}/Dockerfile" .
84
94
done
85
95
if : steps.docker.outputs.PUSH_TO_DOCKER == 'false'
86
96
- name : Set up qemu
@@ -103,22 +113,20 @@ jobs:
103
113
env :
104
114
DOCKER_CLI_EXPERIMENTAL : enabled
105
115
run : |
106
- for N in ${{ steps.get_images.outputs.NAMES }}
107
- do
108
- TAGGED_IMAGE="${{ secrets.DOCKER_NAMESPACE }}/$(basename ${N}):${{ steps.publish_tag.outputs.TAG }}"
116
+ for tool in ${{ matrix.tools }} ; do
117
+ TAGGED_IMAGE="${{ secrets.DOCKER_NAMESPACE }}/$(basename ${tool}):${{ steps.publish_tag.outputs.TAG }}"
109
118
docker buildx build \
110
119
--platform linux/amd64,linux/arm/v7,linux/arm64 \
111
120
--push \
112
- -t ${TAGGED_IMAGE} -f ${N }/Dockerfile .
121
+ -t ${TAGGED_IMAGE} -f "${tool }/Dockerfile" .
113
122
done
114
123
if : success() && (steps.docker.outputs.PUSH_TO_DOCKER == 'true')
115
124
- name : List available tags for images
116
125
env :
117
126
DOCKER_CLI_EXPERIMENTAL : enabled
118
127
run : |
119
- for N in ${{ steps.get_images.outputs.NAMES }}
120
- do
121
- image="${{ secrets.DOCKER_NAMESPACE }}/$(basename ${N})"
128
+ for tool in ${{ matrix.tools }} ; do
129
+ image="${{ secrets.DOCKER_NAMESPACE }}/$(basename ${tool})"
122
130
echo "${image}:" $(
123
131
wget -q https://registry.hub.docker.com/v1/repositories/${image}/tags -O - |
124
132
tr -d '[]" ' |
0 commit comments