From 59597353540898fc0445b150e1d2623234b9b245 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Fri, 27 Nov 2020 14:13:11 +0100 Subject: [PATCH] add dockerhub auth for ci --- .drone.jsonnet | 15 +++++++-- .drone.yml | 86 ++++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 82 insertions(+), 19 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index 48e08ee..de357fe 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -17,6 +17,7 @@ local PythonVersion(pyversion='3.5') = { local PipelineLint = { kind: 'pipeline', + image_pull_secrets: ['docker_config'], name: 'lint', platform: { os: 'linux', @@ -43,6 +44,7 @@ local PipelineLint = { local PipelineTest = { kind: 'pipeline', + image_pull_secrets: ['docker_config'], name: 'test', platform: { os: 'linux', @@ -65,6 +67,7 @@ local PipelineTest = { local PipelineSecurity = { kind: 'pipeline', + image_pull_secrets: ['docker_config'], name: 'security', platform: { os: 'linux', @@ -94,6 +97,7 @@ local PipelineSecurity = { local PipelineBuildPackage = { kind: 'pipeline', + image_pull_secrets: ['docker_config'], name: 'build-package', platform: { os: 'linux', @@ -152,6 +156,7 @@ local PipelineBuildPackage = { local PipelineBuildContainer(arch='amd64') = { kind: 'pipeline', + image_pull_secrets: ['docker_config'], name: 'build-container-' + arch, platform: { os: 'linux', @@ -167,8 +172,9 @@ local PipelineBuildContainer(arch='amd64') = { }, { name: 'dryrun', - image: 'plugins/docker:18-linux-' + arch, + image: 'plugins/docker:19', settings: { + config: { from_secret: 'docker_config' }, dry_run: true, dockerfile: 'docker/Dockerfile', repo: 'thegeeklab/${DRONE_REPO_NAME}', @@ -182,8 +188,9 @@ local PipelineBuildContainer(arch='amd64') = { }, { name: 'publish-dockerhub', - image: 'plugins/docker:18-linux-' + arch, + image: 'plugins/docker:19', settings: { + config: { from_secret: 'docker_config' }, auto_tag: true, auto_tag_suffix: arch, dockerfile: 'docker/Dockerfile', @@ -198,8 +205,9 @@ local PipelineBuildContainer(arch='amd64') = { }, { name: 'publish-quay', - image: 'plugins/docker:18-linux-' + arch, + image: 'plugins/docker:19', settings: { + config: { from_secret: 'docker_config' }, auto_tag: true, auto_tag_suffix: arch, dockerfile: 'docker/Dockerfile', @@ -224,6 +232,7 @@ local PipelineBuildContainer(arch='amd64') = { local PipelineNotifications = { kind: 'pipeline', + image_pull_secrets: ['docker_config'], name: 'notifications', platform: { os: 'linux', diff --git a/.drone.yml b/.drone.yml index 723bb1a..0551e2a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -8,7 +8,7 @@ platform: steps: - name: flake8 - image: python:3.8 + image: python:3.9 commands: - pip install -r dev-requirements.txt -qq - pip install -qq . @@ -16,6 +16,9 @@ steps: environment: PY_COLORS: 1 +image_pull_secrets: +- docker_config + trigger: ref: - refs/heads/master @@ -79,6 +82,21 @@ steps: depends_on: - clone +- name: python39-pytest + image: python:3.9 + commands: + - pip install -r dev-requirements.txt -qq + - pip install -qq . + - docker-autotag --help + - docker-autotag --version + environment: + PY_COLORS: 1 + depends_on: + - clone + +image_pull_secrets: +- docker_config + trigger: ref: - refs/heads/master @@ -98,7 +116,7 @@ platform: steps: - name: bandit - image: python:3.8 + image: python:3.9 commands: - pip install -r dev-requirements.txt -qq - pip install -qq . @@ -106,6 +124,9 @@ steps: environment: PY_COLORS: 1 +image_pull_secrets: +- docker_config + trigger: ref: - refs/heads/master @@ -125,7 +146,7 @@ platform: steps: - name: build - image: python:3.8 + image: python:3.9 commands: - python setup.py sdist bdist_wheel @@ -162,6 +183,9 @@ steps: ref: - refs/tags/** +image_pull_secrets: +- docker_config + trigger: ref: - refs/heads/master @@ -181,13 +205,15 @@ platform: steps: - name: build - image: python:3.8 + image: python:3.9 commands: - python setup.py bdist_wheel - name: dryrun - image: plugins/docker:18-linux-amd64 + image: plugins/docker:19 settings: + config: + from_secret: docker_config dockerfile: docker/Dockerfile dry_run: true password: @@ -202,10 +228,12 @@ steps: - build - name: publish-dockerhub - image: plugins/docker:18-linux-amd64 + image: plugins/docker:19 settings: auto_tag: true auto_tag_suffix: amd64 + config: + from_secret: docker_config dockerfile: docker/Dockerfile password: from_secret: docker_password @@ -220,10 +248,12 @@ steps: - dryrun - name: publish-quay - image: plugins/docker:18-linux-amd64 + image: plugins/docker:19 settings: auto_tag: true auto_tag_suffix: amd64 + config: + from_secret: docker_config dockerfile: docker/Dockerfile password: from_secret: quay_password @@ -238,6 +268,9 @@ steps: depends_on: - dryrun +image_pull_secrets: +- docker_config + trigger: ref: - refs/heads/master @@ -257,13 +290,15 @@ platform: steps: - name: build - image: python:3.8 + image: python:3.9 commands: - python setup.py bdist_wheel - name: dryrun - image: plugins/docker:18-linux-arm64 + image: plugins/docker:19 settings: + config: + from_secret: docker_config dockerfile: docker/Dockerfile dry_run: true password: @@ -278,10 +313,12 @@ steps: - build - name: publish-dockerhub - image: plugins/docker:18-linux-arm64 + image: plugins/docker:19 settings: auto_tag: true auto_tag_suffix: arm64 + config: + from_secret: docker_config dockerfile: docker/Dockerfile password: from_secret: docker_password @@ -296,10 +333,12 @@ steps: - dryrun - name: publish-quay - image: plugins/docker:18-linux-arm64 + image: plugins/docker:19 settings: auto_tag: true auto_tag_suffix: arm64 + config: + from_secret: docker_config dockerfile: docker/Dockerfile password: from_secret: quay_password @@ -314,6 +353,9 @@ steps: depends_on: - dryrun +image_pull_secrets: +- docker_config + trigger: ref: - refs/heads/master @@ -333,13 +375,15 @@ platform: steps: - name: build - image: python:3.8 + image: python:3.9 commands: - python setup.py bdist_wheel - name: dryrun - image: plugins/docker:18-linux-arm + image: plugins/docker:19 settings: + config: + from_secret: docker_config dockerfile: docker/Dockerfile dry_run: true password: @@ -354,10 +398,12 @@ steps: - build - name: publish-dockerhub - image: plugins/docker:18-linux-arm + image: plugins/docker:19 settings: auto_tag: true auto_tag_suffix: arm + config: + from_secret: docker_config dockerfile: docker/Dockerfile password: from_secret: docker_password @@ -372,10 +418,12 @@ steps: - dryrun - name: publish-quay - image: plugins/docker:18-linux-arm + image: plugins/docker:19 settings: auto_tag: true auto_tag_suffix: arm + config: + from_secret: docker_config dockerfile: docker/Dockerfile password: from_secret: quay_password @@ -390,6 +438,9 @@ steps: depends_on: - dryrun +image_pull_secrets: +- docker_config + trigger: ref: - refs/heads/master @@ -480,6 +531,9 @@ steps: - success - failure +image_pull_secrets: +- docker_config + trigger: ref: - refs/heads/master @@ -496,6 +550,6 @@ depends_on: --- kind: signature -hmac: 93168b5700329526d2bf3ca76df7db876db4d2cd9f3332fec0c17b2d7244221b +hmac: d9b5c4f8f10284f81bea1041a8e2d5ea17ac134c16f4cd7a5a77c3bddb5ae17d ...