diff --git a/.woodpecker.yaml b/.woodpecker.yaml index 60178e7..ef2ef38 100644 --- a/.woodpecker.yaml +++ b/.woodpecker.yaml @@ -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: diff --git a/Containerfile b/Containerfile index 8e39011..ae1f2c6 100644 --- a/Containerfile +++ b/Containerfile @@ -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 diff --git a/create_packs.sh b/create_packs.sh index a67483e..7fea103 100755 --- a/create_packs.sh +++ b/create_packs.sh @@ -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 diff --git a/generate.sh b/generate.sh new file mode 100755 index 0000000..5812bdf --- /dev/null +++ b/generate.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +touch config.json +cat >./config.json <