2022-08-06 11:07:52 +02:00
|
|
|
---
|
|
|
|
kind: pipeline
|
2023-03-21 17:48:29 +01:00
|
|
|
type: docker
|
2022-08-06 11:07:52 +02:00
|
|
|
name: default
|
|
|
|
steps:
|
2022-08-06 20:22:13 +02:00
|
|
|
# prüfe ob secrets im Repo sind
|
2022-08-06 11:07:52 +02:00
|
|
|
- name: run gitleaks
|
|
|
|
image: plugins/gitleaks
|
|
|
|
settings:
|
|
|
|
path: .
|
2022-08-06 20:22:13 +02:00
|
|
|
|
|
|
|
# linter für Dockerfiles
|
2022-08-06 11:07:52 +02:00
|
|
|
# https://github.com/hadolint/hadolint/blob/master/docs/INTEGRATION.md
|
|
|
|
- name: hadolint
|
|
|
|
image: hadolint/hadolint:latest-debian
|
|
|
|
# image: ghcr.io/hadolint/hadolint:latest-debian
|
|
|
|
commands:
|
|
|
|
- hadolint --version
|
|
|
|
- hadolint Dockerfile
|
2022-08-06 20:22:13 +02:00
|
|
|
|
2023-04-20 12:21:14 +02:00
|
|
|
- name: container
|
2023-04-20 12:28:18 +02:00
|
|
|
image: docker:dind
|
2023-04-20 12:21:14 +02:00
|
|
|
environment:
|
2022-08-06 20:22:13 +02:00
|
|
|
username:
|
2023-04-20 11:55:29 +02:00
|
|
|
from_secret: OCI_REGISTRY_USER
|
2022-08-06 11:07:52 +02:00
|
|
|
password:
|
2023-04-20 11:55:29 +02:00
|
|
|
from_secret: OCI_REGISTRY_PASS
|
2023-04-20 12:21:14 +02:00
|
|
|
commands:
|
|
|
|
- docker build -t registry.mgrote.net/allzweckcontainer:latest .
|
|
|
|
- docker tag registry.mgrote.net/allzweckcontainer:latest registry.mgrote.net/allzweckcontainer:${DRONE_COMMIT_SHA:0:8}
|
|
|
|
- docker tag registry.mgrote.net/allzweckcontainer:latest registry.mgrote.net/allzweckcontainer:${DRONE_COMMIT_BRANCH}
|
|
|
|
- docker login --username $username --password $password registry.mgrote.net
|
|
|
|
- docker push registry.mgrote.net/allzweckcontainer:latest
|
|
|
|
- docker push registry.mgrote.net/allzweckcontainer:${DRONE_COMMIT_SHA:0:8}
|
|
|
|
- docker push registry.mgrote.net/allzweckcontainer:${DRONE_COMMIT_BRANCH}
|
2023-04-20 12:26:01 +02:00
|
|
|
volumes:
|
2023-04-20 12:28:18 +02:00
|
|
|
- name: dockersock
|
|
|
|
path: /var/run/docker.sock
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
- name: dockersock
|
|
|
|
host:
|
|
|
|
path: /var/run/docker.sock
|