# vim: filetype=yaml sw=2
git_hash: 'v[% c("version") %]'
git_url: https://github.com/mozilla/glean.git
filename: '[% project %]-[% c("version") %]-[% c("var/build_id") %].tar.[% c("compress_tar") %]'
version: '[% pc(c("origin_project"), "var/glean_version", { step => "list_toolchain_updates" }) %]'

src: |
  #!/bin/bash
  mv -f [% project %]-[% c('version') %].tar.[% c('compress_tar') %] [% dest_dir %]/[% c('filename') %]

var:
  # The `container-image` project looks at the deps list in origin_project
  # in the same step (build), so we cannot put this inside the
  # `create_glean_deps_tarball` step.
  # rbm#40020 should allow us to fix that.
  deps:
    - python3
    - python3-pip
    - torsocks
  glean_wheels_sha256sum:
    14.0.1: 95f01d0e158ae7968680029b7d9c2908895e1d1ec1ba4e6a044648a05af4ee0c
  glean_wheels_url:
    14.0.1: https://build-sources.tbb.torproject.org/glean-wheels-14.0.1.tar.xz

steps:
  create_glean_deps_tarball:
    git_url: ''
    version: 14.0.1
    filename: 'glean-wheels-[% c("version") %].tar.xz'
    build_log: '-'
    container:
      use_container: 1
    create_glean_deps_tarball: |
      #!/bin/bash
      [% c("var/set_default_env") -%]
      mkdir glean-wheels
      cd glean-wheels
      [% IF c("var/use_torsocks") %]torsocks [% END%]python3 -m pip download glean_parser==[% c("version") %]
      # Get pyyaml, needed for building application-services
      [% IF c("var/use_torsocks") %]torsocks [% END%]python3 -m pip download pyyaml==5.3.1
      cd ..
      [% c('tar', {
          tar_src => [ 'glean-wheels' ],
          tar_args => '-cJf ' _ dest_dir _ '/' _ c('filename'),
          }) %]
      cd '[% dest_dir %]'
      sha256sum [% c('filename') %]
      echo 'The file is ready to be uploaded: out/glean/[% c("filename") %]'
    input_files:
      - project: container-image
        pkg_type: build

targets:
  with_torsocks:
    use_torsocks: 1
