Compare commits

..

No commits in common. "master" and "v1.2.0" have entirely different histories.

4 changed files with 202 additions and 45 deletions

View File

@ -1,28 +1,173 @@
kind: pipeline kind: pipeline
name: default
type: docker type: docker
name: default
steps: steps:
- name: build - name: build
image: golang:alpine image: golang
commands: commands:
- go test ./... - go test ./...
- sh scripts/build.sh - sh scripts/build.sh
- name: docker - name: docker
image: plugins/docker image: plugins/docker
settings: settings:
repo: cr.smcm.xyz/drone-plugins/buildah repo: plugins/buildah-docker
tags: auto_tag: true
- latest auto_tag_suffix: linux-amd64
- ${DRONE_COMMIT_SHA} daemon_off: false
daemon_off: true
dockerfile: docker/docker/Dockerfile.linux.amd64 dockerfile: docker/docker/Dockerfile.linux.amd64
cache_from: cr.smcm.xyz/drone-plugins/buildah username:
from_secret: docker_username
password:
from_secret: docker_password
when:
event:
exclude:
- pull_request
- name: gcr
image: plugins/docker
settings:
repo: plugins/buildah-gcr
auto_tag: true
auto_tag_suffix: linux-amd64
daemon_off: false
dockerfile: docker/gcr/Dockerfile.linux.amd64
username:
from_secret: docker_username
password:
from_secret: docker_password
when:
event:
exclude:
- pull_request
- name: ecr
image: plugins/docker
settings:
repo: plugins/buildah-ecr
auto_tag: true
auto_tag_suffix: linux-amd64
daemon_off: false
dockerfile: docker/ecr/Dockerfile.linux.amd64
username:
from_secret: docker_username
password:
from_secret: docker_password
when:
event:
exclude:
- pull_request
- name: acr
image: plugins/docker
settings:
repo: plugins/buildah-acr
auto_tag: true
auto_tag_suffix: linux-amd64
daemon_off: false
dockerfile: docker/acr/Dockerfile.linux.amd64
username:
from_secret: docker_username
password:
from_secret: docker_password
when:
event:
exclude:
- pull_request
- name: heroku
image: plugins/docker
settings:
repo: plugins/buildah-heroku
auto_tag: true
auto_tag_suffix: linux-amd64
daemon_off: false
dockerfile: docker/heroku/Dockerfile.linux.amd64
username:
from_secret: docker_username
password:
from_secret: docker_password
when:
event:
exclude:
- pull_request
---
kind: pipeline
type: docker
name: notifications-docker
platform:
os: linux
arch: amd64
steps:
- name: manifest-docker
pull: always
image: plugins/manifest
settings:
auto_tag: true
ignore_missing: true
password:
from_secret: docker_password
spec: docker/docker/manifest.tmpl
username:
from_secret: docker_username
- name: manifest-gcr
pull: always
image: plugins/manifest
settings:
auto_tag: true
ignore_missing: true
password:
from_secret: docker_password
spec: docker/gcr/manifest.tmpl
username:
from_secret: docker_username
- name: manifest-ecr
pull: always
image: plugins/manifest
settings:
auto_tag: true
ignore_missing: true
password:
from_secret: docker_password
spec: docker/ecr/manifest.tmpl
username:
from_secret: docker_username
- name: manifest-acr
pull: always
image: plugins/manifest
settings:
auto_tag: true
ignore_missing: true
password:
from_secret: docker_password
spec: docker/acr/manifest.tmpl
username:
from_secret: docker_username
- name: manifest-heroku
pull: always
image: plugins/manifest
settings:
auto_tag: true
ignore_missing: true
password:
from_secret: docker_password
spec: docker/heroku/manifest.tmpl
username:
from_secret: docker_username
trigger: trigger:
branch: master ref:
event: - refs/heads/master
- push - "refs/tags/**"
- custom
- cron depends_on:
- default

View File

