Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
alpine
infra
docker
secdb
Commits
59fd3d46
Commit
59fd3d46
authored
Apr 26, 2021
by
Kevin Daudt
💻
Browse files
docker: switch to go secdb implementation
Build the go secdb application and adopt generate_secdb.sh to run it.
parent
83c37f5c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Dockerfile
View file @
59fd3d46
FROM
alpinelinux/
mqtt-exec
FROM
alpinelinux/
golang as build
ENV
NQDIR=/tmp
COPY
--chown=build:build src /home/build/src
WORKDIR
/home/build/src
RUN
go build
-v
secdb
RUN
apk
--no-cache
add lua5.3 lua5.3-lyaml lua5.3-optarg lua5.3-cjson nq git
FROM
alpinelinux/mqtt-exec
RUN
apk
--no-cache
add nq git
COPY
--from=build /home/build/src/secdb /usr/local/bin/secdb
COPY
scripts /usr/local/bin
ENV
NQDIR=/tmp
CMD
[ "/usr/bin/nq", "-c", "generate_secdb.sh" ]
scripts/generate_secdb.sh
View file @
59fd3d46
...
...
@@ -6,7 +6,8 @@ REPOS="main community"
BRANCH
=
${
1
##*/
}
case
$BRANCH
in
master|commits
)
exit
0
;;
commits
)
exit
0
;;
master
)
RELEASE
=
edge
;;
*
-stable
)
RELEASE
=
v
${
BRANCH
/-stable/
}
;;
*
)
echo
"unknown branch:
\"
$BRANCH
\"
"
;
exit
1
;;
esac
...
...
@@ -26,15 +27,17 @@ for REPO in $REPOS; do
fi
echo
"Generating secdb for
$RELEASE
/
$REPO
"
TMPFILE
=
$(
mktemp
)
sec
fixes.lua
\
sec
db
\
--repo
"
$REPO
"
--release
"
$RELEASE
"
\
"
$HOME
"
/aports/
"
$REPO
"
/
*
/APKBUILD
>
"
$TMPFILE
"
if
cmp
-s
"
$TMPFILE
"
/var/www/html/
"
$RELEASE
"
/
"
$REPO
"
.yaml
;
then
-outYaml
"
$TMPFILE
"
.yaml
\
-outJson
"
$TMPFILE
"
.json
\
"
$HOME
"
/aports/
"
$REPO
"
/
*
/APKBUILD
if
cmp
-s
"
$TMPFILE
"
.yaml /var/www/html/
"
$RELEASE
"
/
"
$REPO
"
.yaml
;
then
echo
"No changes found yml secfixes, skipping."
else
secfixes.lua
--verify
"
$TMPFILE
"
install
-D
"
$TMPFILE
"
/var/www/html/
"
$RELEASE
"
/
"
$REPO
"
.yaml
yaml2json.lua
"
$TMPFILE
"
>
/var/www/html/
"
$RELEASE
"
/
"
$REPO
"
.js
on
for
ext
in
yaml json
;
do
install
-D
"
$TMPFILE
.
$ext
"
/var/www/html/
"
$RELEASE
/
$REPO
.
$ext
"
d
on
e
fi
rm
-f
"
$TMPFILE
"
rm
-f
"
$TMPFILE
.yaml"
"
$TMPFILE
.json
"
done
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment