.gitlab-ci.yml 724 Bytes
Newer Older
 Viraj  Shah's avatar
Viraj Shah committed
1 2
default:
  image: maven:latest
expectocode's avatar
expectocode committed
3 4 5 6 7 8

variables:
  PORT: "5000"

build:
  stage: build
 Viraj  Shah's avatar
Viraj Shah committed
9
  before_script:
 Viraj  Shah's avatar
Viraj Shah committed
10
    - apt-get update
 Viraj  Shah's avatar
Viraj Shah committed
11
    - apt-get install -qq -y pandoc texlive
12
  script:
expectocode's avatar
expectocode committed
13 14 15 16
    - mvn compile

test:
  stage: test
 Viraj  Shah's avatar
Viraj Shah committed
17
  before_script:
 Viraj  Shah's avatar
Viraj Shah committed
18
    - apt-get update
 Viraj  Shah's avatar
Viraj Shah committed
19
    - apt-get install -qq -y pandoc texlive
20
  script:
expectocode's avatar
expectocode committed
21 22
    - mvn test

Viraj Shah's avatar
Viraj Shah committed
23 24 25 26
gitlab-deploy:
  stage: deploy
  script:
    - mvn package
expectocode's avatar
expectocode committed
27
    - systemctl --user stop simple-webapp.service
28
    - cp -r target/ /home/gitlab-runner/simple-webapp-deploy/target
Viraj Shah's avatar
Viraj Shah committed
29
    - systemctl --user start simple-webapp.service
expectocode's avatar
expectocode committed
30 31 32
  artifacts:
    paths:
    - target/
Viraj Shah's avatar
Viraj Shah committed
33 34

heroku-deploy:
expectocode's avatar
expectocode committed
35 36
  stage: deploy
  script:
 Viraj  Shah's avatar
Viraj Shah committed
37
    - dpl --provider=heroku --app=vs3318-simplewebapp --api-key=$API_TOKEN
expectocode's avatar
expectocode committed
38 39
  only:
    - master