DBZ-3934 Docker image for artifact server serving artifacts for Strimzi's build mechanism
This commit is contained in:
parent
97cb997be3
commit
0e040d8090
5
.gitignore
vendored
5
.gitignore
vendored
@ -30,4 +30,7 @@ generated-sources/
|
||||
/state/
|
||||
bin/
|
||||
gen/
|
||||
*.tokens
|
||||
*.tokens
|
||||
|
||||
jenkins-jobs/docker/rhel_kafka/plugins
|
||||
jenkins-jobs/docker/artifact-server/plugins
|
||||
|
11
jenkins-jobs/docker/artifact-server/Dockerfile
Normal file
11
jenkins-jobs/docker/artifact-server/Dockerfile
Normal file
@ -0,0 +1,11 @@
|
||||
FROM svenstaro/miniserve:alpine
|
||||
|
||||
RUN apk add --no-cache bash
|
||||
|
||||
ADD ./plugins /opt/plugins
|
||||
ADD listing.sh /opt/
|
||||
|
||||
RUN chmod +x /opt/listing.sh
|
||||
RUN /opt/listing.sh -d /opt/plugins -o /opt/plugins/artifacts.txt
|
||||
|
||||
CMD ["/opt/plugins"]
|
28
jenkins-jobs/docker/artifact-server/listing.sh
Executable file
28
jenkins-jobs/docker/artifact-server/listing.sh
Executable file
@ -0,0 +1,28 @@
|
||||
#! /usr/bin/env bash
|
||||
|
||||
OPTS=$(getopt -o d:o: --long dir:,output: -n 'parse-options' -- "$@")
|
||||
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
|
||||
eval set -- "$OPTS"
|
||||
|
||||
OUTPUT="$(pwd)/artifacts.txt"
|
||||
while true; do
|
||||
case "$1" in
|
||||
-d | --dir ) DIR=$2; shift; shift ;;
|
||||
-o | --output ) OUTPUT=$2; shift; shift ;;
|
||||
-h | --help ) PRINT_HELP=true; shift ;;
|
||||
-- ) shift; break ;;
|
||||
* ) break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
shopt -s globstar nullglob
|
||||
pushd "$DIR" || exit
|
||||
rm -f "$OUTPUT"
|
||||
for file in **/*.{zip,jar}; do
|
||||
prefix=$(echo "$file" | sed -rn 's@^(.*)-([[:digit:]].*([[:digit:]]|Final|SNAPSHOT))(.*)(\..*)$@\1@p')
|
||||
suffix=$(echo "$file" | sed -rn 's@^(.*)-([[:digit:]].*([[:digit:]]|Final|SNAPSHOT))(.*)(\..*)$@\4@p')
|
||||
artifact="$prefix$suffix"
|
||||
echo "$artifact"
|
||||
echo "$artifact:$file" >> "$OUTPUT"
|
||||
done
|
||||
popd
|
Loading…
Reference in New Issue
Block a user