|
38 | 38 | ansible.builtin.set_fact: |
39 | 39 | operator_api_path: "github.com/{{ cifmw_operator_build_org }}/{{ operator.name }}/{{ operator_base_module_name }}" |
40 | 40 |
|
| 41 | + |
| 42 | + # Copy the dep into openstack-operator/deps |
| 43 | + # This copies the prepared zuul repo into the meta operator dir, which gets copied into the build container |
| 44 | +- name: "{{ operator.name }} - Copy dependancy source into meta operator" |
| 45 | + ansible.builtin.shell: | |
| 46 | + git clone {{ operator.src }} deps/{{ operator_base_module_name }} |
| 47 | + args: |
| 48 | + chdir: "{{ cifmw_operator_build_meta_src }}" |
| 49 | + when: |
| 50 | + - operator.name != cifmw_operator_build_meta_name |
| 51 | + |
41 | 52 | # This is telling the openstack operator to look for dependency on a particular branch on github. |
42 | 53 | # This should be the zuul src path. |
| 54 | + # If we switch to using local sources, they need to be copied into the container for the build. |
| 55 | + # This can be done by copying the modified operator code into the openstack-operator dir |
| 56 | + # The replacement here will then point to ./deps/{{ operator_base_module_name }} |
43 | 57 | - name: "{{ operator.name }} - Update the go.mod file in meta operator for provided PR_SHA" # noqa: name[template] |
44 | 58 | ansible.builtin.shell: | |
45 | | - go mod edit -replace {{ operator_api_path }}={{ operator.src }}/{{ operator_base_module_name }} |
| 59 | + go mod edit -replace {{ operator_api_path }}=./deps/{{ operator_base_module_name }} |
46 | 60 | go mod tidy |
47 | 61 | if [ -d ./apis ]; then |
48 | 62 | pushd ./apis/ |
49 | | - go mod edit -replace {{ operator_api_path }}={{ operator.src }}/{{ operator_base_module_name }} |
| 63 | + go mod edit -replace {{ operator_api_path }}=./deps/{{ operator_base_module_name }} |
50 | 64 | go mod tidy |
51 | 65 | popd |
52 | 66 | fi |
|
78 | 92 |
|
79 | 93 | - name: "{{ operator.name }} - Update the go.mod file using latest commit if no PR is provided" # noqa: name[template] |
80 | 94 | ansible.builtin.shell: | |
81 | | - go mod edit -replace {{ operator_api_path }}={{ operator.src }}/{{ operator_base_module_name }} |
| 95 | + go mod edit -replace {{ operator_api_path }}=./deps/{{ operator_base_module_name }} |
82 | 96 | go mod tidy |
83 | 97 | if [ -d ./apis ]; then |
84 | 98 | pushd ./apis/ |
85 | | - go mod edit -replace {{ operator_api_path }}={{ operator.src }}/{{ operator_base_module_name }} |
| 99 | + go mod edit -replace {{ operator_api_path }}=./deps/{{ operator_base_module_name }} |
86 | 100 | go mod tidy |
87 | 101 | popd |
88 | 102 | fi |
|
0 commit comments