diff --git a/data/ansible/deb_packages/main.yaml b/data/ansible/deb_packages/main.yaml index d60990d5a..9d3113a35 100644 --- a/data/ansible/deb_packages/main.yaml +++ b/data/ansible/deb_packages/main.yaml @@ -138,6 +138,26 @@ become: yes become_user: "{{ gouser }}" + - name: clean go cache + become: yes + shell: "go clean --cache" + environment: + PATH: "{{ lookup('env','PATH') }}:{{ golang_gopath }}/bin:/usr/local/go/bin:{{ ansible_env.PATH }}" + + - name: clean go modcache + become: yes + shell: "go clean --modcache" + environment: + PATH: "{{ lookup('env','PATH') }}:{{ golang_gopath }}/bin:/usr/local/go/bin:{{ ansible_env.PATH }}" + + - name: sync the go mod with vendor + become: yes + shell: "go mod vendor" + environment: + PATH: "{{ lookup('env','PATH') }}:{{ golang_gopath }}/bin:/usr/local/go/bin:{{ ansible_env.PATH }}" + args: + chdir: '{{ cgrates_dir }}' + - name: build cgrates shell: "sh {{ cgrates_dir }}/build.sh" environment: diff --git a/data/ansible/docker/main.yaml b/data/ansible/docker/main.yaml index a15b31d6b..a616a72cc 100644 --- a/data/ansible/docker/main.yaml +++ b/data/ansible/docker/main.yaml @@ -118,6 +118,26 @@ become: yes become_user: "{{ gouser }}" + - name: clean go cache + become: yes + shell: "go clean --cache" + environment: + PATH: "{{ lookup('env','PATH') }}:{{ golang_gopath }}/bin:/usr/local/go/bin:{{ ansible_env.PATH }}" + + - name: clean go modcache + become: yes + shell: "go clean --modcache" + environment: + PATH: "{{ lookup('env','PATH') }}:{{ golang_gopath }}/bin:/usr/local/go/bin:{{ ansible_env.PATH }}" + + - name: sync the go mod with vendor + become: yes + shell: "go mod vendor" + environment: + PATH: "{{ lookup('env','PATH') }}:{{ golang_gopath }}/bin:/usr/local/go/bin:{{ ansible_env.PATH }}" + args: + chdir: '{{ cgrates_dir }}' + - name: build cgrates for docker shell: "sh {{ cgrates_dir }}/data/docker/scratch/build.sh" environment: diff --git a/data/ansible/rpm_packages/main.yaml b/data/ansible/rpm_packages/main.yaml index e455e32d1..2fbdd5025 100644 --- a/data/ansible/rpm_packages/main.yaml +++ b/data/ansible/rpm_packages/main.yaml @@ -171,6 +171,26 @@ become: yes become_user: "{{ gouser }}" + - name: clean go cache + become: yes + shell: "go clean --cache" + environment: + PATH: "{{ lookup('env','PATH') }}:{{ golang_gopath }}/bin:/usr/local/go/bin:{{ ansible_env.PATH }}" + + - name: clean go modcache + become: yes + shell: "go clean --modcache" + environment: + PATH: "{{ lookup('env','PATH') }}:{{ golang_gopath }}/bin:/usr/local/go/bin:{{ ansible_env.PATH }}" + + - name: sync the go mod with vendor + become: yes + shell: "go mod vendor" + environment: + PATH: "{{ lookup('env','PATH') }}:{{ golang_gopath }}/bin:/usr/local/go/bin:{{ ansible_env.PATH }}" + args: + chdir: '{{ cgrates_dir }}' + - name: build cgrates shell: "sh {{ cgrates_dir }}/build.sh" environment: