89 lines
2.4 KiB
YAML
Raw Normal View History

2024-04-22 14:28:38 +02:00
variables:
- &file Containerfile
2024-09-12 13:43:21 +02:00
- &repo dev.shielddagger.com/opensource/discord-notifier
2024-04-22 14:28:38 +02:00
when:
- event: [push, pull_request]
steps:
- name: configure
when:
- event: push
branch: main
image: alpine:latest
commands:
- echo ${CI_COMMIT_SHA:0:8} > .version
- name: dryrun
image: woodpeckerci/plugin-docker-buildx
backend_options:
kubernetes:
securityContext:
privileged: true
settings:
dockerfile: *file
platforms: linux/arm64,linux/amd64
2024-09-12 13:43:21 +02:00
cache_from: type=registry,ref=dev.shielddagger.com/opensource/discord-notifier
2024-04-22 14:28:38 +02:00
cache_to: type=inline
dry_run: true
repo: *repo
tags: latest
registry: dev.shielddagger.com
username:
from_secret: registry_username
password:
from_secret: registry_password
when:
- event: pull_request
- name: publish
image: woodpeckerci/plugin-docker-buildx
backend_options:
kubernetes:
securityContext:
privileged: true
settings:
dockerfile: *file
platforms: linux/arm64,linux/amd64
2024-09-12 13:43:21 +02:00
cache_from: type=registry,ref=dev.shielddagger.com/opensource/discord-notifier
2024-04-22 14:28:38 +02:00
cache_to: type=inline
repo: *repo
auto_tag: true
tags: ${CI_COMMIT_SHA:0:8}
registry: dev.shielddagger.com
username:
from_secret: registry_username
password:
from_secret: registry_password
when:
- event: push
branch: main
- name: image-scan
image: aquasec/trivy
environment:
TRIVY_USER:
from_secret: registry_username
TRIVY_PASSWORD:
from_secret: registry_password
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db
TRIVY_JAVA_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-java-db
TRIVY_CHECKS_BUNDLE_REPOSITORY: public.ecr.aws/aquasecurity/trivy-checks
2024-04-22 14:28:38 +02:00
commands:
2024-09-12 14:24:46 +02:00
- trivy image dev.shielddagger.com/opensource/discord-notifier:latest --exit-code 1 --username $TRIVY_USER --severity HIGH,CRITICAL
2024-04-22 14:28:38 +02:00
when:
- event: push
branch: main
- name: notify
2024-09-12 13:43:21 +02:00
image: dev.shielddagger.com/opensource/discord-notifier
2024-04-22 14:28:38 +02:00
failure: ignore
settings:
webhook_url:
from_secret: discord_webhook
2024-04-24 14:03:38 +02:00
woodpecker_url: https://ci.shielddagger.com/api
2024-04-22 14:28:38 +02:00
woodpecker_token:
from_secret: woodpecker_token
2024-09-12 11:13:44 +02:00
icon_url: https://discord.com/api/webhooks/1231848304694919270/1ApQzOPMfNosxhQ62HbYScBT5s94m0bIUn1IFGQlT6d8Ru2ImcHHjjkFA_SaonBNU3yz
2024-04-22 15:36:49 +02:00
when:
- status: [success, failure]
2024-04-22 14:28:38 +02:00
depends_on:
- scans