-
Notifications
You must be signed in to change notification settings - Fork 66
240 lines (214 loc) · 9.48 KB
/
create-docker-image.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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
name: Create Docker Image
run-name: ${{ github.actor }} is creating a new Docker Image of ManifoldCF ${{ github.event.inputs.release }}
on:
workflow_dispatch:
inputs:
release:
type: choice
description: Select the ManifoldCF release
options:
- 2.27-JDK-11
- 2.26-JDK-11 #Java 11
- 2.25-JDK-8
- 2.24-JDK-8
- 2.23-JDK-8
- 2.22-JDK-8
- 2.21-JDK-8
- 2.20-JDK-8
- 2.19-JDK-8
- 2.18-JDK-8
- 2.17-JDK-8
- 2.16-JDK-8
- 2.15-JDK-8
- 2.14-JDK-8
- 2.13-JDK-8
- 2.12-JDK-8
- 2.11-JDK-8
- 2.10-JDK-8
- 2.9-JDK-8
- 2.8-JDK-8
- 2.7-JDK-8 #Java 1.8
- 2.6-JDK-7
- 2.5-JDK-7
- 2.4-JDK-7
- 2.3-JDK-7
- 2.2-JDK-7
- 2.1-JDK-7
- 2.0-JDK-7
- 1.10-JDK-7 #Java 1.7
jobs:
createDockerImageBuildingFromSourceCode:
if: |
(github.event.inputs.release != '2.27-JDK-11') &&
(github.event.inputs.release != '2.26-JDK-11') &&
(github.event.inputs.release != '2.25-JDK-8') &&
(github.event.inputs.release != '2.24-JDK-8') &&
(github.event.inputs.release != '2.23-JDK-8') &&
(github.event.inputs.release != '1.10-JDK-7')
runs-on: ubuntu-22.04
steps:
- name: Extract MCF Release version
id: mcf
run: |
mcfrelease="${{ github.event.inputs.release }}"
set -- $mcfrelease
echo "release=${1%%-*}" >> $GITHUB_OUTPUT
- name: Extract JDK version
id: jdk
run: |
mcfrelease="${{ github.event.inputs.release }}"
set -- $mcfrelease
echo "version=${1##*-}" >> $GITHUB_OUTPUT
- name: Checkout for legacy versions of ManifoldCF
uses: actions/[email protected]
with:
ref: release-${{ steps.mcf.outputs.release }}
- name: Set up OpenJDK ${{ steps.jdk.outputs.version }} Temurin x64
uses: actions/[email protected]
with:
java-version: '${{ steps.jdk.outputs.version }}'
distribution: 'temurin'
architecture: x64
cache: maven
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE
- name: Fix Nuxeo URL
run: |
sed -i 's/http\:\/\/maven.nuxeo.com\/nexus\/content\/repositories\/public-releases/https\:\/\/packages.nuxeo.com\/repository\/maven-public-archives/g' build.xml
- name: Ant Build
run: ant make-core-deps make-deps image
- name: Download the specific Dockerfile from GitHub
run: |
wget https://raw.githubusercontent.com/apache/manifoldcf/trunk/src/main/docker/JDK-${{ steps.jdk.outputs.version }}/Dockerfile
- name: Set up QEMU
uses: docker/[email protected]
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/[email protected]
with:
images: apache/manifoldcf
labels: |
maintainer=Apache ManifoldCF Developers <[email protected]>
org.opencontainers.image.title=Apache ManifoldCF
org.opencontainers.image.description=Apache ManifoldCF is a multi-repository crawler framework, with multiple connectors.
org.opencontainers.image.vendor=Apache Software Foundation
org.opencontainers.image.ref.name=manifoldcf
org.opencontainers.image.authors=Apache ManifoldCF Developers <[email protected]>
org.opencontainers.image.url=https://hub.docker.com/r/apache/manifoldcf
org.opencontainers.image.source=https://github.com/apache/manifoldcf/blob/trunk/Dockerfile
org.opencontainers.image.documentation=https://hub.docker.com/r/apache/manifoldcf
org.opencontainers.image.version=${{ steps.mcf.outputs.release }}
org.opencontainers.image.licenses=Apache-2.0
- name: Build and push ManifoldCF Docker Image
uses: docker/[email protected]
with:
context: .
file: Dockerfile
build-args: |
MCF_VERSION=${{ steps.mcf.outputs.release }}
platforms: linux/amd64,linux/arm64/v8
push: true
tags: apache/manifoldcf:latest,apache/manifoldcf:${{ steps.mcf.outputs.release }}
labels: ${{ steps.meta.outputs.labels }}
createDockerImageForAvailableDistributionPackage:
if: |
(github.event.inputs.release == '2.27-JDK-11') ||
(github.event.inputs.release == '2.26-JDK-11') ||
(github.event.inputs.release == '2.25-JDK-8') ||
(github.event.inputs.release == '2.24-JDK-8') ||
(github.event.inputs.release == '2.23-JDK-8') ||
(github.event.inputs.release == '1.10-JDK-7')
runs-on: ubuntu-22.04
steps:
- name: Extract MCF Release version
id: mcf
run: |
mcfrelease="${{ github.event.inputs.release }}"
set -- $mcfrelease
echo "release=${1%%-*}" >> $GITHUB_OUTPUT
- name: Extract JDK version
id: jdk
run: |
mcfrelease="${{ github.event.inputs.release }}"
set -- $mcfrelease
echo "version=${1##*-}" >> $GITHUB_OUTPUT
- name: Checkout the specific Dockerfile
uses: actions/[email protected]
with:
sparse-checkout: |
src/main/docker/JDK-${{ steps.jdk.outputs.version }}/Dockerfile
src/main/docker/logging/logging.xml
sparse-checkout-cone-mode: false
- name: Move the Dockerfile in the root folder
run: |
mv src/main/docker/JDK-${{ steps.jdk.outputs.version }}/Dockerfile ${{ github.workspace }}
- name: Download ManifoldCF ${{ steps.mcf.outputs.release }} distribution
run: |
wget -qO- https://dlcdn.apache.org/manifoldcf/apache-manifoldcf-${{ steps.mcf.outputs.release }}/apache-manifoldcf-${{ steps.mcf.outputs.release }}-bin.tar.gz && \
tar -xzvf apache-manifoldcf-${{ steps.mcf.outputs.release }}-bin.tar.gz && \
mv apache-manifoldcf-${{ steps.mcf.outputs.release }}-dev dist && \
rm apache-manifoldcf-${{ steps.mcf.outputs.release }}-bin.tar.gz
- name: Update MCF version in the properties.xml files
run: |
sed -i 's/${{ steps.mcf.outputs.release }}-dev/${{ steps.mcf.outputs.release }}/g' dist/example/properties.xml;
sed -i 's/${{ steps.mcf.outputs.release }}-dev/${{ steps.mcf.outputs.release }}/g' dist/multiprocess-file-example/properties.xml;
- name: Set up QEMU
uses: docker/[email protected]
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/[email protected]
with:
images: apache/manifoldcf
labels: |
maintainer=Apache ManifoldCF Developers <[email protected]>
org.opencontainers.image.title=Apache ManifoldCF
org.opencontainers.image.description=Apache ManifoldCF is a multi-repository crawler framework, with multiple connectors.
org.opencontainers.image.vendor=Apache Software Foundation
org.opencontainers.image.ref.name=manifoldcf
org.opencontainers.image.authors=Apache ManifoldCF Developers <[email protected]>
org.opencontainers.image.url=https://hub.docker.com/r/apache/manifoldcf
org.opencontainers.image.source=https://github.com/apache/manifoldcf/blob/trunk/Dockerfile
org.opencontainers.image.documentation=https://hub.docker.com/r/apache/manifoldcf
org.opencontainers.image.version=${{ steps.mcf.outputs.release }}
org.opencontainers.image.licenses=Apache-2.0
- name: Build and push ManifoldCF Docker Image
uses: docker/[email protected]
with:
context: .
file: Dockerfile
build-args: |
MCF_VERSION=${{ steps.mcf.outputs.release }}
platforms: linux/amd64,linux/arm64/v8
push: true
tags: apache/manifoldcf:latest,apache/manifoldcf:${{ steps.mcf.outputs.release }}
labels: ${{ steps.meta.outputs.labels }}