Prefer CI_REGISTRY_PASSWORD over CI_REGISTRY_PASS

This commit is contained in:
Peter Leitzen 2019-04-21 20:08:39 +02:00 committed by Niclas Mietz
parent 1f048d144e
commit ad8b54bdb9
2 changed files with 9 additions and 8 deletions

View File

@ -7,7 +7,7 @@ before_script:
- export VERSION=$(cat VERSION)
- export CI_REGISTRY=${CI_REGISTRY:-hub.docker.com}
- export CI_REGISTRY_USER=${CI_REGISTRY_USER:-gitlab-ci-token}
- export CI_REGISTRY_PASS=${CI_REGISTRY_PASS:-${CI_JOB_TOKEN}}
- export CI_REGISTRY_PASSWORD=${CI_REGISTRY_PASS:-${CI_REGISTRY_PASSWORD:-${CI_JOB_TOKEN}}}
- export DOCKER_IMAGE=${DOCKER_IMAGE:-${CI_REGISTRY}/${CI_PROJECT_PATH}}
- |
if [ "${DOCKER_IMAGE}" = "/" ]; then
@ -19,7 +19,7 @@ docker:build:
only:
- master
script:
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASS} ${CI_REGISTRY}
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
- docker build
--pull
--cache-from=${DOCKER_IMAGE}

View File

@ -4,9 +4,10 @@ When using your own gitlab instance, the provided .gitlab-ci.yml will be automat
Overrides for these values can be set within the project, under `Settings` -> `CI/CD` -> `Variables`.
| Variable | Default Value | Description |
| ------------------ | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `CI_REGISTRY` | `hub.docker.com` | If available this will be automatically overriden by registry address which is configured within the GitLab instance |
| `CI_REGISTRY_USER` | `gitlab-ci-token` | Username for the registry |
| `CI_REGISTRY_PASS` | `${CI_JOB_TOKEN}` | Password for the registry |
| `DOCKER_IMAGE` | `sameersbn/gitlab` | Docker image name, will be automatically be overriden by the running GitLab instance with the `${CI_PROJECT_PATH}` variable. This will case the image to be uploaded to the local registry of the project within GitLab. |
| Variable | Default Value | Description |
| ---------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `CI_REGISTRY` | `hub.docker.com` | If available this will be automatically overriden by registry address which is configured within the GitLab instance |
| `CI_REGISTRY_USER` | `gitlab-ci-token` | Username for the registry |
| `CI_REGISTRY_PASSWORD` | `${CI_JOB_TOKEN}` | Password for the registry |
| `CI_REGISTRY_PASS` | `${CI_JOB_TOKEN}` | DEPRECATED: Use `CI_REGISTRY_PASSWORD` |
| `DOCKER_IMAGE` | `sameersbn/gitlab` | Docker image name, will be automatically be overriden by the running GitLab instance with the `${CI_PROJECT_PATH}` variable. This will case the image to be uploaded to the local registry of the project within GitLab. |