Elia el Lazkani
a26cdcf42e
All checks were successful
continuous-integration/drone/push Build is passing
70 lines
1.4 KiB
YAML
70 lines
1.4 KiB
YAML
---
|
|
kind: pipeline
|
|
name: container-check
|
|
|
|
steps:
|
|
- name: build-container
|
|
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
|
|
dry_run: false
|
|
squash: true
|
|
tags:
|
|
- "${DRONE_COMMIT_SHA:0:8}"
|
|
- "dev"
|
|
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:
|
|
- trivy image --image-src remote --username "$REGISTRY_USERNAME" --password "$REGISTRY_PASSWORD" --exit-code 0 "scm.project42.io/elia/nikola:${DRONE_COMMIT_SHA:0:8}"
|
|
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
|
|
when:
|
|
event:
|
|
- promote
|
|
target:
|
|
- production
|
|
|
|
depends_on:
|
|
- container-check
|
|
|
|
trigger:
|
|
event:
|
|
- promote
|
|
target:
|
|
- production
|