allzweckcontainer/.drone.yml

44 lines
1.4 KiB
YAML
Raw Normal View History

2022-08-06 11:07:52 +02:00
---
kind: pipeline
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:
2023-04-20 12:34:28 +02:00
DOCKER_USERNAME:
2023-04-20 11:55:29 +02:00
from_secret: OCI_REGISTRY_USER
2023-04-20 12:34:28 +02:00
DOCKER_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 .
2023-04-20 12:32:24 +02:00
#- 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}
2023-04-20 12:34:28 +02:00
- docker login registry.mgrote.net
2023-04-20 12:21:14 +02:00
- docker push registry.mgrote.net/allzweckcontainer:latest
2023-04-20 12:32:24 +02:00
# - 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