index : static-web-server.git

ascending towards madness

---
kind: pipeline
type: docker
name: development

platform:
  os: linux
  arch: amd64

steps:
- name: test
  image: joseluisq/rust-linux-darwin-builder:1.53.0
  volumes:
    - name: cargo-target
      path: /drone/src/target
    - name: cargo-git
      path: /root/.cargo/git
    - name: cargo-registry
      path: /root/.cargo/registry
  commands:
    - make test

volumes:
  - name: cargo-target
    host:
      path: /var/ci-volumes/cargo-target
  - name: cargo-git
    host:
      path: /var/ci-volumes/cargo-git
  - name: cargo-registry
    host:
      path: /var/ci-volumes/cargo-registry

trigger:
  event:
    - push
    - pull_request
  branch:
    - master
    - develop
    - feature/*
    - bugfix/*
    - hotfix/*



---
kind: pipeline
type: docker
name: production

platform:
  os: linux
  arch: amd64

steps:
- name: publish-public-alpine
  image: joseluisq/drone-docker
  privileged: true
  settings:
    repo: joseluisq/static-web-server
    dockerfile: ./docker/alpine/Dockerfile
    username:
      from_secret: dockerhub_username
    password:
      from_secret: dockerhub_password
    build_args:
      - SERVER_VERSION=${DRONE_TAG##v}
    auto_tag: true
    auto_tag_suffix: alpine

- name: publish-public-scratch
  image: joseluisq/drone-docker
  privileged: true
  settings:
    repo: joseluisq/static-web-server
    dockerfile: ./docker/scratch/Dockerfile
    username:
      from_secret: dockerhub_username
    password:
      from_secret: dockerhub_password
    build_args:
      - SERVER_VERSION=${DRONE_TAG##v}
    auto_tag: true
    auto_tag_aliases:
      - latest

- name: publish-alpine
  image: joseluisq/drone-docker
  privileged: true
  settings:
    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
    build_args:
      - SERVER_VERSION=${DRONE_TAG##v}
    auto_tag: true
    auto_tag_suffix: alpine

- name: publish-scratch
  image: joseluisq/drone-docker
  privileged: true
  settings:
    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
    build_args:
      - SERVER_VERSION=${DRONE_TAG##v}
    auto_tag: true
    auto_tag_aliases:
      - latest

trigger:
  ref:
    include:
    - refs/tags/v*
    exclude:
    - refs/tags/**rc**
    - refs/tags/**alpha**
    - refs/tags/**beta**
    - refs/tags/**latest**
    - refs/tags/**dev**



---
kind: pipeline
type: docker
name: production-beta

platform:
  os: linux
  arch: amd64

steps:
- name: publish-public-alpine
  image: joseluisq/drone-docker
  privileged: true
  settings:
    repo: joseluisq/static-web-server
    dockerfile: ./docker/alpine/Dockerfile
    username:
      from_secret: dockerhub_username
    password:
      from_secret: dockerhub_password
    build_args:
      - SERVER_VERSION=${DRONE_TAG##v}
    auto_tag: true
    auto_tag_suffix: alpine

- name: publish-public-scratch
  image: joseluisq/drone-docker
  privileged: true
  settings:
    repo: joseluisq/static-web-server
    dockerfile: ./docker/scratch/Dockerfile
    username:
      from_secret: dockerhub_username
    password:
      from_secret: dockerhub_password
    build_args:
      - SERVER_VERSION=${DRONE_TAG##v}
    auto_tag: true

- name: publish-alpine
  image: joseluisq/drone-docker
  privileged: true
  settings:
    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
    build_args:
      - SERVER_VERSION=${DRONE_TAG##v}
    auto_tag: true
    auto_tag_suffix: alpine

- name: publish-scratch
  image: joseluisq/drone-docker
  privileged: true
  settings:
    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
    build_args:
      - SERVER_VERSION=${DRONE_TAG##v}
    auto_tag: true

trigger:
  ref:
    include:
    - refs/tags/**beta**



---
kind: pipeline
type: docker
name: notification

platform:
  os: linux
  arch: amd64

clone:
  disable: true

steps:
- name: notify
  image: plugins/slack
  settings:
    webhook:
      from_secret: slack_webhook
    channel: ci-cd

depends_on:
- development
- production
- production-beta

trigger:
  status:
  - success
  - failure