kind: pipeline
type: exec
name: linux-amd64

platform:
  arch: amd64
  os: linux

steps:
- name: check
  commands:
  - mkdir -p $HOMEPATH/.docker; echo $IMAGE_PULL_SECRETS > $HOMEPATH/.docker/config.json
  - docker run --rm
      -e GITHUB_TOKEN=$GITHUB_TOKEN
      -v "$(pwd):$(pwd)"
      -w "$(pwd)"
      drycc/python-dev
      python scripts/checker.py
  environment:
    GITHUB_TOKEN:
      from_secret: github_token
    DEV_REGISTRY:
      from_secret: dev_registry
    DRYCC_REGISTRY:
      from_secret: drycc_registry
    IMAGE_PULL_SECRETS:
      from_secret: container_pull_secrets
  when:
    event:
    - cron

- name: publish
  commands:
  - mkdir -p $HOMEPATH/.docker; echo $IMAGE_PULL_SECRETS > $HOMEPATH/.docker/config.json
  - CODENAME=bullseye ./build.sh all ${DRONE_TAG}
  environment:
    OSS_ENDPOINT:
      from_secret: oss_endpoint
    OSS_ACCESS_KEY_ID:
      from_secret: oss_access_key_id
    OSS_ACCESS_KEY_SECRET:
      from_secret: oss_access_key_secret
    IMAGE_PULL_SECRETS:
      from_secret: container_pull_secrets
  when:
    event:
    - tag

---
kind: pipeline
type: exec
name: linux-arm64

platform:
  arch: arm64
  os: linux

steps:
- name: publish
  commands:
  - mkdir -p $HOMEPATH/.docker; echo $IMAGE_PULL_SECRETS > $HOMEPATH/.docker/config.json
  - CODENAME=bullseye ./build.sh all ${DRONE_TAG}
  environment:
    OSS_ENDPOINT:
      from_secret: oss_endpoint
    OSS_ACCESS_KEY_ID:
      from_secret: oss_access_key_id
    OSS_ACCESS_KEY_SECRET:
      from_secret: oss_access_key_secret
    IMAGE_PULL_SECRETS:
      from_secret: container_pull_secrets
  when:
    event:
    - tag