aboutsummaryrefslogtreecommitdiff
path: root/ldcg-python-manylinux-tensorflow/ansible/roles/tensorflow_text/tasks/fetch.yml
blob: 5eb36969ca51b126d7e1a8f13c2302e25bd278b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
---
- name: Fetch and unpack TensorFlow Text source archive
  when: tensorflow_text_version != 'git'
  block:
    - name: Fetch TensorFlow Text {{ tensorflow_text_version }} source
      ansible.builtin.get_url:
        url: "https://github.com/tensorflow/text/archive/refs/tags/v{{ tensorflow_text_version }}.tar.gz"
        dest: "{{ build_dir }}/text-{{ tensorflow_text_version }}.tar.gz"
        mode: 0600

    - name: Unpack TensorFlow Text {{ tensorflow_text_version }} source
      ansible.builtin.unarchive:
        src: "{{ build_dir }}/text-{{ tensorflow_text_version }}.tar.gz"
        dest: "{{ build_dir }}/"
        remote_src: true

- name: Fetch TensorFlow Text from git
  ansible.builtin.git:
    repo: "https://github.com/tensorflow/text.git"  # noqa latest[git]
    dest: "{{ build_dir }}/text-{{ tensorflow_text_version }}/"
    depth: 1
    recursive: true
    force: true
    version: "{{ tensorflow_text_git_version }}"
  when: tensorflow_text_version == 'git'

- name: Patch the source to work
  ansible.builtin.lineinfile:
    path:  "{{ build_dir }}/text-{{ tensorflow_text_version }}/oss_scripts/prepare_tf_dep.sh"
    regexp: '^(.*)(Browse the repository)(.*)$'
    line: '\1permalink\3'
    backrefs: true