generated from woodpecker-plugins/.plugin-template
refactor: sign multiple images instead of only one
Some checks failed
ci/woodpecker/push/release Pipeline failed
Some checks failed
ci/woodpecker/push/release Pipeline failed
Signed-off-by: Vojtěch Mareš <vojtech@mares.cz>
This commit is contained in:
parent
0b5f53fe41
commit
a93217ce90
4 changed files with 14 additions and 10 deletions
|
|
@ -51,7 +51,7 @@ steps:
|
|||
commands:
|
||||
- echo $COSIGN_KEY > ./cosign.key
|
||||
|
||||
check-cosign-key:
|
||||
image: alpine
|
||||
commands:
|
||||
- ls
|
||||
sign-next:
|
||||
image: registry.mareshq.com/woodpecker-plugins/cosign-sign:next
|
||||
settings:
|
||||
image: registry.mareshq.com/woodpecker-plugins/cosign-sign:next
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
FROM alpine:3.22
|
||||
|
||||
RUN apk add --no-cache ca-certificates cosign
|
||||
RUN apk add --no-cache ca-certificates cosign jq
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
|
||||
|
|
|
|||
|
|
@ -18,12 +18,14 @@ steps:
|
|||
prettier:
|
||||
image: registry.mareshq.com/woodpecker-plugins/cosign-sign
|
||||
settings:
|
||||
image: registry.example.com/app:latest
|
||||
images:
|
||||
- registry.example.com/app:latest
|
||||
- registry.example.com/app:v1
|
||||
```
|
||||
|
||||
## Settings
|
||||
|
||||
| Settings Name | Type | Default | Description |
|
||||
| ------------- | ------- | ------- | --------------------------------------------------------------------------- |
|
||||
| `image` | string | empty | Image name including tag. |
|
||||
| `images` | string | empty | List of image names including tag. |
|
||||
| `key_path` | string | `./cosign.key` | Path to signing key |
|
||||
|
|
@ -1,8 +1,10 @@
|
|||
#! /bin/sh
|
||||
|
||||
if [ -z ${PLUGIN_IMAGE+x} ]; then
|
||||
echo "ERROR: image setting is required."
|
||||
if [ -z ${PLUGIN_IMAGES+x} ]; then
|
||||
echo "ERROR: images setting is required."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cosign sign --key "${PLUGIN_KEY_PATH:-"./cosign.key"}" "${PLUGIN_IMAGE}"
|
||||
echo "${PLUGIN_IMAGES}" | jq '.[]' | while read -r image; do
|
||||
cosign sign --key "${PLUGIN_KEY_PATH:-"./cosign.key"}" "${image}"
|
||||
done
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue