Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3f9f65c60e | |||
| fcdfc4e202 | |||
| 508df82452 | |||
|
|
018dd9ef61 | ||
|
|
a6e0171dd5 | ||
|
|
8ad8465153 |
185
.drone.yml
185
.drone.yml
@ -1,173 +1,28 @@
|
|||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: docker
|
|
||||||
name: default
|
name: default
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: build
|
|
||||||
image: golang
|
|
||||||
commands:
|
|
||||||
- go test ./...
|
|
||||||
- sh scripts/build.sh
|
|
||||||
|
|
||||||
- name: docker
|
|
||||||
image: plugins/docker
|
|
||||||
settings:
|
|
||||||
repo: plugins/buildah-docker
|
|
||||||
auto_tag: true
|
|
||||||
auto_tag_suffix: linux-amd64
|
|
||||||
daemon_off: false
|
|
||||||
dockerfile: docker/docker/Dockerfile.linux.amd64
|
|
||||||
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
|
type: docker
|
||||||
name: notifications-docker
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: amd64
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: manifest-docker
|
- name: build
|
||||||
pull: always
|
image: golang:alpine
|
||||||
image: plugins/manifest
|
commands:
|
||||||
settings:
|
- go test ./...
|
||||||
auto_tag: true
|
- sh scripts/build.sh
|
||||||
ignore_missing: true
|
|
||||||
password:
|
|
||||||
from_secret: docker_password
|
|
||||||
spec: docker/docker/manifest.tmpl
|
|
||||||
username:
|
|
||||||
from_secret: docker_username
|
|
||||||
|
|
||||||
- name: manifest-gcr
|
- name: docker
|
||||||
pull: always
|
image: plugins/docker
|
||||||
image: plugins/manifest
|
settings:
|
||||||
settings:
|
repo: cr.smcm.xyz/drone-plugins/buildah
|
||||||
auto_tag: true
|
tags:
|
||||||
ignore_missing: true
|
- latest
|
||||||
password:
|
- ${DRONE_COMMIT_SHA}
|
||||||
from_secret: docker_password
|
daemon_off: true
|
||||||
spec: docker/gcr/manifest.tmpl
|
dockerfile: docker/docker/Dockerfile.linux.amd64
|
||||||
username:
|
cache_from: cr.smcm.xyz/drone-plugins/buildah
|
||||||
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:
|
||||||
ref:
|
branch: master
|
||||||
- refs/heads/master
|
event:
|
||||||
- "refs/tags/**"
|
- push
|
||||||
|
- custom
|
||||||
depends_on:
|
- cron
|
||||||
- default
|
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
[](http://godoc.org/github.com/drone-plugins/drone-buildah)
|
[](http://godoc.org/github.com/drone-plugins/drone-buildah)
|
||||||
[](https://goreportcard.com/report/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](http://plugins.drone.io/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).
|
||||||
|
|
||||||
## Build
|
## Build
|
||||||
|
|
||||||
|
|||||||
@ -1,40 +1,28 @@
|
|||||||
FROM fedora
|
FROM alpine:3.18
|
||||||
|
|
||||||
RUN dnf -y install \
|
RUN addgroup \
|
||||||
make \
|
-g 1000 \
|
||||||
golang \
|
build
|
||||||
bats \
|
|
||||||
btrfs-progs-devel \
|
|
||||||
device-mapper-devel \
|
|
||||||
glib2-devel \
|
|
||||||
gpgme-devel \
|
|
||||||
libassuan-devel \
|
|
||||||
libseccomp-devel \
|
|
||||||
git \
|
|
||||||
bzip2 \
|
|
||||||
go-md2man \
|
|
||||||
runc \
|
|
||||||
containers-common \
|
|
||||||
skopeo-containers
|
|
||||||
|
|
||||||
# Workaround - the first install somehow leaves the golang in a bad state
|
RUN adduser \
|
||||||
RUN dnf -y install golang
|
-h /home/build \
|
||||||
|
-s /bin/sh \
|
||||||
|
-u 1000 \
|
||||||
|
-G build \
|
||||||
|
-D \
|
||||||
|
build
|
||||||
|
|
||||||
RUN mkdir /root/buildah && \
|
RUN echo -e "build:1:999\nbuild:1001:64535" > /etc/subuid && \
|
||||||
cd /root/buildah && \
|
echo -e "build:1:999\nbuild:1001:64535" > /etc/subgid && \
|
||||||
git clone https://github.com/harness/buildah.git ./src/github.com/containers/buildah
|
mkdir -p /home/build/.local/share/containers && \
|
||||||
|
mkdir -p /home/build/.config/containers && \
|
||||||
|
chown -R build:build /home/build
|
||||||
|
|
||||||
RUN cd /root/buildah/src/github.com/containers/buildah && make && sudo make install
|
RUN apk add --no-cache buildah
|
||||||
|
|
||||||
|
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"]
|
||||||
@ -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
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user