.gitlab-ci.yml 677 Bytes
Newer Older
 Viraj  Shah's avatar
Viraj Shah committed
1
default:
 Viraj  Shah's avatar
Viraj Shah committed
2
  image: thebeggs/simplewebapp-base:latest
 Viraj  Shah's avatar
Viraj Shah committed
3 4 5
    username: $DOCKER_HUB_USERNAME
    password: $DOCKER_HUB_TOKEN
    email: $DOCKER_HUB_EMAIL
expectocode's avatar
expectocode committed
6 7 8 9 10 11

variables:
  PORT: "5000"

build:
  stage: build
12
  script:
expectocode's avatar
expectocode committed
13 14 15 16
    - mvn compile

test:
  stage: test
17
  script:
expectocode's avatar
expectocode committed
18 19
    - mvn test

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

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