<commit_before>---
kind: pipeline
type: docker
name: default

steps:
  - name: submodules
    image: docker:git
    environment:
      GIT_USERNAME:
        from_secret: git_username
      GIT_PASSWORD:
        from_secret: git_password
    commands:
      - git config submodule.secret.url https://$GIT_USERNAME:$GIT_PASSWORD@zxq.co/ripple/lets-secret.git
      - git config submodule.pp/maniapp-osu-tools.url https://$GIT_USERNAME:$GIT_PASSWORD@zxq.co/ripple/maniapp-osu-tools.git
      - git submodule update --init
      - cd pp/maniapp-osu-tools && git config submodule.osu.url https://$GIT_USERNAME:$GIT_PASSWORD@zxq.co/ripple/maniapp-osu.git && cd ../..
      - git submodule update --init --recursive
    secrets: [ git_username, git_password ]

  - name: prepare-docker
    image: docker:git
    environment:
      GIT_USERNAME:
        from_secret: git_username
      GIT_PASSWORD:
        from_secret: git_password
    commands:
      - git submodule update --init --recursive
      - mkdir -p /cache/${DRONE_REPO}/docker
      - git clone https://$GIT_USERNAME:$GIT_PASSWORD@zxq.co/ripple/dockerfiles /dockerfiles
      - cat version | tr -d '\n' > .tags
      - cp /dockerfiles/dockerfiles/lets.Dockerfile Dockerfile
    volumes:
      - name: cache
        path: /cache
    secrets: [ git_username, git_password ]

  - name: package-docker
    image: plugins/docker
    settings:
      username:
        from_secret: docker_username
      password:
        from_secret: docker_password
      registry: d.nyodev.xyz
      repo: d.nyodev.xyz/ripple/lets
      use_cache: true
      purge: false
    secrets: [ docker_username, docker_password ]
    volumes:
      - name: docker
        path: /var/lib/docker

volumes:
  - name: cache
    host:
      path: /var/cache
  - name: docker
    host:
      path: /var/cache/${DRONE_REPO}/docker<commit_msg>Add deploy pipeline step to .drone.yml<commit_after>---
kind: pipeline
type: docker
name: default

steps:
  - name: submodules
    image: docker:git
    environment:
      GIT_USERNAME:
        from_secret: git_username
      GIT_PASSWORD:
        from_secret: git_password
    commands:
      - git config submodule.secret.url https://$GIT_USERNAME:$GIT_PASSWORD@zxq.co/ripple/lets-secret.git
      - git config submodule.pp/maniapp-osu-tools.url https://$GIT_USERNAME:$GIT_PASSWORD@zxq.co/ripple/maniapp-osu-tools.git
      - git submodule update --init
      - cd pp/maniapp-osu-tools && git config submodule.osu.url https://$GIT_USERNAME:$GIT_PASSWORD@zxq.co/ripple/maniapp-osu.git && cd ../..
      - git submodule update --init --recursive
    secrets: [ git_username, git_password ]
    when:
      event:
        - push

  - name: prepare-docker
    image: docker:git
    environment:
      GIT_USERNAME:
        from_secret: git_username
      GIT_PASSWORD:
        from_secret: git_password
    commands:
      - git submodule update --init --recursive
      - mkdir -p /cache/${DRONE_REPO}/docker
      - git clone https://$GIT_USERNAME:$GIT_PASSWORD@zxq.co/ripple/dockerfiles /dockerfiles
      - cat version | tr -d '\n' > .tags
      - cp /dockerfiles/dockerfiles/lets.Dockerfile Dockerfile
    volumes:
      - name: cache
        path: /cache
    secrets: [ git_username, git_password ]

  - name: package-docker
    image: plugins/docker
    settings:
      username:
        from_secret: docker_username
      password:
        from_secret: docker_password
      registry: d.nyodev.xyz
      repo: d.nyodev.xyz/ripple/lets
      use_cache: true
      purge: false
    secrets: [ docker_username, docker_password ]
    volumes:
      - name: docker
        path: /var/lib/docker
    when:
      event:
        - push

  - name: deploy
    image: d.nyodev.xyz/ripple-drone/deploy
    settings:
      service: hanayo
      secret:
        from_secret: deploy_secret
      url:
        from_secret: deploy_url
    secrets: [deploy_secret, deploy_url]
    when:
      event:
        - promote
      target:
        - production

image_pull_secrets:
  - docker_registry_credentials

volumes:
  - name: cache
    host:
      path: /var/cache
  - name: docker
    host:
      path: /var/cache/${DRONE_REPO}/docker
{'fraction_non_alphanumeric': 0.1034647550776583, 'fraction_numerical': 0.0, 'mean_word_length': 2.3381180223285485, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 8, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6733189', 'n_tokens_mistral': 1463, 'n_tokens_neox': 1389, 'n_words': 285}