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
|
2022-03-19 11:49:40 +00:00
|
|
|
before_script:
|
|
|
|
- source "$CI_PROJECT_DIR/.gitlab/scripts/utils.sh"
|
|
|
|
- publishtype PUBLISH_TYPE
|
|
|
|
- publishdockertag PUBLISH_DOCKER_TAG
|
|
|
|
- publishgittag PUBLISH_GIT_TAG
|
|
|
|
- echo "Publish detected '$PUBLISH_TYPE' Docker Tag '$PUBLISH_DOCKER_TAG' Git Tag '$PUBLISH_GIT_TAG'"
|
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
|
|
|
- |
|
|
|
|
if [[ ! -z "${PUBLISH_DOCKER_TAG}" ]]; then
|
|
|
|
/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
|
2021-07-20 21:03:10 +00:00
|
|
|
image: registry.gitlab.com/veloren/veloren-docker-ci/cache/quality:${CACHE_IMAGE_TAG}
|
2021-08-17 11:22:18 +00:00
|
|
|
tags: ["veloren/veloren", "publish", "trusted"]
|
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
|
|
|
- |
|
|
|
|
if [[ ! -z "${PUBLISH_GIT_TAG}" ]]; then
|
|
|
|
git tag -a "${PUBLISH_GIT_TAG}" -m '' -f;
|
|
|
|
git push origin "${PUBLISH_GIT_TAG}" -f;
|
|
|
|
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
|
2021-06-01 20:26:41 +00:00
|
|
|
image: registry.gitlab.com/veloren/veloren-docker-ci/cache/quality:${CACHE_IMAGE_TAG}
|
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
|
2020-09-17 10:03:50 +00:00
|
|
|
- cargo doc --no-deps --document-private-items
|
2021-07-20 21:03:10 +00:00
|
|
|
- mv target/doc/* public
|