Commit f9aba0f9 authored by rk4718's avatar rk4718

Merge branch 'shared-runner-docker' into 'master'

Shared runner docker

See merge request !3
parents ae0eb73f 357f1775
Pipeline #113375 passed with stages
in 4 minutes and 2 seconds
stages:
- build_docker
- build
- test
- staging
- production
variables:
PORT: 5000
DOCKER_DRIVER: overlay
CONTAINER_TEST_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
CONTAINER_RELEASE_IMAGE: $CI_REGISTRY_IMAGE:latest
PORT: 5000
DOCKER_IMAGE: $CI_REGISTRY_IMAGE
DOCKER_IMAGE_LATEST: $CI_REGISTRY_IMAGE:latest
build docker:
stage: build_docker
tags:
- ljt18_webapp
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker system prune -f
- docker build -t $DOCKER_IMAGE .
- docker push $DOCKER_IMAGE
compile:
stage: build
image: $CONTAINER_TEST_IMAGE
image: $DOCKER_IMAGE_LATEST
script:
- mvn compile
test:
stage: test
image: $CONTAINER_TEST_IMAGE
image: $DOCKER_IMAGE_LATEST
script:
- mvn test
......@@ -37,10 +48,8 @@ deploy to vm:
deploy to heroku:
stage: production
image: $DOCKER_IMAGE_LATEST
script:
- apt-get update
- apt-get install ruby
- gem install --user-install dpl-heroku
- dpl --provider=heroku --app=ljt18-simplewebapp --api-key=$API_KEY
environment:
name: Heroku
......
FROM ubuntu:latest
RUN apt-get -y update \
&& apt-get -y install maven openjdk-11-jre openjdk-11-jdk pandoc
&& apt-get -y install git maven openjdk-11-jre openjdk-11-jdk pandoc ruby=1:2.5.1 curl
RUN gem install dpl-heroku -v 1.10.14
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"]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment