Renew Drone CI

This commit is contained in:
arberkatellari
2023-09-01 10:07:44 -04:00
committed by Dan Christian Bogos
parent 47af22c724
commit c04e28cb56
5 changed files with 152 additions and 82 deletions

View File

@@ -0,0 +1,46 @@
---
- hosts: all
vars:
golang_gopath: "/go"
clone_repository: true
cgrates_dir: "{{ golang_gopath }}/src/github.com/cgrates/cgrates"
golang_install_dir: /usr/local/go
git_version: "master"
cgrates_dependencies:
- git
- redis-server
- mariadb-server
- make
- gcc
tasks:
- name: Install CGRateS dependencies
become: yes
ansible.builtin.package:
name: "{{ cgrates_dependencies }}"
state: present
update_cache: yes
cache_valid_time: 86400
- name: Create cgrates directory
ansible.builtin.file:
state: directory
mode: "u=rwx,go=rx"
owner: "{{ ansible_user }}"
dest: "{{ cgrates_dir }}"
when: clone_repository | bool
- name: Git clone cgrates
ansible.builtin.git:
repo: https://github.com/cgrates/cgrates.git
dest: "{{ cgrates_dir }}"
update: yes
force: yes
version: "{{ git_version }}"
when: clone_repository | bool
- name: Build cgrates
ansible.builtin.shell:
cmd: bash -lc "sh {{ cgrates_dir }}/build.sh"
args:
chdir: "{{ cgrates_dir }}"