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

variables:
  PORT: "5000"

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

test:
  stage: test
18
  script:
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