forked from Tabll/gemnasium-db
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
78 lines (71 loc) · 2.19 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
stages:
- test
- bump
- deploy
default:
tags:
- gitlab-org
workflow:
rules:
# For merge requests, create a pipeline.
- if: '$CI_MERGE_REQUEST_IID'
# For `master` branch, create a pipeline (this includes on schedules, pushes, merges, etc.).
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
# For tags, create a pipeline.
- if: '$CI_COMMIT_TAG'
go-yaml-lint:
image: golang:1.16-alpine
stage: test
script:
- (cd ci/go-yaml-lint && go build)
- for ptype in "conan" "gem" "go" "maven" "npm" "nuget" "packagist" "pypi"; do ci/go-yaml-lint/go-yaml-lint "$ptype" || exit 1; done
resource_group: "gemnasium-db-$CI_COMMIT_REF_SLUG"
yamllint:
image: python:3
stage: test
before_script:
- pip install yamllint
script:
- yamllint .
resource_group: "gemnasium-db-$CI_COMMIT_REF_SLUG"
semantic:
image: ruby:2.6-alpine3.10
stage: test
script:
- bundle install --gemfile ci/schema/Gemfile
- bundle install --gemfile ci/identifier/Gemfile
- bundle exec --gemfile ci/schema/Gemfile ci/schema/validate.rb --semantic gem go npm maven packagist pypi conan nuget
- ci/identifier/identifier.rb -v .
resource_group: "gemnasium-db-$CI_COMMIT_REF_SLUG"
bump:
image: registry.gitlab.com/julianthome/bumper:master-v1.0.7
stage: bump
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
variables:
GIT_STRATEGY: none
before_script:
- mkdir -p ~/.ssh && chmod 700 ~/.ssh
- ssh-keyscan gitlab.com >> ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts
- eval $(ssh-agent -s)
- ssh-add <(echo "$BUMPER_SSH")
- git clone git@gitlab.com:gitlab-org/security-products/gemnasium-db.git
script:
- bump.rb -v "v" -c "CHANGELOG.md" -g "gemnasium-db" -n "bumper" -e "bumper@gitlab.com"
resource_group: "gemnasium-db-$CI_COMMIT_REF_SLUG"
pages:
image: registry.gitlab.com/julianthome/stats:1.3.0
stage: deploy
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
- if: '$CI_COMMIT_TAG'
before_script:
- gem install csv sqlite3 git
script:
- cd ci/stats && make
resource_group: "gemnasium-db-$CI_COMMIT_REF_SLUG"
artifacts:
paths:
- data/data.tar.gz
- data/nvd.tar.gz
- public