Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
knqyf263 committed Aug 3, 2019
1 parent d8aefa6 commit 085755a
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 48 deletions.
38 changes: 29 additions & 9 deletions .travis.yml
Expand Up @@ -19,9 +19,13 @@ stages:
- 'Debian OVAL'
- 'Ubuntu CVE Tracker'
- 'Red Hat Security Data API 2019-2020'
- 'Red Hat Security Data API 2017-2018'
- 'Red Hat Security Data API 2015-2016'
- 'Red Hat Security Data API 2012-2014'
- 'Red Hat Security Data API 2018'
- 'Red Hat Security Data API 2017'
- 'Red Hat Security Data API 2016'
- 'Red Hat Security Data API 2015'
- 'Red Hat Security Data API 2014'
- 'Red Hat Security Data API 2013'
- 'Red Hat Security Data API 2012'
- 'Red Hat Security Data API 2009-2011'
- 'Red Hat Security Data API 2003-2008'
- 'Red Hat Security Data API 1996-2002'
Expand Down Expand Up @@ -66,18 +70,34 @@ jobs:
if: type = cron
script:
- go run main.go -target redhat -years 2009,2010,2011
- stage: 'Red Hat Security Data API 2012-2014'
- stage: 'Red Hat Security Data API 2012'
if: type = cron
script:
- go run main.go -target redhat -years 2012,2013,2014
- stage: 'Red Hat Security Data API 2015-2016'
- go run main.go -target redhat -years 2012
- stage: 'Red Hat Security Data API 2013'
if: type = cron
script:
- go run main.go -target redhat -years 2015,2016
- stage: 'Red Hat Security Data API 2017-2018'
- go run main.go -target redhat -years 2013
- stage: 'Red Hat Security Data API 2014'
if: type = cron
script:
- go run main.go -target redhat -years 2017,2018
- go run main.go -target redhat -years 2014
- stage: 'Red Hat Security Data API 2015'
if: type = cron
script:
- go run main.go -target redhat -years 2015
- stage: 'Red Hat Security Data API 2016'
if: type = cron
script:
- go run main.go -target redhat -years 2016
- stage: 'Red Hat Security Data API 2017'
if: type = cron
script:
- go run main.go -target redhat -years 2017
- stage: 'Red Hat Security Data API 2018'
if: type = cron
script:
- go run main.go -target redhat -years 2018
- stage: 'Red Hat Security Data API 2019-2020'
if: type = cron
script:
Expand Down
78 changes: 39 additions & 39 deletions alpine/alpine.go
Expand Up @@ -52,45 +52,45 @@ func Update() (err error) {
return xerrors.Errorf("failed to clone alpine repository: %w", err)
}

lastUpdated, err := utils.GetLastUpdatedDate(dist)
if err != nil {
return xerrors.Errorf("failed to get last updated date: %w", err)
}

log.Println("Fetching Alpine Security Issues...")
var issueURLs []string
for _, statusID := range []int{3, 5} {
for page := 1; ; page++ {
log.Printf("status_id: %d, page %d\n", statusID, page)
url := constructListURL(statusID, page, lastUpdated)
res, err := utils.FetchURL(url, "", retry)
if err != nil {
return xerrors.Errorf("failed to fetch Alpine issues: %w", err)
}
tracker := IssueList{}
if err = json.Unmarshal(res, &tracker); err != nil {
return err
}
if len(tracker.Issues) == 0 {
break
}

for _, issue := range tracker.Issues {
if strings.Index(issue.Subject, "(") < 0 {
continue
}
issueURLs = append(issueURLs, constructDetailURL(issue.ID))
}
}
}

if len(issueURLs) == 0 {
log.Println("No updated issue")
} else {
if err = retrieveIssue(issueURLs); err != nil {
return err
}
}
//lastUpdated, err := utils.GetLastUpdatedDate(dist)
//if err != nil {
// return xerrors.Errorf("failed to get last updated date: %w", err)
//}
//
//log.Println("Fetching Alpine Security Issues...")
//var issueURLs []string
//for _, statusID := range []int{3, 5} {
// for page := 1; ; page++ {
// log.Printf("status_id: %d, page %d\n", statusID, page)
// url := constructListURL(statusID, page, lastUpdated)
// res, err := utils.FetchURL(url, "", retry)
// if err != nil {
// return xerrors.Errorf("failed to fetch Alpine issues: %w", err)
// }
// tracker := IssueList{}
// if err = json.Unmarshal(res, &tracker); err != nil {
// return err
// }
// if len(tracker.Issues) == 0 {
// break
// }
//
// for _, issue := range tracker.Issues {
// if strings.Index(issue.Subject, "(") < 0 {
// continue
// }
// issueURLs = append(issueURLs, constructDetailURL(issue.ID))
// }
// }
//}
//
//if len(issueURLs) == 0 {
// log.Println("No updated issue")
//} else {
// if err = retrieveIssue(issueURLs); err != nil {
// return err
// }
//}

// Extract secfixes in all APKBUILD
log.Println("Extracting Alpine secfixes...")
Expand Down

0 comments on commit 085755a

Please sign in to comment.