kind: pipeline
type: docker
name: default

steps:
  - name: build-dotnet
    image: alpine
    commands:
      - echo "Docker build will handle dotnet publish"

  - name: build-docker
    image: plugins/docker
    settings:
      registry: 192.168.1.9:3000
      repo: 192.168.1.9:3000/tai/aberwyn/aberwyn
      username:
        from_secret: gitea_username
      password:
        from_secret: gitea_token
      dockerfile: Aberwyn/Dockerfile
      context: .
      tags:
        - latest
      insecure: true

  - name: notify-result
    image: alpine
    when:
      status:
        - success
        - failure
    commands:
      - apk add --no-cache curl
      - |
        if [ "$DRONE_BUILD_STATUS" = "success" ]; then
          curl -X POST http://192.168.1.196:8123/api/webhook/aberwyn_update_success
        else
          curl -X POST http://192.168.1.196:8123/api/webhook/aberwyn_update_failed
        fi

trigger:
  branch:
    - master
