diff --git a/.drone.yml b/.drone.yml index 42b27ca..1835896 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,8 +1,165 @@ -pipeline: - docker: - image: plugins/docker - secrets: [ docker_username, docker_password ] - repo: lucap/drone-netlify +--- +kind: pipeline +name: linux-amd64 + +platform: + os: linux + arch: amd64 + +steps: +- name: dryrun + pull: always + image: plugins/docker:linux-amd64 + settings: + dry_run: true + password: + from_secret: docker_password + repo: techknowlogick/drone-netlify + tags: linux-amd64 + username: + from_secret: docker_username + when: + event: + - pull_request + +- name: publish + pull: always + image: plugins/docker:linux-amd64 + settings: auto_tag: true - when: - event: tag + auto_tag_suffix: linux-amd64 + password: + from_secret: docker_password + repo: techknowlogick/drone-netlify + username: + from_secret: docker_username + when: + event: + - push + - tag + +trigger: + branch: + - master + +--- +kind: pipeline +name: linux-arm64 + +platform: + os: linux + arch: arm64 + +steps: +- name: dryrun + pull: always + image: plugins/docker:linux-arm64 + settings: + dry_run: true + password: + from_secret: docker_password + repo: techknowlogick/drone-netlify + tags: linux-arm64 + username: + from_secret: docker_username + when: + event: + - pull_request + +- name: publish + pull: always + image: plugins/docker:linux-arm64 + settings: + auto_tag: true + auto_tag_suffix: linux-arm64 + password: + from_secret: docker_password + repo: techknowlogick/drone-netlify + username: + from_secret: docker_username + when: + event: + - push + - tag + +trigger: + branch: + - master + +--- +kind: pipeline +name: linux-arm + +platform: + os: linux + arch: arm + +steps: +- name: dryrun + pull: always + image: plugins/docker:linux-arm + settings: + dry_run: true + password: + from_secret: docker_password + repo: techknowlogick/drone-netlify + tags: linux-arm + username: + from_secret: docker_username + when: + event: + - pull_request + +- name: publish + pull: always + image: plugins/docker:linux-arm + settings: + auto_tag: true + auto_tag_suffix: linux-arm + password: + from_secret: docker_password + repo: techknowlogick/drone-netlify + username: + from_secret: docker_username + when: + event: + - push + - tag + +trigger: + branch: + - master + +--- +kind: pipeline +name: notifications + +platform: + os: linux + arch: amd64 + +steps: +- name: manifest + pull: always + image: plugins/manifest:1 + settings: + ignore_missing: true + password: + from_secret: docker_password + spec: manifest.tmpl + username: + from_secret: docker_username + +trigger: + branch: + - master + event: + - push + - tag + +depends_on: +- linux-amd64 +- linux-arm64 +- linux-arm + +... diff --git a/Dockerfile b/Dockerfile index 2217335..f6b1459 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,12 @@ -FROM node:alpine +FROM node:10-alpine3.11 -LABEL maintainer="Luca Perret " +LABEL maintainer="techknowlogick " LABEL org.label-schema.version=latest -LABEL org.label-schema.vcs-url="https://github.com/lucaperret/drone-netlify" +LABEL org.label-schema.vcs-url="https://github.com/techknowlogick/drone-netlify" LABEL org.label-schema.name="drone-netlify" LABEL org.label-schema.description="Deploying to netlify with Drone CI" -LABEL org.label-schema.vendor="Luca Perret" -LABEL org.label-schema.schema-version="1.0" +LABEL org.label-schema.vendor="techknowlogick" +LABEL org.label-schema.schema-version="2.0" RUN npm install -g netlify-cli diff --git a/manifest.tmpl b/manifest.tmpl new file mode 100644 index 0000000..b383a66 --- /dev/null +++ b/manifest.tmpl @@ -0,0 +1,25 @@ +image: techknowlogick/drone-netlify:{{#if build.tag}}{{trimPrefix build.tag "v"}}{{else}}latest{{/if}} +{{#if build.tags}} +tags: +{{#each build.tags}} + - {{this}} +{{/each}} +{{/if}} +manifests: + - + image: techknowlogick/drone-netlify:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}linux-amd64 + platform: + architecture: amd64 + os: linux + - + image: techknowlogick/drone-netlify:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}linux-arm64 + platform: + architecture: arm64 + os: linux + variant: v8 + - + image: techknowlogick/drone-netlify:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}linux-arm + platform: + architecture: arm + os: linux + variant: v7