version: v1.0
name: libcalico-go

execution_time_limit:
  hours: 4

agent:
  machine:
    type: e1-standard-2
    os_image: ubuntu1804
global_job_config:
  secrets:
  - name: docker-hub
  prologue:
    commands:
    - echo $DOCKERHUB_PASSWORD | docker login --username "$DOCKERHUB_USERNAME" --password-stdin

blocks:
  - name: Build
    execution_time_limit:
      minutes: 120
    dependencies: []
    task:
      jobs:
        - name: Build
          commands:
            - checkout
            - make ci

  - name: Trigger pin updates
    execution_time_limit:
      minutes: 5
    dependencies: []
    skip:
      when: "(branch != 'master') and (branch !~ '^release-v\d*\.\d*')"
    task:
      secrets:
        - name: semaphore-api
      jobs:
        - name: Trigger pin updates
          commands:
            - checkout
            - make semaphore-run-auto-pin-update-workflows
