veloren/.gitlab/CI/publish.gitlab-ci.yml
Marcel Märtens edce01c336 implement a new tag system for all veloren runners, including
- project tag:
   - `veloren/veloren`: for the veloren repo only
   - `veloren/*`: for projects thats are in the veloren namespace, e.g. usefull for smaller projects that dont have their own tag
   - `*/*` for projects by 3rd parties, e.g. personal projects
 - trusted tag:
   - `owned`:  The runner is hosted on veloren hardware
   - `trusted`: The runner is hosted by a private person, trusted by the veloren devs
   - NONE: if no special trust is given in a runner
 - check/build tag:
   - `check`: a job only performs a check and NO executable is build for users
   - `build`: the job contains atleast 1 executable that can be run by users
   - NONE: neither a check nor a executable is build, e.g. usefull for pages or meta jobs
 - publish tag:
   - `publish`: this job produces a artifact that is automatically pushed to users
   - NONE: no artifact is pushed automatically to users
 - pin tags:
   - `benchmark`: pin a runner to a specific job for the cause of benchmarks
   - `veloren/*:macos`: runs on a native macos runner ONLY, this needs to be a modified project tag, as otherwise also normal checks would run on this runner.
   - NONE: no runner is pinned
2021-08-19 09:23:31 +02:00

74 lines
2.7 KiB
YAML

# 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 && $CI_PIPELINE_SOURCE != "schedule"
when: on_success
- when: never
.publish-nightly:
stage: publish
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "schedule"
when: on_success
- when: never
docker:
extends: .publish
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
tags: ["veloren/veloren", "publish", "trusted"]
dependencies:
- linux
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
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/server-cli/Dockerfile --destination "${CI_REGISTRY_IMAGE}/server-cli:${CI_COMMIT_REF_NAME}"
docker-nightly:
extends: .publish-nightly
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
tags: ["veloren/veloren", "publish", "trusted"]
dependencies:
- air-linux
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
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/server-cli/Dockerfile --destination "${CI_REGISTRY_IMAGE}/server-cli:nightly"
tag-nightly:
extends: .publish-nightly
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}
- git tag -a "nightly" -m '' -f
- git push origin nightly -f
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