.gitlab-ci.yml 690 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 9

variables:
  PORT: "5000"

build:
  stage: build
  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
expectocode's avatar
expectocode committed
12 13 14 15 16
    - mvn compile

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

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

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