Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drone caching #334

Merged
merged 8 commits into from
Sep 24, 2019
56 changes: 34 additions & 22 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,53 @@
kind: pipeline
name: default

globals:
- &docker_settings
username:
from_secret: docker_username
password:
from_secret: docker_password
registry: quay.io
repo: quay.io/natlibfi/annif

steps:

- name: build
- name: dry_run_build
image: plugins/docker
settings:
dockerfile: Dockerfile
username:
from_secret: docker_username
password:
from_secret: docker_password
registry: quay.io
repo: quay.io/natlibfi/annif
<<: *docker_settings
tags: [dry-run-built]
cache_from:
- quay.io/natlibfi/annif:builder
- quay.io/natlibfi/annif:latest
dry_run: true
when:
event:
- push
- pull_request

- name: build_and_publish_builder
image: plugins/docker
settings:
<<: *docker_settings
tags: [builder]
cache_from:
- quay.io/natlibfi/annif:builder
target: builder
when:
branch:
- master
event:
- push

- name: build_and_publish
image: plugins/docker
settings:
dockerfile: Dockerfile
username:
from_secret: docker_username
password:
from_secret: docker_password
registry: quay.io
repo: quay.io/natlibfi/annif
<<: *docker_settings
tags: [latest]
cache_from:
- quay.io/natlibfi/annif:builder
- quay.io/natlibfi/annif:latest
when:
branch:
- master
Expand All @@ -39,13 +57,7 @@ steps:
- name: build_publish_and_tag_with_release_version
image: plugins/docker
settings:
dockerfile: Dockerfile
username:
from_secret: docker_username
password:
from_secret: docker_password
registry: quay.io
repo: quay.io/natlibfi/annif
<<: *docker_settings
auto_tag: true
when:
branch:
Expand Down