index : static-web-server.git

ascending towards madness

author Jose Quintana <joseluisquintana20@gmail.com> 2020-04-02 12:42:53.0 +00:00:00
committer Jose Quintana <joseluisquintana20@gmail.com> 2020-04-02 12:42:53.0 +00:00:00
commit
bb15a6da197d24094dd85875c91cc0e117f647cf [patch]
tree
3a9b9cb987675053a443c1aef0459fc0cf12a39e
parent
1b0d48fa209ec088de030c48c37b84c7e1d1b821
download
bb15a6da197d24094dd85875c91cc0e117f647cf.tar.gz

refactor: update drone config to v1



Diff

 .drone.yml | 180 +++++++++++++++++++++++---------------------------------------
 1 file changed, 69 insertions(+), 111 deletions(-)

diff --git a/.drone.yml b/.drone.yml
index 6d62015..a5762a9 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -1,122 +1,80 @@
pipeline:
    restore-cache:
        image: drillster/drone-volume-cache
        restore: true
        mount:
            - /home/rust/.cargo/git
            - /home/rust/.cargo/registry
            - ./target
        volumes:
            - /tmp/cache:/cache
---
kind: pipeline
type: docker
name: development

    # DEVELOPMENT
platform:
  os: linux
  arch: amd64

    test:
        image: joseluisq/rust-linux-darwin-builder:1.41.1
        group: development
        commands:
            - make test
        when:
            event: push
steps:
- name: restore-cache
  image: drillster/drone-volume-cache
  volumes:
    - name: cache
      path: /cache
  settings:
    restore: true
    mount:
      - /home/rust/.cargo/git
      - /home/rust/.cargo/registry
      - ./target

    # PRODUCTION
- name: test
  image: joseluisq/rust-linux-darwin-builder:1.41.1
  commands:
    - make test

    build-release:
        image: joseluisq/rust-linux-darwin-builder:1.41.1
        group: production
        commands:
            - make prod.release
        when:
            event: tag
- name: rebuild-cache
  image: drillster/drone-volume-cache
  volumes:
    - name: cache
      path: /cache
  settings:
    rebuild: true
    mount:
      - /home/rust/.cargo/git
      - /home/rust/.cargo/registry
      - ./target

    publish-image-scratch:
        image: plugins/docker
        group: production
        registry: registry.joseluisq.net
        repo: registry.joseluisq.net/static-web-server
        dockerfile: ./docker/scratch/Dockerfile
        username:
            from_secret: registry_username
        password:
            from_secret: registry_password
        auto_tag: true
        build_args:
            - DOCKER_IMAGE_VERSION=${DRONE_TAG}
        when:
            event: tag
volumes:
  - name: cache
    host:
      path: /tmp/cache

    publish-image-alpine:
        image: plugins/docker
        group: production
        registry: registry.joseluisq.net
        repo: registry.joseluisq.net/static-web-server
        dockerfile: ./docker/alpine/Dockerfile
        username:
            from_secret: registry_username
        password:
            from_secret: registry_password
        auto_tag: true
        auto_tag_suffix: alpine
        build_args:
            - DOCKER_IMAGE_VERSION=${DRONE_TAG}-alpine
        when:
            event: tag
trigger:
  event:
    - push
    - pull_request
  branch:
    - master
    - develop
    - feature/*
    - bugfix/*
    - hotfix/*

    publish-gitea-release:
        image: plugins/gitea-release
        group: production
        api_key:
            from_secret: gitea_token
        base_url: https://git.joseluisq.net/
        files:
            - ./bin/*.tar.gz
            - ./bin/*.zip
            - ./bin/*-SHA256SUM
        prerelease: true
        when:
            event: tag

    publish-image-scratch-docker-hub:
        image: plugins/docker
        group: production
        repo: joseluisq/static-web-server
        dockerfile: ./docker/scratch/Dockerfile
        username:
            from_secret: dockerhub_username
        password:
            from_secret: dockerhub_password
        auto_tag: true
        when:
            event: tag
---
kind: pipeline
type: docker
name: notification

    publish-image-alpine-docker-hub:
        image: plugins/docker
        group: production
        repo: joseluisq/static-web-server
        dockerfile: ./docker/alpine/Dockerfile
        username:
            from_secret: dockerhub_username
        password:
            from_secret: dockerhub_password
        auto_tag: true
        auto_tag_suffix: alpine
        when:
            event: tag
platform:
  os: linux
  arch: amd64

    notification-slack:
        image: plugins/slack
        webhook:
            from_secret: slack_webhook
        channel: ci-cd
        when:
            status: [success, failure]
steps:
- name: notify
  image: plugins/slack
  settings:
    webhook:
      from_secret: slack_webhook
    channel: ci-cd

    rebuild-cache:
        image: drillster/drone-volume-cache
        rebuild: true
        mount:
            - /home/rust/.cargo/git
            - /home/rust/.cargo/registry
            - ./target
        volumes:
            - /tmp/cache:/cache
depends_on:
- development

trigger:
  status:
  - success
  - failure