Add drone pipeline
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
IamTheFij 2019-03-10 18:01:31 -07:00
parent 2944ffb8c8
commit ba60619521
5 changed files with 132 additions and 7 deletions

95
.drone.yml Normal file
View File

@ -0,0 +1,95 @@
kind: pipeline
name: linux-amd64
steps:
- name: get qemu
image: ubuntu:bionic
commands:
- apt-get update
- apt-get install -y make wget
- make build/qemu-x86_64-static
- name: build
image: plugins/docker
settings:
repo: iamthefij/cloudflare-ddns
auto_tag: true
auto_tag_suffix: linux-amd64
username:
from_secret: docker_username
password:
from_secret: docker_password
---
kind: pipeline
name: linux-arm
steps:
- name: get qemu
image: ubuntu:bionic
commands:
- apt-get update
- apt-get install -y make wget
- make build/qemu-arm-static
- name: build
image: plugins/docker
settings:
repo: iamthefij/cloudflare-ddns
auto_tag: true
auto_tag_suffix: linux-arm
username:
from_secret: docker_username
password:
from_secret: docker_password
build_args:
- ARCH=arm
- REPO=arm32v6
---
kind: pipeline
name: linux-arm64
steps:
- name: get qemu
image: ubuntu:bionic
commands:
- apt-get update
- apt-get install -y make wget
- make build/qemu-aarch64-static
- name: build
image: plugins/docker
settings:
repo: iamthefij/cloudflare-ddns
auto_tag: true
auto_tag_suffix: linux-arm64
username:
from_secret: docker_username
password:
from_secret: docker_password
build_args:
- ARCH=aarch64
- REPO=arm64v8
---
kind: pipeline
name: manifest
depends_on:
- linux-amd64
- linux-arm
- linux-arm64
steps:
- name: publish manifest
image: plugins/manifest
settings:
spec: manifest.tmpl
auto_tag: true
ignore_missing: true
username:
from_secret: docker_username
password:
from_secret: docker_password

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
qemu-*
*.tar.gz
tags

View File

@ -17,17 +17,21 @@ build: build/qemu-x86_64-static
docker build . -t ${DOCKER_TAG}
build/qemu-arm-static:
./get_qemu.sh
./get_qemu.sh arm
build/qemu-x86_64-static:
./get_qemu.sh
./get_qemu.sh x86_64
build/qemu-aarch64-static:
./get_qemu.sh
./get_qemu.sh aarch64
.PHONY: cross-build-arm32v6
cross-build-arm32v6: build/qemu-arm-static
docker build --build-arg REPO=arm32v6 --build-arg ARCH=arm . -t ${DOCKER_TAG}-arm32v6
.PHONY: cross-build-arm
cross-build-arm: build/qemu-arm-static
docker build --build-arg REPO=arm32v6 --build-arg ARCH=arm . -t ${DOCKER_TAG}-linux-arm
.PHONY: cross-build-arm
cross-build-arm64: build/qemu-aarch64-static
docker build --build-arg REPO=arm64v8 --build-arg ARCH=aarch64 . -t ${DOCKER_TAG}-linux-arm64
.PHONY: run
run: build

View File

@ -6,7 +6,7 @@ VERSION=v2.9.1-1
mkdir -p build
cd build
for target_arch in aarch64 arm x86_64; do
for target_arch in $*; do
wget -N https://github.com/multiarch/qemu-user-static/releases/download/$VERSION/${HOST_ARCH}_qemu-${target_arch}-static.tar.gz
tar -xvf ${HOST_ARCH}_qemu-${target_arch}-static.tar.gz
rm ${HOST_ARCH}_qemu-${target_arch}-static.tar.gz

25
manifest.tmpl Normal file
View File

@ -0,0 +1,25 @@
image: iamthefij/cloudflare-ddns:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}
{{#if build.tags}}
tags:
{{#each build.tags}}
- {{this}}
{{/each}}
{{/if}}
manifests:
-
image: iamthefij/cloudflare-ddns:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-amd64
platform:
architecture: amd64
os: linux
-
image: iamthefij/cloudflare-ddns:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm64
platform:
architecture: arm64
os: linux
variant: v8
-
image: iamthefij/cloudflare-ddns:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm
platform:
architecture: arm
os: linux
variant: v7