This commit is contained in:
parent
c83a77e925
commit
0abe0361ee
@ -1,4 +1,11 @@
|
||||
steps:
|
||||
- name: Generate config file
|
||||
image: bash
|
||||
environment:
|
||||
CONFIGJSON:
|
||||
from_secret: config_json
|
||||
commands:
|
||||
- ./generate.sh
|
||||
- name: build-container
|
||||
image: woodpeckerci/plugin-docker-buildx
|
||||
settings:
|
||||
|
@ -3,7 +3,7 @@ WORKDIR /srv
|
||||
COPY . .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
RUN pip install .
|
||||
RUN --mount=type=secret,id=config_json ./create_packs.sh
|
||||
RUN ./create_packs.sh
|
||||
|
||||
FROM nginx:alpine
|
||||
COPY --from=0 /srv/web /usr/share/nginx/html
|
||||
|
@ -1,15 +1,9 @@
|
||||
#!/bin/bash
|
||||
echo "$PLUGIN_CONFIGJSON" >> config.json
|
||||
|
||||
if [ ! -s config.json ]; then
|
||||
echo "no config found"
|
||||
if [ ! -f config.json ]; then
|
||||
echo "no config found during sitcker generation"
|
||||
exit 1
|
||||
fi
|
||||
if [[ -z $(grep '[^[:space:]]' "config.json") ]] ; then
|
||||
echo "no config in file"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for d in packs/*/ ; do
|
||||
sticker-pack "$d" --add-to-index web/packs/
|
||||
done
|
||||
rm config.json
|
||||
|
15
generate.sh
Executable file
15
generate.sh
Executable file
@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
touch config.json
|
||||
cat >./config.json <<EOF
|
||||
$CONFIGJSON
|
||||
EOF
|
||||
if [ ! -s config.json ]; then
|
||||
echo "no config found"
|
||||
exit 1
|
||||
fi
|
||||
if [[ -z $(grep '[^[:space:]]' "config.json") ]] ; then
|
||||
echo "no config in file"
|
||||
rm config.json
|
||||
exit 1
|
||||
fi
|
Loading…
Reference in New Issue
Block a user