Update github workflows

In the integration_tests one, go is now installed using actions, therefore
the ansible go installation will be skipped.
This commit is contained in:
ionutboangiu
2023-08-11 12:58:54 -04:00
committed by Dan Christian Bogos
parent 47198a994b
commit 84caf3f0b4
6 changed files with 22 additions and 10 deletions

View File

@@ -5,6 +5,5 @@
- ../roles/kafka
- ../roles/mongodb
- ../roles/postgresql
- role: ../roles/go
when: install_go | default(true)
- ../roles/go
- ../roles/cgrates

View File

@@ -1,5 +1,6 @@
---
golang_gopath: "/home/{{ ansible_user }}/go"
clone_repository: true
cgrates_dir: "{{ golang_gopath }}/src/github.com/cgrates/cgrates"
golang_install_dir: /usr/local/go
git_version: "v0.10"

View File

@@ -13,7 +13,7 @@
mode: "u=rwx,go=rx"
owner: "{{ ansible_user }}"
dest: "{{ cgrates_dir }}"
when: clone_repository | default(true)
when: clone_repository | bool
- name: Git clone cgrates
ansible.builtin.git:
@@ -22,7 +22,7 @@
update: yes
force: yes
version: "{{ git_version }}"
when: clone_repository | default(true)
when: clone_repository | bool
- name: Build cgrates
ansible.builtin.shell:

View File

@@ -5,3 +5,4 @@ go_arch: amd64
go_tarball: go{{ go_version }}.{{ go_platform }}-{{ go_arch }}.tar.gz
go_download_url: https://dl.google.com/go/{{ go_tarball }}
go_checksum: "d0398903a16ba2232b389fb31032ddf57cac34efda306a0eebac34f0965a0742"
install_go: true

View File

@@ -10,27 +10,34 @@
state: absent
path: /usr/local/go
when:
- install_go | bool
- go_version_result is succeeded
- go_version not in go_version_result.stdout
- name: Download Go.
become: yes
get_url:
url: "{{ go_download_url }}"
dest: /usr/local/src/{{ go_tarball }}
checksum: "sha256:{{ go_checksum }}"
when: go_version_result is failed
or go_version not in go_version_result.stdout
when:
- install_go | bool
- (go_version_result is failed or go_version not in go_version_result.stdout)
- name: Extract Go.
become: yes
unarchive:
src: /usr/local/src/{{ go_tarball }}
dest: /usr/local
copy: no
when: go_version_result is failed
or go_version not in go_version_result.stdout
when:
- install_go | bool
- (go_version_result is failed or go_version not in go_version_result.stdout)
- name: Add Go to to system-wide $PATH.
become: yes
copy:
dest: /etc/profile.d/go-path.sh
content: |-
export PATH=$PATH:/usr/local/go/bin
when: install_go | bool