.gitlab-ci.yml 1.09 KB
Newer Older
1 2
#image: java:8
image: maven:latest
Triple oh's avatar
Triple oh committed
3 4 5

stages:
  - build
6
  - sast
7
  - test
Triple oh's avatar
Triple oh committed
8 9 10 11 12 13 14
  - deploy


production:
  stage: deploy
  script:
  - curl --location "https://cli.run.pivotal.io/stable?release=linux64-binary&source=github" | tar zx
15
  - ./cf login -u $CF_USERNAME -p $CF_PASSWORD -a 'api.run.pivotal.io
Triple oh's avatar
Triple oh committed
16 17 18
  - ./cf push
  only:
  - master
19 20 21
build:
  stage: build
  script:
22
    - mvn $MAVEN_CLI_OPTS -e compile
23 24 25 26 27 28 29 30 31 32 33

test:
  stage: test
  script:
    - mvn $MAVEN_CLI_OPTS test

deploy:
  stage: deploy
  script:
    - mvn $MAVEN_CLI_OPTS deploy
  only:
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
    - master
    
sast:
  image: docker:stable
  variables:
    DOCKER_DRIVER: overlay2
  allow_failure: true
  services:
    - docker:stable-dind
  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:
    reports:
      sast: gl-sast-report.json