mirror of
https://gitlab.com/mangadex-pub/mangadex_at_home.git
synced 2024-11-16 16:12:32 +01:00
57 lines
1.3 KiB
YAML
Executable File
57 lines
1.3 KiB
YAML
Executable File
stages:
|
|
- build
|
|
- publish
|
|
- publish_latest
|
|
- publish_docker
|
|
|
|
build:
|
|
image: openjdk:8
|
|
stage: build
|
|
script:
|
|
- export VERSION="$CI_COMMIT_REF_NAME"
|
|
- ./gradlew build
|
|
- "ls -lah build/libs"
|
|
cache:
|
|
key: "mangadex_at_home-build"
|
|
paths:
|
|
- /root/.gradle
|
|
artifacts:
|
|
name: "mangadex_at_home"
|
|
paths:
|
|
- "build/libs/mangadex_at_home-*-all.jar"
|
|
|
|
publish:
|
|
image: alpine
|
|
stage: publish
|
|
before_script:
|
|
- apk update && apk add git zip
|
|
- export VERSION="$CI_COMMIT_REF_NAME"
|
|
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
|
|
dependencies:
|
|
- build
|
|
artifacts:
|
|
name: "mangadex_at_home"
|
|
paths:
|
|
- "mangadex_at_home-*-all.jar"
|
|
- "mangadex_at_home-*.zip"
|
|
- "settings.sample.yaml"
|
|
|
|
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="$CI_COMMIT_REF_NAME"
|
|
dependencies:
|
|
- build
|
|
script:
|
|
- mv build/libs/mangadex_at_home-${VERSION}-all.jar build/libs/mangadex_at_home.jar
|
|
- docker build . -t ${CI_REGISTRY_IMAGE}:${VERSION}
|
|
- docker push ${CI_REGISTRY_IMAGE}:${VERSION}
|