give up on secrets
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
stryan 2024-09-04 22:25:48 -04:00
parent c83a77e925
commit 0abe0361ee
4 changed files with 26 additions and 10 deletions

View File

@ -1,4 +1,11 @@
steps: steps:
- name: Generate config file
image: bash
environment:
CONFIGJSON:
from_secret: config_json
commands:
- ./generate.sh
- name: build-container - name: build-container
image: woodpeckerci/plugin-docker-buildx image: woodpeckerci/plugin-docker-buildx
settings: settings:

View File

@ -3,7 +3,7 @@ WORKDIR /srv
COPY . . COPY . .
RUN pip install --no-cache-dir -r requirements.txt RUN pip install --no-cache-dir -r requirements.txt
RUN pip install . RUN pip install .
RUN --mount=type=secret,id=config_json ./create_packs.sh RUN ./create_packs.sh
FROM nginx:alpine FROM nginx:alpine
COPY --from=0 /srv/web /usr/share/nginx/html COPY --from=0 /srv/web /usr/share/nginx/html

View File

@ -1,15 +1,9 @@
#!/bin/bash #!/bin/bash
echo "$PLUGIN_CONFIGJSON" >> config.json if [ ! -f config.json ]; then
echo "no config found during sitcker generation"
if [ ! -s config.json ]; then
echo "no config found"
exit 1 exit 1
fi fi
if [[ -z $(grep '[^[:space:]]' "config.json") ]] ; then
echo "no config in file"
exit 1
fi
for d in packs/*/ ; do for d in packs/*/ ; do
sticker-pack "$d" --add-to-index web/packs/ sticker-pack "$d" --add-to-index web/packs/
done done
rm config.json

15
generate.sh Executable file
View 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