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:
|
commands:
|
||||||
- echo $COSIGN_KEY > ./cosign.key
|
- echo $COSIGN_KEY > ./cosign.key
|
||||||
|
|
||||||
check-cosign-key:
|
sign-next:
|
||||||
image: alpine
|
image: registry.mareshq.com/woodpecker-plugins/cosign-sign:next
|
||||||
commands:
|
settings:
|
||||||
- ls
|
image: registry.mareshq.com/woodpecker-plugins/cosign-sign:next
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
FROM alpine:3.22
|
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
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,12 +18,14 @@ steps:
|
||||||
prettier:
|
prettier:
|
||||||
image: registry.mareshq.com/woodpecker-plugins/cosign-sign
|
image: registry.mareshq.com/woodpecker-plugins/cosign-sign
|
||||||
settings:
|
settings:
|
||||||
image: registry.example.com/app:latest
|
images:
|
||||||
|
- registry.example.com/app:latest
|
||||||
|
- registry.example.com/app:v1
|
||||||
```
|
```
|
||||||
|
|
||||||
## Settings
|
## Settings
|
||||||
|
|
||||||
| Settings Name | Type | Default | Description |
|
| 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 |
|
| `key_path` | string | `./cosign.key` | Path to signing key |
|
||||||
|
|
@ -1,8 +1,10 @@
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
|
|
||||||
if [ -z ${PLUGIN_IMAGE+x} ]; then
|
if [ -z ${PLUGIN_IMAGES+x} ]; then
|
||||||
echo "ERROR: image setting is required."
|
echo "ERROR: images setting is required."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
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