2020-05-23 08:02:39 +00:00
|
|
|
# Publishes veloren-server-cli to the gitlab container registry
|
|
|
|
# https://gitlab.com/veloren/veloren/container_registry
|
2020-06-12 11:09:56 +00:00
|
|
|
.publish:
|
2020-05-14 16:12:22 +00:00
|
|
|
stage: publish
|
2020-06-12 11:09:56 +00:00
|
|
|
rules:
|
2022-03-19 11:49:40 +00:00
|
|
|
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
2021-07-22 10:05:30 +00:00
|
|
|
when: on_success
|
2020-06-17 08:41:05 +00:00
|
|
|
- when: never
|
2020-06-12 11:09:56 +00:00
|
|
|
|
|
|
|
docker:
|
|
|
|
extends: .publish
|
2020-05-14 16:12:22 +00:00
|
|
|
image:
|
|
|
|
name: gcr.io/kaniko-project/executor:debug
|
|
|
|
entrypoint: [""]
|
2021-08-17 11:22:18 +00:00
|
|
|
tags: ["veloren/veloren", "publish", "trusted"]
|
2020-05-14 16:12:22 +00:00
|
|
|
dependencies:
|
2022-02-14 15:30:37 +00:00
|
|
|
- linux-x86_64
|
2020-05-14 16:12:22 +00:00
|
|
|
before_script:
|
|
|
|
- ls "$CI_PROJECT_DIR/server-cli/"
|
|
|
|
script:
|
2021-07-19 11:33:19 +00:00
|
|
|
# Help kaniko identify that it is running in a container.
|
|
|
|
# avoids this issue: https://github.com/GoogleContainerTools/kaniko/issues/1542
|
|
|
|
- export container=docker
|
2020-05-14 16:12:22 +00:00
|
|
|
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
|
2022-03-19 11:49:40 +00:00
|
|
|
- |
|
2022-04-25 06:10:35 +00:00
|
|
|
source "$CI_PROJECT_DIR/.gitlab/scripts/util.sh";
|
|
|
|
publishdockertag;
|
2022-04-06 19:08:29 +00:00
|
|
|
if [ "${PUBLISH_DOCKER_TAG}" != "" ]; then
|
2022-03-19 11:49:40 +00:00
|
|
|
/kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/server-cli/Dockerfile --destination "${CI_REGISTRY_IMAGE}/server-cli:${PUBLISH_DOCKER_TAG}"
|
|
|
|
fi
|
2020-06-11 13:24:07 +00:00
|
|
|
|
2022-03-19 11:49:40 +00:00
|
|
|
gittag:
|
|
|
|
extends: .publish
|
2022-04-08 13:15:50 +00:00
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "schedule"
|
2023-12-21 14:19:05 +00:00
|
|
|
image: bitnami/git:latest
|
2022-04-24 16:26:21 +00:00
|
|
|
dependencies: []
|
2021-08-17 11:22:18 +00:00
|
|
|
tags: ["veloren/veloren", "publish", "trusted"]
|
2023-12-21 16:43:49 +00:00
|
|
|
before_script:
|
|
|
|
- git --version
|
|
|
|
- git lfs --version
|
2021-07-20 21:03:10 +00:00
|
|
|
script:
|
|
|
|
- git config --global user.email "gitlab-veloren-bot@veloren.net"
|
|
|
|
- git config --global user.name "veloren-bot"
|
|
|
|
- git config --global http.postBuffer 52428800
|
|
|
|
- git remote set-url origin https://veloren-bot:${GITLAB_TOKEN_WRITE}@${CI_PROJECT_URL:8}
|
2022-03-19 11:49:40 +00:00
|
|
|
- |
|
2022-04-08 13:15:50 +00:00
|
|
|
if [[ ! "${SCHEDULE_CADENCE}" =~ ${TAG_REGEX} ]]; then
|
2023-11-30 10:17:06 +00:00
|
|
|
git reflog expire --expire=now --all;
|
|
|
|
git gc --prune=now;
|
2023-07-27 11:22:06 +00:00
|
|
|
git fetch;
|
2022-04-08 13:15:50 +00:00
|
|
|
git tag -a "${SCHEDULE_CADENCE}" -m '' -f;
|
2023-10-26 22:53:05 +00:00
|
|
|
git push origin "${SCHEDULE_CADENCE}" -f || echo "failed pushed, trying again" && sleep 5 && git status && git fsck && git push origin "${SCHEDULE_CADENCE}" -f;
|
2022-03-19 11:49:40 +00:00
|
|
|
fi
|
2021-07-20 21:03:10 +00:00
|
|
|
|
2020-06-11 13:24:07 +00:00
|
|
|
pages:
|
2020-06-12 11:09:56 +00:00
|
|
|
extends: .publish
|
2022-04-06 19:08:29 +00:00
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE != "schedule"
|
2021-06-01 20:26:41 +00:00
|
|
|
image: registry.gitlab.com/veloren/veloren-docker-ci/cache/quality:${CACHE_IMAGE_TAG}
|
2022-04-24 16:26:21 +00:00
|
|
|
dependencies: []
|
2021-08-17 11:22:18 +00:00
|
|
|
tags: ["veloren/veloren", "publish"]
|
2020-06-11 13:24:07 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2020-06-19 07:39:53 +00:00
|
|
|
- public
|
2020-06-11 13:24:07 +00:00
|
|
|
script:
|
|
|
|
- rm -rf public
|
|
|
|
- mkdir -p public
|
2023-04-22 18:16:14 +00:00
|
|
|
- RUSTDOCFLAGS="--enable-index-page -Zunstable-options" cargo doc --no-deps --document-private-items
|
|
|
|
- mv target/doc/* public
|