Add Dockerfile and CI Docker build stage
Update CI script Added Docker DIND Updated CI and Dockerfile Another CI update
This commit is contained in:
parent
f77ed40b5b
commit
27465df728
|
@ -1,7 +1,7 @@
|
|||
image: "alpine"
|
||||
stages:
|
||||
- build
|
||||
- publish
|
||||
- publish_docker
|
||||
|
||||
cache:
|
||||
paths:
|
||||
|
@ -19,14 +19,29 @@ publish:
|
|||
only:
|
||||
- tags
|
||||
before_script:
|
||||
- apk update
|
||||
- apk add git zip
|
||||
script:
|
||||
- apk update && apk add git zip
|
||||
- export VERSION=`git describe --tags --dirty`
|
||||
script:
|
||||
- cp build/libs/mangadex_at_home-${VERSION}-all.jar ./
|
||||
- zip -r9 mangadex_at_home-${VERSION}.zip mangadex_at_home-${VERSION}-all.jar settings.sample.json
|
||||
artifacts:
|
||||
name: "mangadex_at_home-${CI_COMMIT_TAG}"
|
||||
name: "mangadex_at_home"
|
||||
paths:
|
||||
- "*.jar"
|
||||
- settings.sample.json
|
||||
|
||||
publish_docker:
|
||||
image: docker:git
|
||||
stage: publish
|
||||
only:
|
||||
- tags
|
||||
services:
|
||||
- docker:dind
|
||||
before_script:
|
||||
- echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin ${CI_REGISTRY}
|
||||
- export VERSION=`git describe --tags --dirty`
|
||||
script:
|
||||
- mv build/libs/mangadex_at_home-${VERSION}-all.jar build/libs/mangadex_at_home.jar
|
||||
- docker build -t ${CI_REGISTRY_IMAGE}:${VERSION} -t ${CI_REGISTRY_IMAGE}:latest .
|
||||
- docker push ${CI_REGISTRY_IMAGE}:${VERSION}
|
||||
- docker push ${CI_REGISTRY_IMAGE}:latest
|
6
Dockerfile
Normal file
6
Dockerfile
Normal file
|
@ -0,0 +1,6 @@
|
|||
FROM openjdk:15-alpine
|
||||
WORKDIR /mangahome
|
||||
COPY /build/libs/mangadex_at_home.jar .
|
||||
VOLUME "/mangahome/cache"
|
||||
EXPOSE 443 8080
|
||||
CMD java -Dfile-level=off -Dstdout-level=trace -jar mangadex_at_home.jar
|
Loading…
Reference in a new issue