# Publishes veloren-server-cli to the gitlab container registry # https://gitlab.com/veloren/veloren/container_registry .publish: stage: publish rules: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH when: on_success - when: never 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'" docker: extends: .publish image: name: gcr.io/kaniko-project/executor:debug entrypoint: [""] tags: ["veloren/veloren", "publish", "trusted"] dependencies: - linux-x86_64 before_script: - ls "$CI_PROJECT_DIR/server-cli/" script: # Help kaniko identify that it is running in a container. # avoids this issue: https://github.com/GoogleContainerTools/kaniko/issues/1542 - export container=docker - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json - | 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 gittag: extends: .publish image: registry.gitlab.com/veloren/veloren-docker-ci/cache/quality:${CACHE_IMAGE_TAG} tags: ["veloren/veloren", "publish", "trusted"] 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} - | if [[ ! -z "${PUBLISH_GIT_TAG}" ]]; then git tag -a "${PUBLISH_GIT_TAG}" -m '' -f; git push origin "${PUBLISH_GIT_TAG}" -f; fi pages: extends: .publish image: registry.gitlab.com/veloren/veloren-docker-ci/cache/quality:${CACHE_IMAGE_TAG} tags: ["veloren/veloren", "publish"] artifacts: paths: - public script: - rm -rf public - mkdir -p public - cargo doc --no-deps --document-private-items - mv target/doc/* public