...
 
Commits (12)
......@@ -12,7 +12,7 @@ variables:
build docker:
stage: build_docker
tags:
tags:
- ljt18_webapp
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
......@@ -20,27 +20,24 @@ build docker:
- docker build -t $DOCKER_IMAGE .
- docker push $DOCKER_IMAGE
compile:
compile java:
stage: build
image: $DOCKER_IMAGE_LATEST
script:
- mvn compile
script: mvn compile
test:
testing:
stage: test
image: $DOCKER_IMAGE_LATEST
script:
- mvn test
script: mvn test
deploy to vm:
stage: staging
tags:
tags:
- ljt18_webapp
before_script:
- pkill -f screen || echo "Screen not running"
script:
- mvn package
- export PORT=5000
- mvn -Dmaven.test.skip=true package
- screen -dm sh target/bin/simplewebapp
environment:
name: VM
......@@ -49,8 +46,7 @@ deploy to vm:
deploy to heroku:
stage: production
image: $DOCKER_IMAGE_LATEST
script:
- dpl --provider=heroku --app=ljt18-simplewebapp --api-key=$API_KEY
script: dpl --provider=heroku --app=ljt18-simplewebapp --api-key=$API_KEY
environment:
name: Heroku
url: https://ljt18-simplewebapp.herokuapp.com/
......
......@@ -8,7 +8,4 @@ COPY src /src
COPY system.properties /system.properties
COPY pom.xml /pom.xml
RUN mvn package
ENV PATH /var/lib/ruby/2.5.0/bin:$PATH
CMD ["sh", "target/bin/simplewebapp"]
build:
docker:
web: Dockerfile
run:
web: mvn -Dmaven.test.skip=true package; sh target/bin/simplewebapp