2020-06-23 00:24:20 +00:00
|
|
|
stages:
|
|
|
|
- build
|
|
|
|
- publish
|
2021-10-02 03:54:09 +00:00
|
|
|
- docker
|
|
|
|
- push
|
2020-06-23 00:24:20 +00:00
|
|
|
|
2021-10-02 03:54:09 +00:00
|
|
|
Gradle Build:
|
2020-06-23 00:24:20 +00:00
|
|
|
image: openjdk:8
|
|
|
|
stage: build
|
2021-10-02 03:54:09 +00:00
|
|
|
only:
|
|
|
|
- branches
|
|
|
|
- tags
|
|
|
|
- merge_requests
|
2021-10-01 06:10:07 +00:00
|
|
|
before_script:
|
2021-10-02 03:54:09 +00:00
|
|
|
- export VERSION="${CI_COMMIT_TAG:-$CI_COMMIT_SHORT_SHA}"
|
2021-10-01 06:10:07 +00:00
|
|
|
script:
|
2020-06-23 00:24:20 +00:00
|
|
|
- ./gradlew build
|
2023-04-12 00:40:09 +00:00
|
|
|
variables:
|
|
|
|
KUBERNETES_MEMORY_REQUEST: 3Gi
|
|
|
|
KUBERNETES_MEMORY_LIMIT: 3Gi
|
2021-02-21 18:19:49 +00:00
|
|
|
artifacts:
|
|
|
|
name: "mangadex_at_home"
|
|
|
|
paths:
|
|
|
|
- "build/libs/mangadex_at_home-*-all.jar"
|
2020-06-23 00:24:20 +00:00
|
|
|
|
2021-10-02 03:54:09 +00:00
|
|
|
Publish Artifacts:
|
2020-06-23 00:24:20 +00:00
|
|
|
image: alpine
|
|
|
|
stage: publish
|
2021-10-02 03:54:09 +00:00
|
|
|
needs:
|
|
|
|
- Gradle Build
|
|
|
|
variables:
|
|
|
|
GIT_STRATEGY: none
|
2021-10-01 06:10:07 +00:00
|
|
|
|
2020-06-23 00:24:20 +00:00
|
|
|
before_script:
|
2021-10-01 06:10:07 +00:00
|
|
|
- apk update && apk add zip
|
2021-10-02 03:54:09 +00:00
|
|
|
- export VERSION="${CI_COMMIT_TAG:-$CI_COMMIT_SHORT_SHA}"
|
2020-07-02 16:12:34 +00:00
|
|
|
script:
|
2020-06-23 00:24:20 +00:00
|
|
|
- cp build/libs/mangadex_at_home-${VERSION}-all.jar ./
|
2021-03-25 23:34:30 +00:00
|
|
|
- zip -r9 mangadex_at_home-${VERSION}.zip mangadex_at_home-${VERSION}-all.jar settings.sample.yaml
|
2020-06-23 00:24:20 +00:00
|
|
|
artifacts:
|
2020-07-02 16:12:34 +00:00
|
|
|
name: "mangadex_at_home"
|
2020-06-23 00:24:20 +00:00
|
|
|
paths:
|
2021-02-21 18:19:49 +00:00
|
|
|
- "mangadex_at_home-*-all.jar"
|
2020-07-19 02:05:39 +00:00
|
|
|
- "mangadex_at_home-*.zip"
|
2021-02-21 18:19:49 +00:00
|
|
|
- "settings.sample.yaml"
|
2020-07-19 02:05:39 +00:00
|
|
|
|
2021-10-02 03:54:09 +00:00
|
|
|
Docker Build:
|
2021-10-01 06:10:07 +00:00
|
|
|
image: docker:20.10.8
|
|
|
|
services:
|
|
|
|
- docker:20.10.8-dind
|
2021-10-02 03:54:09 +00:00
|
|
|
stage: docker
|
|
|
|
needs:
|
|
|
|
- Gradle Build
|
2021-10-01 06:10:07 +00:00
|
|
|
|
2020-07-02 16:12:34 +00:00
|
|
|
before_script:
|
|
|
|
- echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin ${CI_REGISTRY}
|
2021-10-02 03:54:09 +00:00
|
|
|
- export VERSION="${CI_COMMIT_TAG:-$CI_COMMIT_SHORT_SHA}"
|
2021-10-02 04:13:34 +00:00
|
|
|
- export BASE_TAG="git-$CI_COMMIT_SHORT_SHA"
|
2021-10-02 03:54:09 +00:00
|
|
|
|
2020-07-02 16:12:34 +00:00
|
|
|
script:
|
|
|
|
- mv build/libs/mangadex_at_home-${VERSION}-all.jar build/libs/mangadex_at_home.jar
|
2021-10-02 03:54:09 +00:00
|
|
|
- docker build . -t $CI_REGISTRY_IMAGE:$BASE_TAG
|
|
|
|
- docker push $CI_REGISTRY_IMAGE:$BASE_TAG
|
|
|
|
|
2023-04-07 20:51:29 +00:00
|
|
|
|
2021-10-02 03:54:09 +00:00
|
|
|
.docker_push: &docker_push
|
|
|
|
image: docker:20.10.8
|
|
|
|
services:
|
|
|
|
- docker:20.10.8-dind
|
|
|
|
stage: push
|
|
|
|
variables:
|
|
|
|
GIT_STRATEGY: none
|
|
|
|
|
|
|
|
before_script:
|
|
|
|
- echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin ${CI_REGISTRY}
|
2021-10-02 04:13:34 +00:00
|
|
|
- export BASE_TAG="git-$CI_COMMIT_SHORT_SHA"
|
2023-04-07 20:51:29 +00:00
|
|
|
- export SHORT_TAG="$(echo $CI_COMMIT_TAG | cut -d "." -f1)"
|
2021-10-02 03:54:09 +00:00
|
|
|
|
|
|
|
script:
|
|
|
|
- docker pull $CI_REGISTRY_IMAGE:$BASE_TAG
|
|
|
|
- docker tag $CI_REGISTRY_IMAGE:$BASE_TAG $CI_REGISTRY_IMAGE:$NEW_TAG
|
2023-04-07 20:51:29 +00:00
|
|
|
- docker tag $CI_REGISTRY_IMAGE:$BASE_TAG $CI_REGISTRY_IMAGE:$SHORT_TAG
|
|
|
|
- docker push $CI_REGISTRY_IMAGE --all-tags
|
2021-10-02 03:54:09 +00:00
|
|
|
|
|
|
|
Push Latest:
|
|
|
|
<<: *docker_push
|
|
|
|
needs:
|
|
|
|
- Docker Build
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
variables:
|
|
|
|
NEW_TAG: latest
|
2023-08-09 19:45:27 +00:00
|
|
|
SHORT_TAG: $NEW_TAG
|
2021-10-02 03:54:09 +00:00
|
|
|
|
|
|
|
Push Tags:
|
|
|
|
<<: *docker_push
|
|
|
|
needs:
|
|
|
|
- Docker Build
|
|
|
|
only:
|
|
|
|
- tags
|
|
|
|
variables:
|
2021-10-19 04:55:53 +00:00
|
|
|
NEW_TAG: $CI_COMMIT_TAG
|