summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: 47514bdd28f21315883145a5f26345c01df72299 (plain)
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
image: "ruby:2.3"

before_script:
  - export PATH=~/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin
  - gem install --bindir /usr/local/bin bundler
  - cp config.yml.example config.yml
  - bundle install

rspec:
  script:
    - bundle exec rspec --color --format d spec
  tags:
    - ruby
  except:
    - tags

rubocop:
  script:
    - bundle exec rubocop
  tags:
    - ruby
  except:
    - tags

#ruby 2.2
rspec:ruby2.2:
  image: ruby:2.2
  script:
    - bundle exec rspec --color --format d spec
  tags:
    - ruby
  except:
    - tags

#ruby 2.1
rspec:ruby2.1:
  image: ruby:2.1
  script:
    - bundle exec rspec --color --format d spec
  tags:
    - ruby
  except:
    - tags

.go: &go_definition
  before_script:
  - apt-get update -qq && apt-get install -y ruby
  - ruby -v
  script:
    - go version
    - which go
    - bin/compile
    - support/go-test
    - support/go-format check

go:1.9:
  <<: *go_definition
  image: golang:1.9

go:1.10:
  <<: *go_definition
  image: golang:1.10

codequality:
  image: docker:stable
  variables:
    DOCKER_DRIVER: overlay2
  allow_failure: true
  services:
    - docker:stable-dind
  before_script: []
  script:
    - export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
    - docker run
        --env SOURCE_CODE="$PWD"
        --volume "$PWD":/code
        --volume /var/run/docker.sock:/var/run/docker.sock
        "registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
  artifacts:
    paths: [codeclimate.json]


sast:
  image: docker:stable
  variables:
    DOCKER_DRIVER: overlay2
  allow_failure: true
  services:
    - docker:stable-dind
  before_script: []
  script:
    - export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
    - docker run
        --env SAST_CONFIDENCE_LEVEL="${SAST_CONFIDENCE_LEVEL:-3}"
        --volume "$PWD:/code"
        --volume /var/run/docker.sock:/var/run/docker.sock
        "registry.gitlab.com/gitlab-org/security-products/sast:$SP_VERSION" /app/bin/run /code
  artifacts:
    paths: [gl-sast-report.json]

dependency_scanning:
  image: docker:stable
  variables:
    DOCKER_DRIVER: overlay2
  allow_failure: true
  services:
    - docker:stable-dind
  before_script: []
  script:
    - export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
    - docker run
        --env DEP_SCAN_DISABLE_REMOTE_CHECKS="${DEP_SCAN_DISABLE_REMOTE_CHECKS:-false}"
        --volume "$PWD:/code"
        --volume /var/run/docker.sock:/var/run/docker.sock
        "registry.gitlab.com/gitlab-org/security-products/dependency-scanning:$SP_VERSION" /code
  artifacts:
    paths: [gl-dependency-scanning-report.json]