.gitlab-ci.yml 592 Bytes
Newer Older
1 2
default:
  image: gitlab.doc.ic.ac.uk:4567/td1518/simplewebapp
expectocode's avatar
expectocode committed
3 4 5 6 7 8

variables:
  PORT: "5000"

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

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

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

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