platform: linux/amd64

labels:
  type: exec
 
pipeline:
- name: generate-manifest
  image: bash
  commands:
  - sed -i "s/{{project}}/telegraf/g" .woodpecker/manifest.tmpl
  - sed -i "s/registry.drycc.cc/$${DRYCC_REGISTRY}/g" .woodpecker/manifest.tmpl
  secrets:
  - drycc_registry
  when:
    event:
    - tag
    - push

- name: publish-manifest
  image: bash
  commands:
  - docker run --rm
    -e PLUGIN_SPEC=.woodpecker/manifest.tmpl
    -e PLUGIN_USERNAME=$CONTAINER_USERNAME
    -e PLUGIN_PASSWORD=$CONTAINER_PASSWORD
    -v $(pwd):$(pwd)
    -w $(pwd)
    plugins/manifest
  secrets:
  - container_username
  - container_password
  when:
    event:
    - tag
    - push

depends_on:
- build-linux
