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

variables:
  PORT: "5000"

build:
  stage: build
8
  script:
expectocode's avatar
expectocode committed
9 10 11 12
    - mvn compile

test:
  stage: test
13
  script:
expectocode's avatar
expectocode committed
14 15
    - mvn test

Viraj Shah's avatar
Viraj Shah committed
16 17 18 19
gitlab-deploy:
  stage: deploy
  script:
    - mvn package
 Viraj  Shah's avatar
Viraj Shah committed
20 21 22
    - systemctl --user stop simple-webapp.service
    - cp -r target/ /home/gitlab-runner/simple-webapp-deploy/target
    - systemctl --user start simple-webapp.service
expectocode's avatar
expectocode committed
23 24 25
  artifacts:
    paths:
    - target/
Viraj Shah's avatar
Viraj Shah committed
26 27

heroku-deploy:
expectocode's avatar
expectocode committed
28 29
  stage: deploy
  script:
 Viraj  Shah's avatar
Viraj Shah committed
30
    - dpl --provider=heroku --app=vs3318-simplewebapp --api-key=$API_TOKEN
expectocode's avatar
expectocode committed
31
  only:
 Viraj  Shah's avatar
Viraj Shah committed
32
    - master