26 Commits

Author SHA1 Message Date
TP Honey
6ec5e71411 Merge pull request #338 from tphoney/bump-go-1.13
(maint) bump git to 1.13 for build and test
2021-10-13 17:19:30 +01:00
TP Honey
0911e6a922 (maint) bump git to 1.13 for build and test 2021-10-13 14:53:32 +01:00
TP Honey
88f8bf1cb0 Merge pull request #337 from tphoney/prep_v19.03.9
(maint) v19.03.9 release prep
2021-10-13 14:32:03 +01:00
TP Honey
2d70a1fa7c (maint) v19.03.9 release prep 2021-10-13 14:27:33 +01:00
Eoin McAfee
607b04a871 Merge pull request #333 from jimsheldon/ecr-externalid
adding support for externalId
2021-09-23 15:52:24 +01:00
Jim Sheldon
e44c2d46ea adding support for externalId 2021-09-17 15:33:05 -04:00
Brad Rydzewski
72ef7b1f3f log available credentials before login 2021-08-02 22:15:39 -04:00
Brad Rydzewski
fbbeec5a2e use Replace instead of ReplaceAll 2021-08-02 21:42:22 -04:00
Brad Rydzewski
b1d8698d1c print login failure reason to output 2021-08-02 21:28:37 -04:00
Brad Rydzewski
d4cf9f20f1 remove pull always 2021-07-11 15:50:43 -04:00
Brad Rydzewski
f75380013d Merge pull request #325 from drone-plugins/revert-322-update-seccomp
Revert "Update seccomp to 20.10 docker"
2021-07-11 15:39:35 -04:00
Brad Rydzewski
c10d36754c Revert "Update seccomp to 20.10 docker (#322)"
This reverts commit dd359dfc72.
2021-07-11 15:38:04 -04:00
techknowlogick
dd359dfc72 Update seccomp to 20.10 docker (#322)
* Update seccomp to 20.10 docker
2021-07-07 20:03:54 +01:00
TP Honey
729aa5d300 Merge pull request #323 from tphoney/docker_rate_limit
(maint) CI, remove the dry run steps, due to rate limiting
2021-07-07 19:52:19 +01:00
TP Honey
db5c2161fe (maint) CI, remove the dry run steps, due to rate limiting 2021-07-07 19:37:30 +01:00
Brad Rydzewski
f08821b024 Merge pull request #300 from rvoitenko/ecr_scan_on_push
ECR: adding setting to enable image scanning while repo creation
2021-04-06 15:55:56 -04:00
Brad Rydzewski
0f6bd8a62e Merge pull request #313 from codrut-fc/opencontainer-labels
Add support for automatic opencontainer labels
2021-03-01 20:52:08 -05:00
Roman Voitenko
5760e7b4e8 Merge branch 'master' into ecr_scan_on_push 2021-02-20 13:32:16 +01:00
Brad Rydzewski
7ade37a140 Update .drone.yml 2021-02-16 09:44:28 -05:00
Brad Rydzewski
319660d758 Merge pull request #312 from xoxys/master
add custom seccomp profile
2021-02-09 16:29:27 -05:00
Codruț Constantin Gușoi
bd4029884c Add support for automatic opencontainer labels 2021-01-20 18:14:27 +00:00
Robert Kaussow
b1959299c7 load the patched seccomp profile only on arm 2021-01-17 18:40:36 +01:00
Robert Kaussow
bfdf3034c1 add custom seccomp profile 2021-01-17 14:27:49 +01:00
Brad Rydzewski
9c86f98ea5 Update main.go 2020-11-25 11:51:03 -05:00
Roman Voitenko
3501d9a65d add possibility to turn on/off image scanning not only during repo creation, but when repo already created 2020-10-01 10:43:25 +02:00
Roman Voitenko
d8b6b48fa3 add possibility to turn on ECR image scanning for repos created by ecr plugin 2020-09-30 23:32:23 +02:00
8 changed files with 213 additions and 471 deletions

View File

@@ -8,8 +8,7 @@ platform:
steps:
- name: vet
pull: always
image: golang:1.11
image: golang:1.13
commands:
- go vet ./...
environment:
@@ -19,8 +18,7 @@ steps:
path: /go
- name: test
pull: always
image: golang:1.11
image: golang:1.13
commands:
- go test -cover ./...
environment:
@@ -77,43 +75,43 @@ trigger:
depends_on:
- testing
---
kind: pipeline
type: ssh
name: windows-1903-amd64-docker
# ---
# kind: pipeline
# type: ssh
# name: windows-1903-amd64-docker
platform:
os: windows
# platform:
# os: windows
server:
host: windows.1903.amd64.plugins.drone.ci
password:
from_secret: windows_password
user:
from_secret: windows_username
# server:
# host: windows.1903.amd64.plugins.drone.ci
# password:
# from_secret: windows_password
# user:
# from_secret: windows_username
steps:
- name: build
commands:
# TODO use the new DRONE_SEMVER_SHORT environment variables to
# publish docker images for tag events.
- go build -o release/windows/amd64/drone-docker.exe ./cmd/drone-docker
- docker login -u $env:USERNAME -p $env:PASSWORD
- docker build -f docker/docker/Dockerfile.windows.1903 -t plugins/docker:windows-1903-amd64 .
- docker push plugins/docker:windows-1903-amd64
environment:
CGO_ENABLED: "0"
USERNAME:
from_secret: docker_username
PASSWORD:
from_secret: docker_password
# steps:
# - name: build
# commands:
# # TODO use the new DRONE_SEMVER_SHORT environment variables to
# # publish docker images for tag events.
# - go build -o release/windows/amd64/drone-docker.exe ./cmd/drone-docker
# - docker login -u $env:USERNAME -p $env:PASSWORD
# - docker build -f docker/docker/Dockerfile.windows.1903 -t plugins/docker:windows-1903-amd64 .
# - docker push plugins/docker:windows-1903-amd64
# environment:
# CGO_ENABLED: "0"
# USERNAME:
# from_secret: docker_username
# PASSWORD:
# from_secret: docker_password
trigger:
event:
- push
# trigger:
# event:
# - push
depends_on:
- testing
# depends_on:
# - testing
---
kind: pipeline
@@ -163,8 +161,7 @@ platform:
steps:
- name: build-push
pull: always
image: golang:1.11
image: golang:1.13
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/amd64/drone-docker ./cmd/drone-docker"
environment:
@@ -176,8 +173,7 @@ steps:
- tag
- name: build-tag
pull: always
image: golang:1.11
image: golang:1.13
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/amd64/drone-docker ./cmd/drone-docker"
environment:
@@ -188,30 +184,11 @@ steps:
- tag
- name: executable
pull: always
image: golang:1.11
image: golang:1.13
commands:
- ./release/linux/amd64/drone-docker --help
- name: dryrun
pull: always
image: plugins/docker:18
settings:
daemon_off: false
dockerfile: docker/docker/Dockerfile.linux.amd64
dry_run: true
password:
from_secret: docker_password
repo: plugins/docker
tags: linux-amd64
username:
from_secret: docker_username
when:
event:
- pull_request
- name: publish
pull: always
image: plugins/docker:18
settings:
auto_tag: true
@@ -247,8 +224,7 @@ platform:
steps:
- name: build-push
pull: always
image: golang:1.11
image: golang:1.13
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/arm64/drone-docker ./cmd/drone-docker"
environment:
@@ -260,8 +236,7 @@ steps:
- tag
- name: build-tag
pull: always
image: golang:1.11
image: golang:1.13
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/arm64/drone-docker ./cmd/drone-docker"
environment:
@@ -272,30 +247,11 @@ steps:
- tag
- name: executable
pull: always
image: golang:1.11
image: golang:1.13
commands:
- ./release/linux/arm64/drone-docker --help
- name: dryrun
pull: always
image: plugins/docker:18
settings:
daemon_off: false
dockerfile: docker/docker/Dockerfile.linux.arm64
dry_run: true
password:
from_secret: docker_password
repo: plugins/docker
tags: linux-arm64
username:
from_secret: docker_username
when:
event:
- pull_request
- name: publish
pull: always
image: plugins/docker:18
settings:
auto_tag: true
@@ -331,8 +287,7 @@ platform:
steps:
- name: build-push
pull: always
image: golang:1.11
image: golang:1.13
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/arm/drone-docker ./cmd/drone-docker"
environment:
@@ -344,8 +299,7 @@ steps:
- tag
- name: build-tag
pull: always
image: golang:1.11
image: golang:1.13
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/arm/drone-docker ./cmd/drone-docker"
environment:
@@ -356,30 +310,11 @@ steps:
- tag
- name: executable
pull: always
image: golang:1.11
image: golang:1.13
commands:
- ./release/linux/arm/drone-docker --help
- name: dryrun
pull: always
image: plugins/docker:18
settings:
daemon_off: false
dockerfile: docker/docker/Dockerfile.linux.arm
dry_run: true
password:
from_secret: docker_password
repo: plugins/docker
tags: linux-arm
username:
from_secret: docker_username
when:
event:
- pull_request
- name: publish
pull: always
image: plugins/docker:18
settings:
auto_tag: true
@@ -415,7 +350,6 @@ platform:
steps:
- name: manifest
pull: always
image: plugins/manifest
settings:
auto_tag: true
@@ -426,14 +360,6 @@ steps:
username:
from_secret: docker_username
- name: microbadger
pull: always
image: plugins/webhook
failure: ignore
settings:
urls:
from_secret: microbadger_docker
trigger:
ref:
- refs/heads/master
@@ -441,11 +367,11 @@ trigger:
depends_on:
- windows-1809-amd64-docker
- windows-1903-amd64-docker
- windows-1909-amd64-docker
- linux-amd64-docker
- linux-arm64-docker
- linux-arm-docker
# - windows-1903-amd64-dfocker
---
kind: pipeline
@@ -457,8 +383,7 @@ platform:
steps:
- name: build-push
pull: always
image: golang:1.11
image: golang:1.13
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/amd64/drone-gcr ./cmd/drone-gcr"
environment:
@@ -470,8 +395,7 @@ steps:
- tag
- name: build-tag
pull: always
image: golang:1.11
image: golang:1.13
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/amd64/drone-gcr ./cmd/drone-gcr"
environment:
@@ -481,25 +405,7 @@ steps:
event:
- tag
- name: dryrun
pull: always
image: plugins/docker:18
settings:
daemon_off: false
dockerfile: docker/gcr/Dockerfile.linux.amd64
dry_run: true
password:
from_secret: docker_password
repo: plugins/gcr
tags: linux-amd64
username:
from_secret: docker_username
when:
event:
- pull_request
- name: publish
pull: always
image: plugins/docker:18
settings:
auto_tag: true
@@ -535,8 +441,7 @@ platform:
steps:
- name: build-push
pull: always
image: golang:1.11
image: golang:1.13
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/arm64/drone-gcr ./cmd/drone-gcr"
environment:
@@ -548,8 +453,7 @@ steps:
- tag
- name: build-tag
pull: always
image: golang:1.11
image: golang:1.13
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/arm64/drone-gcr ./cmd/drone-gcr"
environment:
@@ -559,25 +463,7 @@ steps:
event:
- tag
- name: dryrun
pull: always
image: plugins/docker:18
settings:
daemon_off: false
dockerfile: docker/gcr/Dockerfile.linux.arm64
dry_run: true
password:
from_secret: docker_password
repo: plugins/gcr
tags: linux-arm64
username:
from_secret: docker_username
when:
event:
- pull_request
- name: publish
pull: always
image: plugins/docker:18
settings:
auto_tag: true
@@ -613,8 +499,7 @@ platform:
steps:
- name: build-push
pull: always
image: golang:1.11
image: golang:1.13
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/arm/drone-gcr ./cmd/drone-gcr"
environment:
@@ -626,8 +511,7 @@ steps:
- tag
- name: build-tag
pull: always
image: golang:1.11
image: golang:1.13
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/arm/drone-gcr ./cmd/drone-gcr"
environment:
@@ -637,25 +521,7 @@ steps:
event:
- tag
- name: dryrun
pull: always
image: plugins/docker:18
settings:
daemon_off: false
dockerfile: docker/gcr/Dockerfile.linux.arm
dry_run: true
password:
from_secret: docker_password
repo: plugins/gcr
tags: linux-arm
username:
from_secret: docker_username
when:
event:
- pull_request
- name: publish
pull: always
image: plugins/docker:18
settings:
auto_tag: true
@@ -691,7 +557,6 @@ platform:
steps:
- name: manifest
pull: always
image: plugins/manifest
settings:
auto_tag: true
@@ -702,14 +567,6 @@ steps:
username:
from_secret: docker_username
- name: microbadger
pull: always
image: plugins/webhook
failure: ignore
settings:
urls:
from_secret: microbadger_gcr
trigger:
ref:
- refs/heads/master
@@ -730,8 +587,7 @@ platform:
steps:
- name: build-push
pull: always
image: golang:1.11
image: golang:1.13
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/amd64/drone-ecr ./cmd/drone-ecr"
environment:
@@ -743,8 +599,7 @@ steps:
- tag
- name: build-tag
pull: always
image: golang:1.11
image: golang:1.13
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/amd64/drone-ecr ./cmd/drone-ecr"
environment:
@@ -754,25 +609,7 @@ steps:
event:
- tag
- name: dryrun
pull: always
image: plugins/docker:18
settings:
daemon_off: false
dockerfile: docker/ecr/Dockerfile.linux.amd64
dry_run: true
password:
from_secret: docker_password
repo: plugins/ecr
tags: linux-amd64
username:
from_secret: docker_username
when:
event:
- pull_request
- name: publish
pull: always
image: plugins/docker:18
settings:
auto_tag: true
@@ -808,8 +645,7 @@ platform:
steps:
- name: build-push
pull: always
image: golang:1.11
image: golang:1.13
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/arm64/drone-ecr ./cmd/drone-ecr"
environment:
@@ -821,8 +657,7 @@ steps:
- tag
- name: build-tag
pull: always
image: golang:1.11
image: golang:1.13
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/arm64/drone-ecr ./cmd/drone-ecr"
environment:
@@ -832,25 +667,7 @@ steps:
event:
- tag
- name: dryrun
pull: always
image: plugins/docker:18
settings:
daemon_off: false
dockerfile: docker/ecr/Dockerfile.linux.arm64
dry_run: true
password:
from_secret: docker_password
repo: plugins/ecr
tags: linux-arm64
username:
from_secret: docker_username
when:
event:
- pull_request
- name: publish
pull: always
image: plugins/docker:18
settings:
auto_tag: true
@@ -886,8 +703,7 @@ platform:
steps:
- name: build-push
pull: always
image: golang:1.11
image: golang:1.13
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/arm/drone-ecr ./cmd/drone-ecr"
environment:
@@ -899,8 +715,7 @@ steps:
- tag
- name: build-tag
pull: always
image: golang:1.11
image: golang:1.13
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/arm/drone-ecr ./cmd/drone-ecr"
environment:
@@ -910,25 +725,7 @@ steps:
event:
- tag
- name: dryrun
pull: always
image: plugins/docker:18
settings:
daemon_off: false
dockerfile: docker/ecr/Dockerfile.linux.arm
dry_run: true
password:
from_secret: docker_password
repo: plugins/ecr
tags: linux-arm
username:
from_secret: docker_username
when:
event:
- pull_request
- name: publish
pull: always
image: plugins/docker:18
settings:
auto_tag: true
@@ -964,7 +761,6 @@ platform:
steps:
- name: manifest
pull: always
image: plugins/manifest
settings:
auto_tag: true
@@ -975,14 +771,6 @@ steps:
username:
from_secret: docker_username
- name: microbadger
pull: always
image: plugins/webhook
failure: ignore
settings:
urls:
from_secret: microbadger_ecr
trigger:
ref:
- refs/heads/master
@@ -1003,8 +791,7 @@ platform:
steps:
- name: build-push
pull: always
image: golang:1.11
image: golang:1.13
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/amd64/drone-heroku ./cmd/drone-heroku"
environment:
@@ -1016,8 +803,7 @@ steps:
- tag
- name: build-tag
pull: always
image: golang:1.11
image: golang:1.13
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/amd64/drone-heroku ./cmd/drone-heroku"
environment:
@@ -1027,25 +813,7 @@ steps:
event:
- tag
- name: dryrun
pull: always
image: plugins/docker:18
settings:
daemon_off: false
dockerfile: docker/heroku/Dockerfile.linux.amd64
dry_run: true
password:
from_secret: docker_password
repo: plugins/heroku
tags: linux-amd64
username:
from_secret: docker_username
when:
event:
- pull_request
- name: publish
pull: always
image: plugins/docker:18
settings:
auto_tag: true
@@ -1081,8 +849,7 @@ platform:
steps:
- name: build-push
pull: always
image: golang:1.11
image: golang:1.13
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/arm64/drone-heroku ./cmd/drone-heroku"
environment:
@@ -1094,8 +861,7 @@ steps:
- tag
- name: build-tag
pull: always
image: golang:1.11
image: golang:1.13
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/arm64/drone-heroku ./cmd/drone-heroku"
environment:
@@ -1105,25 +871,7 @@ steps:
event:
- tag
- name: dryrun
pull: always
image: plugins/docker:18
settings:
daemon_off: false
dockerfile: docker/heroku/Dockerfile.linux.arm64
dry_run: true
password:
from_secret: docker_password
repo: plugins/heroku
tags: linux-arm64
username:
from_secret: docker_username
when:
event:
- pull_request
- name: publish
pull: always
image: plugins/docker:18
settings:
auto_tag: true
@@ -1159,8 +907,7 @@ platform:
steps:
- name: build-push
pull: always
image: golang:1.11
image: golang:1.13
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/arm/drone-heroku ./cmd/drone-heroku"
environment:
@@ -1172,8 +919,7 @@ steps:
- tag
- name: build-tag
pull: always
image: golang:1.11
image: golang:1.13
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/arm/drone-heroku ./cmd/drone-heroku"
environment:
@@ -1183,25 +929,7 @@ steps:
event:
- tag
- name: dryrun
pull: always
image: plugins/docker:18
settings:
daemon_off: false
dockerfile: docker/heroku/Dockerfile.linux.arm
dry_run: true
password:
from_secret: docker_password
repo: plugins/heroku
tags: linux-arm
username:
from_secret: docker_username
when:
event:
- pull_request
- name: publish
pull: always
image: plugins/docker:18
settings:
auto_tag: true
@@ -1237,7 +965,6 @@ platform:
steps:
- name: manifest
pull: always
image: plugins/manifest
settings:
auto_tag: true
@@ -1248,14 +975,6 @@ steps:
username:
from_secret: docker_username
- name: microbadger
pull: always
image: plugins/webhook
failure: ignore
settings:
urls:
from_secret: microbadger_heroku
trigger:
ref:
- refs/heads/master
@@ -1276,8 +995,7 @@ platform:
steps:
- name: build-push
pull: always
image: golang:1.11
image: golang:1.13
commands:
- "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/linux/amd64/drone-acr ./cmd/drone-acr"
environment:
@@ -1289,8 +1007,7 @@ steps:
- tag
- name: build-tag
pull: always
image: golang:1.11
image: golang:1.13
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/linux/amd64/drone-acr ./cmd/drone-acr"
environment:
@@ -1300,25 +1017,7 @@ steps:
event:
- tag
- name: dryrun
pull: always
image: plugins/docker:18
settings:
daemon_off: false
dockerfile: docker/acr/Dockerfile.linux.amd64
dry_run: true
password:
from_secret: docker_password
repo: plugins/acr
tags: linux-amd64
username:
from_secret: docker_username
when:
event:
- pull_request
- name: publish
pull: always
image: plugins/docker:18
settings:
auto_tag: true
@@ -1354,8 +1053,7 @@ platform:
steps:
- name: build-push
pull: always
image: golang:1.11
image: golang:1.13
commands:
- "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/linux/arm64/drone-acr ./cmd/drone-acr"
environment:
@@ -1367,8 +1065,7 @@ steps:
- tag
- name: build-tag
pull: always
image: golang:1.11
image: golang:1.13
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/linux/arm64/drone-acr ./cmd/drone-acr"
environment:
@@ -1378,25 +1075,7 @@ steps:
event:
- tag
- name: dryrun
pull: always
image: plugins/docker:18
settings:
daemon_off: false
dockerfile: docker/acr/Dockerfile.linux.arm64
dry_run: true
password:
from_secret: docker_password
repo: plugins/acr
tags: linux-arm64
username:
from_secret: docker_username
when:
event:
- pull_request
- name: publish
pull: always
image: plugins/docker:18
settings:
auto_tag: true
@@ -1432,8 +1111,7 @@ platform:
steps:
- name: build-push
pull: always
image: golang:1.11
image: golang:1.13
commands:
- "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/linux/arm/drone-acr ./cmd/drone-acr"
environment:
@@ -1445,8 +1123,7 @@ steps:
- tag
- name: build-tag
pull: always
image: golang:1.11
image: golang:1.13
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/linux/arm/drone-acr ./cmd/drone-acr"
environment:
@@ -1456,25 +1133,7 @@ steps:
event:
- tag
- name: dryrun
pull: always
image: plugins/docker:18
settings:
daemon_off: false
dockerfile: docker/acr/Dockerfile.linux.arm
dry_run: true
password:
from_secret: docker_password
repo: plugins/acr
tags: linux-arm
username:
from_secret: docker_username
when:
event:
- pull_request
- name: publish
pull: always
image: plugins/docker:18
settings:
auto_tag: true
@@ -1510,7 +1169,6 @@ platform:
steps:
- name: manifest
pull: always
image: plugins/manifest
settings:
ignore_missing: true
@@ -1520,14 +1178,6 @@ steps:
username:
from_secret: docker_username
- name: microbadger
pull: always
image: plugins/webhook
failure: ignore
settings:
url:
from_secret: microbadger_acr
trigger:
ref:
- refs/heads/master
@@ -1539,4 +1189,4 @@ depends_on:
- linux-arm-acr
...
...

View File

@@ -0,0 +1,2 @@
since-tag=v19.03.8

25
CHANGELOG.md Normal file
View File

@@ -0,0 +1,25 @@
# Changelog
## [v19.03.9](https://github.com/drone-plugins/drone-docker/tree/v19.03.9) (2021-10-13)
[Full Changelog](https://github.com/drone-plugins/drone-docker/compare/v19.03.8...v19.03.9)
**Implemented enhancements:**
- adding support for externalId [\#333](https://github.com/drone-plugins/drone-docker/pull/333) ([jimsheldon](https://github.com/jimsheldon))
- Add support for automatic opencontainer labels [\#313](https://github.com/drone-plugins/drone-docker/pull/313) ([codrut-fc](https://github.com/codrut-fc))
- add custom seccomp profile [\#312](https://github.com/drone-plugins/drone-docker/pull/312) ([xoxys](https://github.com/xoxys))
- ECR: adding setting to enable image scanning while repo creation [\#300](https://github.com/drone-plugins/drone-docker/pull/300) ([rvoitenko](https://github.com/rvoitenko))
**Fixed bugs:**
- Revert "Update seccomp to 20.10 docker" [\#325](https://github.com/drone-plugins/drone-docker/pull/325) ([bradrydzewski](https://github.com/bradrydzewski))
**Merged pull requests:**
- \(maint\) CI, remove the dry run steps, due to rate limiting [\#323](https://github.com/drone-plugins/drone-docker/pull/323) ([tphoney](https://github.com/tphoney))
- Update seccomp to 20.10 docker [\#322](https://github.com/drone-plugins/drone-docker/pull/322) ([techknowlogick](https://github.com/techknowlogick))
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*

View File

@@ -50,7 +50,7 @@ func main() {
cli.StringFlag{
Name: "daemon.mirror",
Usage: "docker daemon registry mirror",
EnvVar: "PLUGIN_MIRROR",
EnvVar: "PLUGIN_MIRROR,DOCKER_PLUGIN_MIRROR",
},
cli.StringFlag{
Name: "daemon.storage-driver",
@@ -192,6 +192,16 @@ func main() {
Usage: "label-schema labels",
EnvVar: "PLUGIN_LABEL_SCHEMA",
},
cli.BoolTFlag{
Name: "auto-label",
Usage: "auto-label true|false",
EnvVar: "PLUGIN_AUTO_LABEL",
},
cli.StringFlag{
Name: "link",
Usage: "link https://example.com/org/repo-name",
EnvVar: "PLUGIN_REPO_LINK,DRONE_REPO_LINK",
},
cli.StringFlag{
Name: "docker.registry",
Usage: "docker registry",
@@ -216,7 +226,7 @@ func main() {
cli.StringFlag{
Name: "docker.config",
Usage: "docker json dockerconfig content",
EnvVar: "PLUGIN_CONFIG",
EnvVar: "PLUGIN_CONFIG,DOCKER_PLUGIN_CONFIG",
},
cli.BoolTFlag{
Name: "docker.purge",
@@ -257,24 +267,26 @@ func run(c *cli.Context) error {
Config: c.String("docker.config"),
},
Build: docker.Build{
Remote: c.String("remote.url"),
Name: c.String("commit.sha"),
Dockerfile: c.String("dockerfile"),
Context: c.String("context"),
Tags: c.StringSlice("tags"),
Args: c.StringSlice("args"),
ArgsEnv: c.StringSlice("args-from-env"),
Target: c.String("target"),
Squash: c.Bool("squash"),
Pull: c.BoolT("pull-image"),
CacheFrom: c.StringSlice("cache-from"),
Compress: c.Bool("compress"),
Repo: c.String("repo"),
Labels: c.StringSlice("custom-labels"),
LabelSchema: c.StringSlice("label-schema"),
NoCache: c.Bool("no-cache"),
AddHost: c.StringSlice("add-host"),
Quiet: c.Bool("quiet"),
Remote: c.String("remote.url"),
Name: c.String("commit.sha"),
Dockerfile: c.String("dockerfile"),
Context: c.String("context"),
Tags: c.StringSlice("tags"),
Args: c.StringSlice("args"),
ArgsEnv: c.StringSlice("args-from-env"),
Target: c.String("target"),
Squash: c.Bool("squash"),
Pull: c.BoolT("pull-image"),
CacheFrom: c.StringSlice("cache-from"),
Compress: c.Bool("compress"),
Repo: c.String("repo"),
Labels: c.StringSlice("custom-labels"),
LabelSchema: c.StringSlice("label-schema"),
AutoLabel: c.BoolT("auto-label"),
Link: c.String("link"),
NoCache: c.Bool("no-cache"),
AddHost: c.StringSlice("add-host"),
Quiet: c.Bool("quiet"),
},
Daemon: docker.Daemon{
Registry: c.String("docker.registry"),

View File

@@ -37,6 +37,8 @@ func main() {
lifecyclePolicy = getenv("PLUGIN_LIFECYCLE_POLICY")
repositoryPolicy = getenv("PLUGIN_REPOSITORY_POLICY")
assumeRole = getenv("PLUGIN_ASSUME_ROLE")
externalId = getenv("PLUGIN_EXTERNAL_ID")
scanOnPush = parseBoolOrDefault(false, getenv("PLUGIN_SCAN_ON_PUSH"))
)
// set the region
@@ -56,7 +58,7 @@ func main() {
log.Fatal(fmt.Sprintf("error creating aws session: %v", err))
}
svc := getECRClient(sess, assumeRole)
svc := getECRClient(sess, assumeRole, externalId)
username, password, defaultRegistry, err := getAuthInfo(svc)
if registry == "" {
@@ -72,10 +74,14 @@ func main() {
}
if create {
err = ensureRepoExists(svc, trimHostname(repo, registry))
err = ensureRepoExists(svc, trimHostname(repo, registry), scanOnPush)
if err != nil {
log.Fatal(fmt.Sprintf("error creating ECR repo: %v", err))
}
err = updateImageScannningConfig(svc, trimHostname(repo, registry), scanOnPush)
if err != nil {
log.Fatal(fmt.Sprintf("error updating scan on push for ECR repo: %v", err))
}
}
if lifecyclePolicy != "" {
@@ -118,9 +124,10 @@ func trimHostname(repo, registry string) string {
return repo
}
func ensureRepoExists(svc *ecr.ECR, name string) (err error) {
func ensureRepoExists(svc *ecr.ECR, name string, scanOnPush bool) (err error) {
input := &ecr.CreateRepositoryInput{}
input.SetRepositoryName(name)
input.SetImageScanningConfiguration(&ecr.ImageScanningConfiguration{ScanOnPush: &scanOnPush})
_, err = svc.CreateRepository(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok && aerr.Code() == ecr.ErrCodeRepositoryAlreadyExistsException {
@@ -132,6 +139,15 @@ func ensureRepoExists(svc *ecr.ECR, name string) (err error) {
return
}
func updateImageScannningConfig(svc *ecr.ECR, name string, scanOnPush bool) (err error) {
input := &ecr.PutImageScanningConfigurationInput{}
input.SetRepositoryName(name)
input.SetImageScanningConfiguration(&ecr.ImageScanningConfiguration{ScanOnPush: &scanOnPush})
_, err = svc.PutImageScanningConfiguration(input)
return err
}
func uploadLifeCyclePolicy(svc *ecr.ECR, lifecyclePolicy string, name string) (err error) {
input := &ecr.PutLifecyclePolicyInput{}
input.SetLifecyclePolicyText(lifecyclePolicy)
@@ -193,11 +209,19 @@ func getenv(key ...string) (s string) {
return
}
func getECRClient(sess *session.Session, role string) *ecr.ECR {
func getECRClient(sess *session.Session, role string, externalId string) *ecr.ECR {
if role == "" {
return ecr.New(sess)
}
return ecr.New(sess, &aws.Config{
Credentials: stscreds.NewCredentials(sess, role),
})
if externalId != "" {
return ecr.New(sess, &aws.Config{
Credentials: stscreds.NewCredentials(sess, role, func(p *stscreds.AssumeRoleProvider) {
p.ExternalID = &externalId
}),
})
} else {
return ecr.New(sess, &aws.Config{
Credentials: stscreds.NewCredentials(sess, role),
})
}
}

View File

@@ -53,7 +53,9 @@ type (
Compress bool // Docker build compress
Repo string // Docker build repository
LabelSchema []string // label-schema Label map
AutoLabel bool // auto-label bool
Labels []string // Label map
Link string // Git repo link
NoCache bool // Docker build no-cache
AddHost []string // Docker build add-host
Quiet bool // Docker build quiet
@@ -78,16 +80,33 @@ func (p Plugin) Exec() error {
// poll the docker daemon until it is started. This ensures the daemon is
// ready to accept connections before we proceed.
for i := 0; i < 15; i++ {
for i := 0; ; i++ {
cmd := commandInfo()
err := cmd.Run()
if err == nil {
break
}
if i == 15 {
fmt.Println("Unable to reach Docker Daemon after 15 attempts.")
break
}
time.Sleep(time.Second * 1)
}
// Create Auth Config File
// for debugging purposes, log the type of authentication
// credentials that have been provided.
switch {
case p.Login.Password != "" && p.Login.Config != "":
fmt.Println("Detected registry credentials and registry credentials file")
case p.Login.Password != "":
fmt.Println("Detected registry credentials")
case p.Login.Config != "":
fmt.Println("Detected registry credentials file")
default:
fmt.Println("Registry credentials or Docker config not provided. Guest mode enabled.")
}
// create Auth Config File
if p.Login.Config != "" {
os.MkdirAll(dockerHome, 0600)
@@ -101,21 +120,15 @@ func (p Plugin) Exec() error {
// login to the Docker registry
if p.Login.Password != "" {
cmd := commandLogin(p.Login)
err := cmd.Run()
raw, err := cmd.CombinedOutput()
if err != nil {
return fmt.Errorf("Error authenticating: %s", err)
out := string(raw)
out = strings.Replace(out, "WARNING! Using --password via the CLI is insecure. Use --password-stdin.", "", -1)
fmt.Println(out)
return fmt.Errorf("Error authenticating: exit status 1")
}
}
switch {
case p.Login.Password != "":
fmt.Println("Detected registry credentials")
case p.Login.Config != "":
fmt.Println("Detected registry credentials file")
default:
fmt.Println("Registry credentials or Docker config not provided. Guest mode enabled.")
}
if p.Build.Squash && !p.Daemon.Experimental {
fmt.Println("Squash build flag is only available when Docker deamon is started with experimental flag. Ignoring...")
p.Build.Squash = false
@@ -252,19 +265,22 @@ func commandBuild(build Build) *exec.Cmd {
args = append(args, "--quiet")
}
labelSchema := []string{
"schema-version=1.0",
fmt.Sprintf("build-date=%s", time.Now().Format(time.RFC3339)),
fmt.Sprintf("vcs-ref=%s", build.Name),
fmt.Sprintf("vcs-url=%s", build.Remote),
}
if build.AutoLabel {
labelSchema := []string{
fmt.Sprintf("created=%s", time.Now().Format(time.RFC3339)),
fmt.Sprintf("revision=%s", build.Name),
fmt.Sprintf("source=%s", build.Remote),
fmt.Sprintf("url=%s", build.Link),
}
labelPrefix := "org.opencontainers.image"
if len(build.LabelSchema) > 0 {
labelSchema = append(labelSchema, build.LabelSchema...)
}
if len(build.LabelSchema) > 0 {
labelSchema = append(labelSchema, build.LabelSchema...)
}
for _, label := range labelSchema {
args = append(args, "--label", fmt.Sprintf("org.label-schema.%s", label))
for _, label := range labelSchema {
args = append(args, "--label", fmt.Sprintf("%s.%s", labelPrefix, label))
}
}
if len(build.Labels) > 0 {
@@ -343,6 +359,10 @@ func commandDaemon(daemon Daemon) *exec.Cmd {
"--host=unix:///var/run/docker.sock",
}
if _, err := os.Stat("/etc/docker/default.json"); err == nil {
args = append(args, "--seccomp-profile=/etc/docker/default.json")
}
if daemon.StorageDriver != "" {
args = append(args, "-s", daemon.StorageDriver)
}

View File

@@ -2,5 +2,14 @@ FROM arm32v6/docker:19.03.8-dind
ENV DOCKER_HOST=unix:///var/run/docker.sock
RUN apk --update add --virtual .build-deps curl && \
mkdir -p /etc/docker/ && \
curl -SsL -o /etc/docker/default.json https://raw.githubusercontent.com/moby/moby/19.03/profiles/seccomp/default.json && \
sed -i 's/SCMP_ACT_ERRNO/SCMP_ACT_TRACE/g' /etc/docker/default.json && \
chmod 600 /etc/docker/default.json && \
apk del .build-deps && \
rm -rf /var/cache/apk/* && \
rm -rf /tmp/*
ADD release/linux/arm/drone-docker /bin/
ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "/bin/drone-docker"]

View File

@@ -5,7 +5,7 @@ local test_pipeline_name = 'testing';
local windows(os) = os == 'windows';
local golang_image(os, version) =
'golang:' + '1.11' + if windows(os) then '-windowsservercore-' + version else '';
'golang:' + '1.13' + if windows(os) then '-windowsservercore-' + version else '';
{
test(os='linux', arch='amd64', version='')::