.gitlab-ci.yml 1.38 KB
Newer Older
1 2 3
stages:
  - test
  - build
4
  - synchronization
5

Tom Käsler's avatar
Tom Käsler committed
6 7 8
services:
  - mysql:latest

Tom Käsler's avatar
Tom Käsler committed
9 10 11 12
variables:
  # Configure mysql environment variables (https://hub.docker.com/r/_/mysql/)
  MYSQL_DATABASE: arsnova3
  MYSQL_ROOT_PASSWORD: arsnova3_prototype
13
  WAR_FILE: target/scala-2.11/arsnova-3-backend*.jar
Tom Käsler's avatar
Tom Käsler committed
14
  MIRROR_REPO: git@github.com:thm-projects/arsnova-3-backend.git
15
  REPORT_DIR: target/gatling-it/stresstest*
Tom Käsler's avatar
Tom Käsler committed
16

Tom Käsler's avatar
Tom Käsler committed
17
stylecheck:
18
  stage: test
Tom Käsler's avatar
Tom Käsler committed
19 20
  tags:
    - sbt
21
  dependencies: []
Tom Käsler's avatar
Tom Käsler committed
22 23 24 25
  script:
    - sbt scalastyle
    - sbt test:scalastyle

Tom Käsler's avatar
Tom Käsler committed
26
test:
27
  stage: test
Tom Käsler's avatar
Tom Käsler committed
28 29
  tags:
    - sbt
30
  dependencies: []
Tom Käsler's avatar
Tom Käsler committed
31 32
  script:
    # Execute your project's tests
Tom Käsler's avatar
Tom Käsler committed
33 34
    - sbt clean test

Tom Käsler's avatar
Tom Käsler committed
35 36 37 38 39 40
sync_mirror:
  stage: synchronization
  when: always
  allow_failure: true
  script:
    - git clone --bare "$CI_BUILD_REPO" mirror.git
Tom Käsler's avatar
Tom Käsler committed
41 42
    - mkdir ~/.ssh && echo "$GITHUB_HOST_KEY" > ~/.ssh/known_hosts
    - eval $(ssh-agent -s) && ssh-add <(echo "$GITHUB_DEPLOY_KEY")
Tom Käsler's avatar
Tom Käsler committed
43 44 45 46 47
    - cd mirror.git
    - git update-ref -d refs/tags/production
    - git update-ref -d refs/tags/staging
    - git push --mirror "$MIRROR_REPO"

48 49
stresstest:
  stage: test
50 51 52
  only:
    - master
    - /^v[0-9]+/
53 54 55 56 57 58 59 60 61
  tags:
    - sbt
  dependencies: []
  script:
    - sbt clean gatling-it:test
  artifacts:
    paths:
      - $REPORT_DIR

Tom Käsler's avatar
Tom Käsler committed
62 63
package:
  stage: build
64 65 66
  only:
    - master
    - /^v[0-9]+/
Tom Käsler's avatar
Tom Käsler committed
67 68
  tags:
    - sbt
69 70 71
  dependencies: []
  script:
    - sbt assembly
Tom Käsler's avatar
Tom Käsler committed
72 73 74
  artifacts:
    paths:
      - $WAR_FILE