diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..3e51d2f --- /dev/null +++ b/.drone.yml @@ -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 + diff --git a/.gitignore b/.gitignore index 604a3bf..b4ef05f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ qemu-* *.tar.gz +tags diff --git a/Makefile b/Makefile index f73122f..506873c 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/get_qemu.sh b/get_qemu.sh index c9e0314..9ea3b81 100755 --- a/get_qemu.sh +++ b/get_qemu.sh @@ -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 diff --git a/manifest.tmpl b/manifest.tmpl new file mode 100644 index 0000000..c2e4da5 --- /dev/null +++ b/manifest.tmpl @@ -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