Use a GITHUB token if defined.

This commit is contained in:
Andrea Dell'Amico 2021-07-05 15:21:46 +02:00
parent b2eaf9e751
commit d837999780
Signed by: andrea.dellamico
GPG Key ID: 147ABE6CEB9E20FF
2 changed files with 8 additions and 0 deletions

View File

@ -252,6 +252,8 @@ r_plugins_list_to_install: []
r_plugins_from_sources: []
# - { name: 'plyr', version: '1.7.1', source: 'plyr_1.7.1.tar.gz', url: 'http://cran.r-project.org/src/contrib/Archive/plyr/plyr_1.7.1.tar.gz' }
# The 'repo' scope is required
# r_plugins_from_github_api_token: 'Put it into a vault file'
r_plugins_from_github: []
# - { plugin_name: 'RFigisGeo', github_user: 'openfigis' }
# - { plugin_name: 'rsdmx', github_user: 'opensdmx' }

View File

@ -77,6 +77,12 @@
ignore_errors: True
tags: [ 'r_software', 'r_pkg', 'r_plugins', 'r_plugins_version' ]
- name: github, add an API key if we have one
copy:
content: "GITHUB_PAT={{ r_plugins_from_github_api_token }}"
dest: /root/.Renvironment
when: r_plugins_from_github_api_token is defined
- name: Install R packages from github
command: >
Rscript --slave --no-site-file --no-init-file --no-save --no-restore-history -e "if (! ('{{ item.plugin_name }}' %in% installed.packages()[,'Package'])) { require(devtools); require(methods) ; options(repos='{{ r_cran_mirror_site }}/') ; install_github('{{ item.github_user }}/{{ item.plugin_name }}'); print('Added'); } else { print('Already Installed'); }"