version: 2.1
resource_types:
  # Set status of build in github for master
  - name: github-status
    type: docker-image
    source:
      repository: dpb587/github-status-resource
      tag: master

resources:
  - name: code
    type: git
    source:
      uri: https://github.com/phpdocker-io/kong-certbot-agent.git
      branch: master

  - name: master-status
    type: github-status
    source:
      repository: phpdocker-io/kong-certbot-agent
      branch: master
      access_token: {{github-access-token}}

jobs:
  - name: analyze-master
    public: true
    plan:
      - get: code
        trigger: true

      - put: notify-master-being-built
        resource: master-status
        params: { state: "pending", commit: "code" }

      - task: run tests
        file: code/concourse/task-run-tests.yaml

        on_failure:
          put: master-status
          params: { state: "failure", commit: "code" }

      - put: notify-build-success
        resource: master-status
        params: { state: "success", commit: "code" }

      - task: code coverage reports
        params:
          CODECOV_TOKEN: {{codecov-token}}
        file: code/concourse/task-codecov.yaml

version: 2.1
resource_types:
  # Set status of build in github for master
  - name: github-status
    type: docker-image
    source:
      repository: dpb587/github-status-resource
      tag: master

resources:
  - name: code
    type: git
    source:
      uri: https://github.com/phpdocker-io/kong-certbot-agent.git
      branch: master

  - name: master-status
    type: github-status
    source:
      repository: phpdocker-io/kong-certbot-agent
      branch: master
      access_token: {{github-access-token}}

  # Docker hub
  - name: container-registry
    type: docker-image
    source:
      email: {{docker-hub-email}}
      username: {{docker-hub-user}}
      password: {{docker-hub-password}}
      repository: phpdockerio/kong-certbot-agent

jobs:
  - name: analyze-master
    public: true
    plan:
      - get: code
        trigger: true

      - put: notify-master-being-built
        resource: master-status
        params: { state: "pending", commit: "code" }

      - task: run tests
        file: code/concourse/task-run-tests.yaml

        on_failure:
          put: master-status
          params: { state: "failure", commit: "code" }

      - put: notify-build-success
        resource: master-status
        params: { state: "success", commit: "code" }

      - put: container-registry
        params:
          build: code
          tag_as_latest: true
          additional_tags: code/release

      - task: code coverage reports
        params:
          CODECOV_TOKEN: {{codecov-token}}
        file: code/concourse/task-codecov.yaml

Add in versioned docker builds
Add in versioned docker builds
