From a7e696998753875025dd2e12fce30e299da33ed5 Mon Sep 17 00:00:00 2001 From: aptalca Date: Sat, 23 Mar 2019 16:37:53 -0400 Subject: [PATCH 1/8] add pr and dev builds --- .drone.yml | 166 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 164 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index d4b7fe4..64ed170 100644 --- a/.drone.yml +++ b/.drone.yml @@ -19,10 +19,45 @@ steps: username: from_secret: docker_username when: + branch: + - master event: - push - tag +- name: publish-pr + image: plugins/docker + settings: + auto_tag: true + auto_tag_suffix: linux-amd64-pr + dockerfile: Dockerfile + password: + from_secret: docker_password + repo: aptalca/zap2xml + username: + from_secret: docker_username + when: + event: + - pull_request + +- name: publish-branch + image: plugins/docker + settings: + auto_tag: true + auto_tag_suffix: linux-amd64-dev + dockerfile: Dockerfile + password: + from_secret: docker_password + repo: aptalca/zap2xml + username: + from_secret: docker_username + when: + branch: + exclude: + - master + event: + - push + --- kind: pipeline name: linux-arm @@ -47,7 +82,40 @@ steps: event: - push - tag - + +- name: publish-pr + image: plugins/docker + settings: + auto_tag: true + auto_tag_suffix: linux-arm-pr + dockerfile: Dockerfile.arm + password: + from_secret: docker_password + repo: aptalca/zap2xml + username: + from_secret: docker_username + when: + event: + - pull_request + +- name: publish-branch + image: plugins/docker + settings: + auto_tag: true + auto_tag_suffix: linux-arm-dev + dockerfile: Dockerfile.arm + password: + from_secret: docker_password + repo: aptalca/zap2xml + username: + from_secret: docker_username + when: + branch: + exclude: + - master + event: + - push + --- kind: pipeline name: linux-arm64 @@ -72,7 +140,40 @@ steps: event: - push - tag - + +- name: publish-pr + image: plugins/docker + settings: + auto_tag: true + auto_tag_suffix: linux-arm64-pr + dockerfile: Dockerfile.aarch64 + password: + from_secret: docker_password + repo: aptalca/zap2xml + username: + from_secret: docker_username + when: + event: + - pull_request + +- name: publish-branch + image: plugins/docker + settings: + auto_tag: true + auto_tag_suffix: linux-arm64-dev + dockerfile: Dockerfile.aarch64 + password: + from_secret: docker_password + repo: aptalca/zap2xml + username: + from_secret: docker_username + when: + branch: + exclude: + - master + event: + - push + --- kind: pipeline name: manifest @@ -93,6 +194,8 @@ steps: username: from_secret: docker_username when: + branch: + - master event: - push - tag @@ -102,4 +205,63 @@ depends_on: - linux-arm - linux-arm64 +--- +kind: pipeline +name: manifest-pr + +platform: + os: linux + arch: amd64 + +steps: +- name: server + image: plugins/manifest + settings: + auto_tag: true + ignore_missing: true + password: + from_secret: docker_password + spec: manifest-pr.tmpl + username: + from_secret: docker_username + when: + event: + - pull_request + +depends_on: +- linux-amd64 +- linux-arm +- linux-arm64 + +--- +kind: pipeline +name: manifest-dev + +platform: + os: linux + arch: amd64 + +steps: +- name: server + image: plugins/manifest + settings: + auto_tag: true + ignore_missing: true + password: + from_secret: docker_password + spec: manifest-dev.tmpl + username: + from_secret: docker_username + when: + branch: + exclude: + - master + event: + - push + +depends_on: +- linux-amd64 +- linux-arm +- linux-arm64 + ... From eab68ce05be5c2edcebc84f46d5d420e22fc7afb Mon Sep 17 00:00:00 2001 From: aptalca Date: Sat, 23 Mar 2019 16:41:24 -0400 Subject: [PATCH 2/8] include all branches --- .drone.yml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/.drone.yml b/.drone.yml index 64ed170..dab5a34 100644 --- a/.drone.yml +++ b/.drone.yml @@ -19,6 +19,9 @@ steps: username: from_secret: docker_username when: + ref: + include: + - refs/heads/* branch: - master event: @@ -37,6 +40,9 @@ steps: username: from_secret: docker_username when: + ref: + include: + - refs/heads/* event: - pull_request @@ -52,6 +58,9 @@ steps: username: from_secret: docker_username when: + ref: + include: + - refs/heads/* branch: exclude: - master @@ -79,6 +88,11 @@ steps: username: from_secret: docker_username when: + ref: + include: + - refs/heads/* + branch: + - master event: - push - tag @@ -95,6 +109,9 @@ steps: username: from_secret: docker_username when: + ref: + include: + - refs/heads/* event: - pull_request @@ -110,6 +127,9 @@ steps: username: from_secret: docker_username when: + ref: + include: + - refs/heads/* branch: exclude: - master @@ -137,6 +157,11 @@ steps: username: from_secret: docker_username when: + ref: + include: + - refs/heads/* + branch: + - master event: - push - tag @@ -153,6 +178,9 @@ steps: username: from_secret: docker_username when: + ref: + include: + - refs/heads/* event: - pull_request @@ -168,6 +196,9 @@ steps: username: from_secret: docker_username when: + ref: + include: + - refs/heads/* branch: exclude: - master @@ -194,6 +225,9 @@ steps: username: from_secret: docker_username when: + ref: + include: + - refs/heads/* branch: - master event: @@ -225,6 +259,9 @@ steps: username: from_secret: docker_username when: + ref: + include: + - refs/heads/* event: - pull_request @@ -253,6 +290,9 @@ steps: username: from_secret: docker_username when: + ref: + include: + - refs/heads/* branch: exclude: - master From 81bf5e5a6a93b3c36f5e0b68cf8677f1fc38f784 Mon Sep 17 00:00:00 2001 From: aptalca Date: Sat, 23 Mar 2019 16:48:19 -0400 Subject: [PATCH 3/8] fix tags --- .drone.yml | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/.drone.yml b/.drone.yml index dab5a34..abf3c3e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -31,8 +31,8 @@ steps: - name: publish-pr image: plugins/docker settings: - auto_tag: true - auto_tag_suffix: linux-amd64-pr + tags: + - linux-amd64-pr dockerfile: Dockerfile password: from_secret: docker_password @@ -49,8 +49,8 @@ steps: - name: publish-branch image: plugins/docker settings: - auto_tag: true - auto_tag_suffix: linux-amd64-dev + tags: + - linux-amd64-dev dockerfile: Dockerfile password: from_secret: docker_password @@ -100,8 +100,8 @@ steps: - name: publish-pr image: plugins/docker settings: - auto_tag: true - auto_tag_suffix: linux-arm-pr + tags: + - linux-arm-pr dockerfile: Dockerfile.arm password: from_secret: docker_password @@ -118,8 +118,8 @@ steps: - name: publish-branch image: plugins/docker settings: - auto_tag: true - auto_tag_suffix: linux-arm-dev + tags: + - linux-arm-dev dockerfile: Dockerfile.arm password: from_secret: docker_password @@ -169,8 +169,8 @@ steps: - name: publish-pr image: plugins/docker settings: - auto_tag: true - auto_tag_suffix: linux-arm64-pr + tags: + - linux-arm64-pr dockerfile: Dockerfile.aarch64 password: from_secret: docker_password @@ -187,8 +187,8 @@ steps: - name: publish-branch image: plugins/docker settings: - auto_tag: true - auto_tag_suffix: linux-arm64-dev + tags: + - linux-arm64-dev dockerfile: Dockerfile.aarch64 password: from_secret: docker_password @@ -251,7 +251,6 @@ steps: - name: server image: plugins/manifest settings: - auto_tag: true ignore_missing: true password: from_secret: docker_password @@ -282,7 +281,6 @@ steps: - name: server image: plugins/manifest settings: - auto_tag: true ignore_missing: true password: from_secret: docker_password From 4c22eaca17cee77dd249c96f69ca0d411209a840 Mon Sep 17 00:00:00 2001 From: aptalca Date: Sat, 23 Mar 2019 16:51:24 -0400 Subject: [PATCH 4/8] Create manifest-dev.tmpl --- manifest-dev.tmpl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 manifest-dev.tmpl diff --git a/manifest-dev.tmpl b/manifest-dev.tmpl new file mode 100644 index 0000000..f33e67d --- /dev/null +++ b/manifest-dev.tmpl @@ -0,0 +1,19 @@ +image: aptalca/zap2xml:dev +manifests: + - + image: aptalca/zap2xml:linux-amd64-dev + platform: + architecture: amd64 + os: linux + - + image: aptalca/zap2xml:linux-arm64-dev + platform: + architecture: arm64 + os: linux + variant: v8 + - + image: aptalca/zap2xml:linux-arm-dev + platform: + architecture: arm + os: linux + variant: v7 From 55d03574fb4559abc0bb5ef17816e8ac6811b784 Mon Sep 17 00:00:00 2001 From: aptalca Date: Sat, 23 Mar 2019 16:53:06 -0400 Subject: [PATCH 5/8] Create manifest-pr.tmpl --- manifest-pr.tmpl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 manifest-pr.tmpl diff --git a/manifest-pr.tmpl b/manifest-pr.tmpl new file mode 100644 index 0000000..557877b --- /dev/null +++ b/manifest-pr.tmpl @@ -0,0 +1,19 @@ +image: aptalca/zap2xml:pr +manifests: + - + image: aptalca/zap2xml:linux-amd64-pr + platform: + architecture: amd64 + os: linux + - + image: aptalca/zap2xml:linux-arm64-pr + platform: + architecture: arm64 + os: linux + variant: v8 + - + image: aptalca/zap2xml:linux-arm-pr + platform: + architecture: arm + os: linux + variant: v7 From 74381460ccbfe55013a7990ee70fcef5616f1b60 Mon Sep 17 00:00:00 2001 From: aptalca Date: Sat, 23 Mar 2019 16:55:20 -0400 Subject: [PATCH 6/8] use multi-arch baseimages --- .drone.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.drone.yml b/.drone.yml index abf3c3e..9769b0c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -81,7 +81,7 @@ steps: settings: auto_tag: true auto_tag_suffix: linux-arm - dockerfile: Dockerfile.arm + dockerfile: Dockerfile password: from_secret: docker_password repo: aptalca/zap2xml @@ -102,7 +102,7 @@ steps: settings: tags: - linux-arm-pr - dockerfile: Dockerfile.arm + dockerfile: Dockerfile password: from_secret: docker_password repo: aptalca/zap2xml @@ -120,7 +120,7 @@ steps: settings: tags: - linux-arm-dev - dockerfile: Dockerfile.arm + dockerfile: Dockerfile password: from_secret: docker_password repo: aptalca/zap2xml @@ -150,7 +150,7 @@ steps: settings: auto_tag: true auto_tag_suffix: linux-arm64 - dockerfile: Dockerfile.aarch64 + dockerfile: Dockerfile password: from_secret: docker_password repo: aptalca/zap2xml @@ -171,7 +171,7 @@ steps: settings: tags: - linux-arm64-pr - dockerfile: Dockerfile.aarch64 + dockerfile: Dockerfile password: from_secret: docker_password repo: aptalca/zap2xml @@ -189,7 +189,7 @@ steps: settings: tags: - linux-arm64-dev - dockerfile: Dockerfile.aarch64 + dockerfile: Dockerfile password: from_secret: docker_password repo: aptalca/zap2xml From 39dbbf64375d9eb29747d256f48f0ded1f2caa5b Mon Sep 17 00:00:00 2001 From: aptalca Date: Sat, 23 Mar 2019 16:57:03 -0400 Subject: [PATCH 7/8] Delete Dockerfile.aarch64 --- Dockerfile.aarch64 | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 Dockerfile.aarch64 diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 deleted file mode 100644 index 22ec8e1..0000000 --- a/Dockerfile.aarch64 +++ /dev/null @@ -1,32 +0,0 @@ -FROM lsiobase/alpine:arm64v8-3.9 -MAINTAINER aptalca - -# environment settings -ENV S6_BEHAVIOUR_IF_STAGE2_FAILS=2 - -# install packages -RUN \ - apk add --no-cache \ - logrotate \ - nano \ - perl-compress-raw-zlib \ - perl-gd \ - perl-html-parser \ - perl-http-cookies \ - perl-json \ - perl-json-maybexs \ - perl-lwp-protocol-https \ - perl-lwp-useragent-determined \ - wget && \ - apk add --no-cache \ - --repository http://nl.alpinelinux.org/alpine/edge/testing \ - perl-json-xs && \ - -# fix logrotate - sed -i "s#/var/log/messages {}.*# #g" /etc/logrotate.conf - -# copy local files -COPY root/ / - -# ports and volumes -VOLUME /config From fda1ea5eb91941ac6ee5d9d9dfa9e881cb5b4b43 Mon Sep 17 00:00:00 2001 From: aptalca Date: Sat, 23 Mar 2019 16:57:11 -0400 Subject: [PATCH 8/8] Delete Dockerfile.arm --- Dockerfile.arm | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 Dockerfile.arm diff --git a/Dockerfile.arm b/Dockerfile.arm deleted file mode 100644 index 62eaea9..0000000 --- a/Dockerfile.arm +++ /dev/null @@ -1,32 +0,0 @@ -FROM lsiobase/alpine:arm32v7-3.9 -MAINTAINER aptalca - -# environment settings -ENV S6_BEHAVIOUR_IF_STAGE2_FAILS=2 - -# install packages -RUN \ - apk add --no-cache \ - logrotate \ - nano \ - perl-compress-raw-zlib \ - perl-gd \ - perl-html-parser \ - perl-http-cookies \ - perl-json \ - perl-json-maybexs \ - perl-lwp-protocol-https \ - perl-lwp-useragent-determined \ - wget && \ - apk add --no-cache \ - --repository http://nl.alpinelinux.org/alpine/edge/testing \ - perl-json-xs && \ - -# fix logrotate - sed -i "s#/var/log/messages {}.*# #g" /etc/logrotate.conf - -# copy local files -COPY root/ / - -# ports and volumes -VOLUME /config