---
kind: pipeline
type: docker

platform:
  os: linux
  arch: amd64

steps:
  - name: validator
    image: plugins/docker
    settings:
      registry: registry.itzana.me
      repo: registry.itzana.me/strafesnet/maptest-frontend
      dockerfile: validation/Containerfile
      context: validation
      tags:
        - ${DRONE_BRANCH}-${DRONE_BUILD_NUMBER}
        - ${DRONE_BRANCH}
      username:
        from_secret: REGISTRY_USER
      password:
        from_secret: REGISTRY_PASS
    # when:
    #   branch:
    #     - master
    #     - staging

  - name: api
    image: plugins/docker
    settings:
      registry: registry.itzana.me
      repo: registry.itzana.me/strafesnet/maptest-api
      dockerfile: Containerfile
      tags:
        - ${DRONE_BRANCH}-${DRONE_BUILD_NUMBER}
        - ${DRONE_BRANCH}
      username:
        from_secret: REGISTRY_USER
      password:
        from_secret: REGISTRY_PASS
    # when:
    #   branch:
    #     - master
    #     - staging

  - name: frontend
    image: plugins/docker
    settings:
      registry: registry.itzana.me
      repo: registry.itzana.me/strafesnet/maptest-frontend
      dockerfile: web/Containerfile
      context: web
      tags:
        - ${DRONE_BRANCH}-${DRONE_BUILD_NUMBER}
        - ${DRONE_BRANCH}
      username:
        from_secret: REGISTRY_USER
      password:
        from_secret: REGISTRY_PASS
    # when:
    #   branch:
    #     - master
    #     - staging

  - name: deploy
    image: argoproj/argocd:latest
    commands:
      - ${DRONE_BRANCH}-${DRONE_BUILD_NUMBER}
      # - argocd login --grpc-web cd.stricity.com --username $USERNAME --password $PASSWORD
      # - argocd app --grpc-web set ${DRONE_BRANCH}-game-rpc --kustomize-image registry.itzana.me/strafesnet/game-rpc:${DRONE_BRANCH}-${DRONE_BUILD_NUMBER}
    environment:
      USERNAME:
        from_secret: ARGO_USER
      PASSWORD:
        from_secret: ARGO_PASS
    depends_on:
      - api
      - frontend
      - validator
    # when:
    #   branch:
    #     - master
    #     - staging
---
kind: signature
hmac: d2845b87fe2734a09a5e0630488bf75e5724c284ac892f6278145e498cacfc77

...