mirror of
https://gitlab.com/mangadex-pub/mangadex_at_home.git
synced 2024-01-19 02:48:37 +00:00
Add publish stage for a static-named latest release
This commit is contained in:
parent
ec54c3f0cd
commit
eca1ca3646
103
.gitlab-ci.yml
103
.gitlab-ci.yml
|
@ -1,46 +1,59 @@
|
|||
stages:
|
||||
- build
|
||||
- publish
|
||||
- publish_docker
|
||||
|
||||
cache:
|
||||
paths:
|
||||
- build/libs/
|
||||
|
||||
build:
|
||||
image: openjdk:8
|
||||
stage: build
|
||||
script:
|
||||
- ./gradlew build
|
||||
|
||||
publish:
|
||||
image: alpine
|
||||
stage: publish
|
||||
before_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"
|
||||
paths:
|
||||
- "*.jar"
|
||||
- "mangadex_at_home-*.zip"
|
||||
- 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}
|
||||
stages:
|
||||
- build
|
||||
- publish
|
||||
- publish_latest
|
||||
- publish_docker
|
||||
|
||||
cache:
|
||||
paths:
|
||||
- build/libs/
|
||||
|
||||
build:
|
||||
image: openjdk:8
|
||||
stage: build
|
||||
script:
|
||||
- ./gradlew build
|
||||
|
||||
publish:
|
||||
image: alpine
|
||||
stage: publish
|
||||
before_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"
|
||||
paths:
|
||||
- "*.jar"
|
||||
- "mangadex_at_home-*.zip"
|
||||
- settings.sample.json
|
||||
|
||||
publish_latest:
|
||||
image: alpine
|
||||
stage: publish
|
||||
before_script:
|
||||
- export VERSION=`git describe --tags --dirty`
|
||||
script:
|
||||
- cp build/libs/mangadex_at_home-${VERSION}-all.jar build/libs/mangadex_at_home-latest-all.jar
|
||||
artifacts:
|
||||
name: "mangadex_at_home-latest"
|
||||
paths:
|
||||
- "build/libs/mangadex_at_home-latest-all.jar"
|
||||
|
||||
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
|
Loading…
Reference in a new issue