.gitlab-ci.yml 549 Bytes
Newer Older
expectocode's avatar
expectocode committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
image: maven:latest

variables:
  PORT: "5000"

build:
  stage: build
  script:
    - mvn compile

test:
  stage: test
  script:
    - mvn test

Viraj Shah's avatar
Viraj Shah committed
16 17 18 19
gitlab-deploy:
  stage: deploy
  script:
    - mvn package
expectocode's avatar
expectocode committed
20
    - systemctl --user stop simple-webapp.service
21
    - cp -r target/ /home/gitlab-runner/simple-webapp-deploy/target
Viraj Shah's avatar
Viraj Shah committed
22
    - 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 32
  only:
    - master