Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Luke Texon
simplewebapp
Commits
f9aba0f9
Commit
f9aba0f9
authored
Jan 17, 2020
by
rk4718
Browse files
Options
Browse Files
Download
Plain Diff
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
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
10 deletions
+23
-10
.gitlab-ci.yml
.gitlab-ci.yml
+18
-9
Dockerfile
Dockerfile
+5
-1
No files found.
.gitlab-ci.yml
View file @
f9aba0f9
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
...
...
Dockerfile
View file @
f9aba0f9
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"]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment