2020-02-17 22:06:25 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
2023-07-01 18:12:18 +00:00
|
|
|
name: container-check
|
2020-02-17 22:06:25 +00:00
|
|
|
|
|
|
|
steps:
|
2023-07-05 22:16:08 +00:00
|
|
|
- name: build-container
|
2023-07-01 18:12:18 +00:00
|
|
|
image: plugins/docker
|
|
|
|
settings:
|
|
|
|
registry: scm.project42.io
|
|
|
|
dockerfile: Dockerfile
|
|
|
|
username:
|
|
|
|
from_secret: registry_username
|
|
|
|
password:
|
|
|
|
from_secret: registry_password
|
|
|
|
repo: scm.project42.io/elia/nikola
|
2023-07-01 18:15:20 +00:00
|
|
|
dry_run: false
|
2023-07-01 18:12:18 +00:00
|
|
|
squash: true
|
|
|
|
tags:
|
|
|
|
- "${DRONE_COMMIT_SHA:0:8}"
|
2024-01-14 21:54:00 +00:00
|
|
|
- "dev"
|
2023-07-05 22:16:08 +00:00
|
|
|
when:
|
|
|
|
event:
|
|
|
|
exclude:
|
|
|
|
- promote
|
|
|
|
|
|
|
|
- name: trivy-scan
|
|
|
|
image: scm.project42.io/elia/tricks:latest
|
|
|
|
environment:
|
|
|
|
REGISTRY_USERNAME:
|
|
|
|
from_secret: registry_username
|
|
|
|
REGISTRY_PASSWORD:
|
|
|
|
from_secret: registry_password
|
|
|
|
commands:
|
2024-01-20 12:41:23 +00:00
|
|
|
- trivy image --image-src remote --username "$REGISTRY_USERNAME" --password "$REGISTRY_PASSWORD" --exit-code 0 "scm.project42.io/elia/nikola:${DRONE_COMMIT_SHA:0:8}"
|
2023-07-05 22:16:08 +00:00
|
|
|
depends_on:
|
|
|
|
- build-container
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
exclude:
|
|
|
|
event:
|
|
|
|
- promote
|
|
|
|
|
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
name: promote-to-production
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: promote-container
|
|
|
|
image: scm.project42.io/elia/tricks:latest
|
|
|
|
environment:
|
|
|
|
REGISTRY_USERNAME:
|
|
|
|
from_secret: registry_username
|
|
|
|
REGISTRY_PASSWORD:
|
|
|
|
from_secret: registry_password
|
|
|
|
commands:
|
|
|
|
- oras tag --username "$REGISTRY_USERNAME" --password "$REGISTRY_PASSWORD" "scm.project42.io/elia/nikola:${DRONE_COMMIT_SHA:0:8}" latest
|
2020-02-17 22:06:25 +00:00
|
|
|
when:
|
|
|
|
event:
|
2023-07-01 18:12:18 +00:00
|
|
|
- promote
|
|
|
|
target:
|
|
|
|
- production
|
|
|
|
|
|
|
|
depends_on:
|
|
|
|
- container-check
|
2020-02-17 22:06:25 +00:00
|
|
|
|
|
|
|
trigger:
|
|
|
|
event:
|
2023-07-01 18:12:18 +00:00
|
|
|
- promote
|
|
|
|
target:
|
|
|
|
- production
|