Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
renovate
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SmartDataLab
public
applications
renovate
Commits
4c3401cc
Commit
4c3401cc
authored
7 years ago
by
Steven Hargrove
Committed by
Rhys Arkins
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
refactor: simply repositories autodiscover
parent
0d92defb
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/config/index.js
+5
-23
5 additions, 23 deletions
lib/config/index.js
with
5 additions
and
23 deletions
lib/config/index.js
+
5
−
23
View file @
4c3401cc
const
githubApi
=
require
(
'
../platform/github
'
);
const
gitlabApi
=
require
(
'
../platform/gitlab
'
);
const
vstsApi
=
require
(
'
../platform/vsts
'
);
const
definitions
=
require
(
'
./definitions
'
);
const
defaultsParser
=
require
(
'
./defaults
'
);
...
...
@@ -9,6 +5,7 @@ const fileParser = require('./file');
const
cliParser
=
require
(
'
./cli
'
);
const
envParser
=
require
(
'
./env
'
);
const
{
getPlatformApi
}
=
require
(
'
../platform
'
);
const
{
resolveConfigPresets
}
=
require
(
'
./presets
'
);
exports
.
parseConfigs
=
parseConfigs
;
...
...
@@ -73,25 +70,10 @@ async function parseConfigs(env, argv) {
if
(
config
.
autodiscover
)
{
// Autodiscover list of repositories
if
(
config
.
platform
===
'
github
'
)
{
logger
.
info
(
'
Autodiscovering GitHub repositories
'
);
config
.
repositories
=
await
githubApi
.
getRepos
(
config
.
token
,
config
.
endpoint
);
}
else
if
(
config
.
platform
===
'
gitlab
'
)
{
logger
.
info
(
'
Autodiscovering GitLab repositories
'
);
config
.
repositories
=
await
gitlabApi
.
getRepos
(
config
.
repositories
=
await
getPlatformApi
(
config
.
platform
).
getRepos
(
config
.
token
,
config
.
endpoint
);
}
else
if
(
config
.
platform
===
'
vsts
'
)
{
logger
.
info
(
'
Autodiscovering vsts repositories
'
);
config
.
repositories
=
await
vstsApi
.
getRepos
(
config
.
token
,
config
.
endpoint
);
}
if
(
!
config
.
repositories
||
config
.
repositories
.
length
===
0
)
{
// Soft fail (no error thrown) if no accessible repositories
logger
.
info
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment