Compare commits

..

No commits in common. "6d2e7d3b924e7ac566094ff1df81b46c24d2adb4" and "abcc6988a43f2eefdfdabefb560fd8072e5af5f3" have entirely different histories.

4 changed files with 7 additions and 75 deletions

View file

@ -1,25 +0,0 @@
matrix:
PLATFORM:
- linux/amd64
- linux/arm64
labels:
platform: linux/amd64
steps:
build:
image: woodpeckerci/plugin-docker-buildx:2.3.0
group: build
settings:
registry: rg.fr-par.scw.cloud/hamburghammer
username: nologin
password:
from_secret: docker_token
dockerfile: Dockerfile
target: setup-image
repo: rg.fr-par.scw.cloud/hamburghammer/scaleway-delete-image-plugin/plugin
tags: latest
pull_image: true
platforms: ${PLATFORM}
when:
- branch: main

View file

@ -1,13 +0,0 @@
FROM docker.io/golang:1.21.5 AS build
WORKDIR /src
# create a cache
COPY go.* /src/
RUN go mod download
# compile
COPY * /src/
RUN CGO_ENABLED=0 go build -o /scaleway-delete-image-plugin .
FROM alpine:3.19
RUN apk -Uuv add curl ca-certificates
COPY --from=build /src/scaleway-delete-image-plugin /scaleway-delete-image-plugin
ENTRYPOINT /scaleway-delete-image-plugin

View file

@ -1,29 +0,0 @@
# Scaleway-Delete-Image-Plugin
Is a plugin for Woodpecker CI to delete an image tag from the Scaleway container
registry.
## Usage
```yaml
delete-tag:
image: rg.fr-par.scw.cloud/hamburghammer/scaleway-delete-image-plugin/plugin
secrets: [token]
settings:
token:
from_secret: scaleway_token
image-name: foo/bar
tag: latest
region: fr-par
```
## Configuration
Required options:
| Name | Description |
| ---------- | --------------------------------------- |
| token | Token for the Scaleway API |
| image-name | The image which should be deleted |
| tag | The tag that should be deleted |
| region | The Scaleway region the registry exists |

15
main.go
View file

@ -27,26 +27,25 @@ type Plugin struct {
func (p *Plugin) Flags() []cli.Flag {
return []cli.Flag{
&cli.StringFlag{
Name: "token",
Usage: "Token for the Scaleway API",
Name: "Scaleway API token",
EnvVars: []string{"PLUGIN_TOKEN"},
Destination: &p.Settings.Token,
},
&cli.StringFlag{
Name: "image-name",
Usage: "The image from which the tag should be deleted",
Name: "The image name to be deleted",
Usage: "hamburghammer/dchat/setup-image",
EnvVars: []string{"PLUGIN_IMAGE_NAME"},
Destination: &p.Settings.ImageName,
},
&cli.StringFlag{
Name: "tag",
Usage: "The tag that should be deleted",
Name: "Tag of the image",
Usage: "hamburghammer/dchat/setup-image",
EnvVars: []string{"PLUGIN_IMAGE_NAME"},
Destination: &p.Settings.Tag,
},
&cli.StringFlag{
Name: "region",
Usage: "The Scaleway region the registry exists",
Name: "The Scaleway region from the registry",
Usage: "fr-par",
EnvVars: []string{"PLUGIN_REGION"},
Destination: &p.Settings.Region,
},