@ -8,7 +8,7 @@
[![Go Doc](https://godoc.org/github.com/drone-plugins/drone-buildah?status.svg)](http://godoc.org/github.com/drone-plugins/drone-buildah) [![Go Doc](https://godoc.org/github.com/drone-plugins/drone-buildah?status.svg)](http://godoc.org/github.com/drone-plugins/drone-buildah)
[![Go Report](https://goreportcard.com/badge/github.com/drone-plugins/drone-buildah)](https://goreportcard.com/report/github.com/drone-plugins/drone-buildah) [![Go Report](https://goreportcard.com/badge/github.com/drone-plugins/drone-buildah)](https://goreportcard.com/report/github.com/drone-plugins/drone-buildah)
Drone plugin uses buildah to build and publish Docker images to a container registry. For the usage information and a listing of the available options please take a look at [the docs](https://plugins.drone.io/plugins/buildah). Drone plugin uses buildah to build and publish Docker images to a container registry. For the usage information and a listing of the available options please take a look at [the docs](http://plugins.drone.io/drone-plugins/drone-buildah/).
## Build ## Build

View File

@ -1,28 +1,40 @@
FROM alpine:3.18 FROM fedora
RUN addgroup \ RUN dnf -y install \
-g 1000 \ make \
build golang \
bats \
btrfs-progs-devel \
device-mapper-devel \
glib2-devel \
gpgme-devel \
libassuan-devel \
libseccomp-devel \
git \
bzip2 \
go-md2man \
runc \
containers-common \
skopeo-containers
RUN adduser \ # Workaround - the first install somehow leaves the golang in a bad state
-h /home/build \ RUN dnf -y install golang
-s /bin/sh \
-u 1000 \
-G build \
-D \
build
RUN echo -e "build:1:999\nbuild:1001:64535" > /etc/subuid && \ RUN mkdir /root/buildah && \
echo -e "build:1:999\nbuild:1001:64535" > /etc/subgid && \ cd /root/buildah && \
mkdir -p /home/build/.local/share/containers && \ git clone https://github.com/harness/buildah.git ./src/github.com/containers/buildah
mkdir -p /home/build/.config/containers && \
chown -R build:build /home/build
RUN apk add --no-cache buildah RUN cd /root/buildah/src/github.com/containers/buildah && make && sudo make install
ADD release/linux/amd64/drone-docker /bin/
ENV STORAGE_DRIVER vfs
FROM quay.io/buildah/stable:v1.23.0
USER build USER build
WORKDIR /home/build WORKDIR /home/build
RUN export STORAGE_DRIVER=vfs
# Add plugin binary
ADD release/linux/amd64/drone-docker /bin/
COPY --from=0 /root/buildah/src/github.com/containers/buildah/bin/. /bin/
ENTRYPOINT ["/bin/drone-docker"] ENTRYPOINT ["/bin/drone-docker"]

View File

@ -10,8 +10,8 @@ set -e
set -x set -x
# linux # linux
# GOOS=linux GOARCH=amd64 go build -o release/linux/amd64/drone-gcr ./cmd/drone-gcr GOOS=linux GOARCH=amd64 go build -o release/linux/amd64/drone-gcr ./cmd/drone-gcr
# GOOS=linux GOARCH=amd64 go build -o release/linux/amd64/drone-ecr ./cmd/drone-ecr GOOS=linux GOARCH=amd64 go build -o release/linux/amd64/drone-ecr ./cmd/drone-ecr
GOOS=linux GOARCH=amd64 go build -o release/linux/amd64/drone-docker ./cmd/drone-docker GOOS=linux GOARCH=amd64 go build -o release/linux/amd64/drone-docker ./cmd/drone-docker
# GOOS=linux GOARCH=amd64 go build -o release/linux/amd64/drone-acr ./cmd/drone-acr GOOS=linux GOARCH=amd64 go build -o release/linux/amd64/drone-acr ./cmd/drone-acr
# GOOS=linux GOARCH=amd64 go build -o release/linux/amd64/drone-heroku ./cmd/drone-heroku GOOS=linux GOARCH=amd64 go build -o release/linux/amd64/drone-heroku ./cmd/drone-heroku