Skip to content

Commit

Permalink
ci: migrate container build to buildx (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
xoxys authored Nov 3, 2023
1 parent 8d7a684 commit 3c84179
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 21 deletions.
43 changes: 23 additions & 20 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,37 @@
---
kind: pipeline
type: docker
name: container

platform:
os: linux
arch: amd64

steps:
- name: tags
image: quay.io/thegeeklab/docker-autotag
environment:
DOCKER_AUTOTAG_FORCE_LATEST: True
DOCKER_AUTOTAG_IGNORE_PRERELEASE: True
DOCKER_AUTOTAG_OUTPUT_FILE: .tags
DOCKER_AUTOTAG_VERSION: ${DRONE_TAG}

- name: dryrun
image: docker.io/plugins/docker
- name: security-build
image: docker.io/owncloudci/drone-docker-buildx:1
settings:
build_args:
- ELASTICSEARCH_PLUGINS=repository-s3 ingest-attachment
dockerfile: Dockerfile
dry_run: true
output: type=oci,dest=oci/${DRONE_REPO_NAME},tar=false
repo: owncloudops/${DRONE_REPO_NAME}
when:
ref:
- refs/pull/**

- name: security-scan
image: ghcr.io/aquasecurity/trivy
commands:
- trivy -v
- trivy image --input oci/${DRONE_REPO_NAME}
environment:
TRIVY_EXIT_CODE: 1
TRIVY_IGNORE_UNFIXED: True
TRIVY_NO_PROGRESS: True
TRIVY_SEVERITY: HIGH,CRITICAL
TRIVY_TIMEOUT: 1m
TRIVY_SKIP_FILES: /usr/local/bin/gomplate
TRIVY_SKIP_DIRS: /usr/share/elasticsearch
depends_on:
- tags
- security-build

- name: changelog
image: quay.io/thegeeklab/git-chglog
Expand All @@ -36,10 +40,10 @@ steps:
- git-chglog --no-color --no-emoji ${DRONE_TAG:---next-tag unreleased unreleased}
- git-chglog --no-color --no-emoji -o CHANGELOG.md ${DRONE_TAG:---next-tag unreleased unreleased}
depends_on:
- dryrun
- security-scan

- name: publish-dockerhub
image: docker.io/plugins/docker
image: docker.io/owncloudci/drone-docker-buildx:1
settings:
build_args:
- ELASTICSEARCH_PLUGINS=repository-s3 ingest-attachment
Expand All @@ -57,7 +61,7 @@ steps:
- changelog

- name: publish-quay
image: docker.io/plugins/docker
image: docker.io/owncloudci/drone-docker-buildx:1
settings:
build_args:
- ELASTICSEARCH_PLUGINS=repository-s3 ingest-attachment
Expand Down Expand Up @@ -98,6 +102,7 @@ trigger:

---
kind: pipeline
type: docker
name: notifications

platform:
Expand Down Expand Up @@ -150,5 +155,3 @@ trigger:

depends_on:
- container

...
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.drone.yml
*.tpl.md
LICENSE

0 comments on commit 3c84179

Please sign in to comment.