feat: add github token in application.yml
This commit is contained in:
parent
2c28c02673
commit
78a248286f
4 changed files with 12 additions and 3 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -28,3 +28,5 @@
|
||||||
|
|
||||||
# Ignore master key for decrypting credentials and more.
|
# Ignore master key for decrypting credentials and more.
|
||||||
/config/master.key
|
/config/master.key
|
||||||
|
|
||||||
|
/config/application.yml
|
||||||
|
|
2
Gemfile
2
Gemfile
|
@ -3,6 +3,8 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
||||||
|
|
||||||
ruby '2.4.1'
|
ruby '2.4.1'
|
||||||
|
|
||||||
|
gem 'figaro'
|
||||||
|
|
||||||
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
|
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
|
||||||
gem 'rails', '~> 5.2.0'
|
gem 'rails', '~> 5.2.0'
|
||||||
# Use sqlite3 as the database for Active Record
|
# Use sqlite3 as the database for Active Record
|
||||||
|
|
|
@ -76,6 +76,8 @@ GEM
|
||||||
erubi (1.7.1)
|
erubi (1.7.1)
|
||||||
execjs (2.7.0)
|
execjs (2.7.0)
|
||||||
ffi (1.9.25)
|
ffi (1.9.25)
|
||||||
|
figaro (1.1.1)
|
||||||
|
thor (~> 0.14)
|
||||||
globalid (0.4.1)
|
globalid (0.4.1)
|
||||||
activesupport (>= 4.2.0)
|
activesupport (>= 4.2.0)
|
||||||
i18n (1.0.1)
|
i18n (1.0.1)
|
||||||
|
@ -197,6 +199,7 @@ DEPENDENCIES
|
||||||
capybara (>= 2.15, < 4.0)
|
capybara (>= 2.15, < 4.0)
|
||||||
chromedriver-helper
|
chromedriver-helper
|
||||||
coffee-rails (~> 4.2)
|
coffee-rails (~> 4.2)
|
||||||
|
figaro
|
||||||
jbuilder (~> 2.5)
|
jbuilder (~> 2.5)
|
||||||
listen (>= 3.0.5, < 3.2)
|
listen (>= 3.0.5, < 3.2)
|
||||||
puma (~> 3.11)
|
puma (~> 3.11)
|
||||||
|
|
|
@ -16,13 +16,15 @@ namespace :repositories do
|
||||||
|
|
||||||
desc 'Update version from github repositories'
|
desc 'Update version from github repositories'
|
||||||
task github: :environment do
|
task github: :environment do
|
||||||
|
headers = {
|
||||||
|
'Accept' => 'application/vnd.github.v3+json'
|
||||||
|
}
|
||||||
|
headers['Authorization'] = "token #{Figaro.env.github_token}" if Figaro.env.github_token
|
||||||
|
|
||||||
GithubRepository.all.each do |repo|
|
GithubRepository.all.each do |repo|
|
||||||
begin
|
begin
|
||||||
software = Software.find(repo.software_id)
|
software = Software.find(repo.software_id)
|
||||||
versions = software.versions.all.map(&:number)
|
versions = software.versions.all.map(&:number)
|
||||||
headers = {
|
|
||||||
'Accept' => 'application/vnd.github.v3+json'
|
|
||||||
}
|
|
||||||
tags =
|
tags =
|
||||||
JSON.parse(
|
JSON.parse(
|
||||||
get_url_content(
|
get_url_content(
|
||||||
|
|
Loading…
Reference in a new issue